class RbSDL2::Mouse::MouseClass
Attributes
Public Class Methods
new()
click to toggle source
# File lib/rb_sdl2/mouse/mouse_class.rb, line 7 def initialize @button = 0 @x_ptr, @y_ptr = Array.new(2) { ::FFI::MemoryPointer.new(:int) } end
Public Instance Methods
position(= [x, y])
click to toggle source
# File lib/rb_sdl2/mouse/mouse_class.rb, line 18 def position = [x, y] # 継承先のクラスではこのメソッドをオーバーライドすること。 # 戻り値は self が戻ることが期待されている。 def update = self private attr_reader :x_ptr def x = x_ptr.read_int private attr_reader :y_ptr def y = y_ptr.read_int end end
update(= self)
click to toggle source
継承先のクラスではこのメソッドをオーバーライドすること。 戻り値は self が戻ることが期待されている。
# File lib/rb_sdl2/mouse/mouse_class.rb, line 22 def update = self private attr_reader :x_ptr def x = x_ptr.read_int private attr_reader :y_ptr def y = y_ptr.read_int end end end
x(= x_ptr.read_int)
click to toggle source
# File lib/rb_sdl2/mouse/mouse_class.rb, line 26 def x = x_ptr.read_int private attr_reader :y_ptr def y = y_ptr.read_int end end
y(= y_ptr.read_int)
click to toggle source
# File lib/rb_sdl2/mouse/mouse_class.rb, line 30 def y = y_ptr.read_int end