Class: Raylib::Vector2
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- Raylib::Vector2
- Defined in:
- lib/raylib_main.rb,
lib/raylib_helper.rb
Overview
Math helper
Class Method Summary collapse
Instance Method Summary collapse
- #add(x, y) ⇒ Object
- #add_vector(v) ⇒ Object
- #set(x, y) ⇒ Object
- #to_a ⇒ Object
- #x ⇒ Object
- #x=(v) ⇒ Object
- #y ⇒ Object
- #y=(v) ⇒ Object
Class Method Details
Instance Method Details
#add(x, y) ⇒ Object
79 80 81 82 83 |
# File 'lib/raylib_helper.rb', line 79 def add(x, y) self[:x] = self[:x] + x self[:y] = self[:y] + y self end |
#add_vector(v) ⇒ Object
85 86 87 88 89 |
# File 'lib/raylib_helper.rb', line 85 def add_vector(v) self[:x] = self[:x] + v[:x] self[:y] = self[:y] + v[:y] self end |
#set(x, y) ⇒ Object
73 74 75 76 77 |
# File 'lib/raylib_helper.rb', line 73 def set(x, y) self[:x] = x self[:y] = y self end |
#to_a ⇒ Object
91 92 93 |
# File 'lib/raylib_helper.rb', line 91 def to_a [x, y] end |
#x ⇒ Object
421 |
# File 'lib/raylib_main.rb', line 421 def x = self[:x] |
#x=(v) ⇒ Object
422 |
# File 'lib/raylib_main.rb', line 422 def x=(v) self[:x] = v end |
#y ⇒ Object
423 |
# File 'lib/raylib_main.rb', line 423 def y = self[:y] |
#y=(v) ⇒ Object
424 |
# File 'lib/raylib_main.rb', line 424 def y=(v) self[:y] = v end |