Class: RbSDL2::Rect
- Inherits:
-
Object
- Object
- RbSDL2::Rect
- Defined in:
- lib/rb_sdl2/rect.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(x = 0, y = 0, w = 0, h = 0) ⇒ Rect
constructor
A new instance of Rect.
- #to_a ⇒ Object (also: #to_ary)
- #to_ptr ⇒ Object
Constructor Details
#initialize(x = 0, y = 0, w = 0, h = 0) ⇒ Rect
Returns a new instance of Rect.
9 10 11 12 |
# File 'lib/rb_sdl2/rect.rb', line 9 def initialize(x = 0, y = 0, w = 0, h = 0) @st = ::SDL::Rect.new @st[:x], @st[:y], @st[:w], @st[:h] = x, y, w, h end |
Class Method Details
.to_ary(ptr) ⇒ Object
4 5 6 |
# File 'lib/rb_sdl2/rect.rb', line 4 def to_ary(ptr) ::SDL::Rect.new(ptr).values end |
Instance Method Details
#to_a ⇒ Object Also known as: to_ary
14 |
# File 'lib/rb_sdl2/rect.rb', line 14 def to_a = @st.values |
#to_ptr ⇒ Object
18 |
# File 'lib/rb_sdl2/rect.rb', line 18 def to_ptr = @st.to_ptr |