Sha256: 46903a6d4044a145110c29fbfbcfad1f0cac2fc561303bd9fe0f6ba244920f05

Contents?: true

Size: 596 Bytes

Versions: 1

Compression:

Stored size: 596 Bytes

Contents

require_relative 'general_object.rb'
class Cursor < GeneralObject
  # attr_reader :img, :visible, :imgObj


  def get_image
    Gosu::Image.new("#{MEDIA_DIRECTORY}/crosshair.png")
  end

  
  def initialize scale
    @scale = scale
    @image = get_image
    @image_width  = @image.width  * @scale
    @image_height = @image.height * @scale
    @image_size   = @image_width  * @image_height / 2
    @image_radius = (@image_width  + @image_height) / 4
  end


  def draw mouse_x, mouse_y
    @image.draw(mouse_x - get_width / 2, mouse_y - get_height / 2, ZOrder::Cursor, @scale, @scale)
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
line-em-up-0.3.5 line-em-up/models/cursor.rb