class Core::Cursor
Public Class Methods
new()
click to toggle source
# File lib/cursor.rb, line 5 def initialize @cursor = Core.sprite("cursors/normal") clear @x = 512 @y = 384 end
Public Instance Methods
attach(sprite)
click to toggle source
# File lib/cursor.rb, line 29 def attach(sprite) @sprite = sprite end
clear()
click to toggle source
# File lib/cursor.rb, line 33 def clear @sprite = nil end
draw()
click to toggle source
# File lib/cursor.rb, line 16 def draw if !@x @x = 0 end if !@y @y = 0 end @cursor.draw(@x, @y, Core::CURSOR_Z) if @sprite @sprite.draw(@x+4, @y+8, Core::CURSOR_Z-1) end end
empty?()
click to toggle source
# File lib/cursor.rb, line 37 def empty? return @sprite == nil end
update(x, y)
click to toggle source
# File lib/cursor.rb, line 12 def update(x, y) @x, @y = x, y end