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
Class Method Details
.copy_from(vec) ⇒ Object
70 71 72 |
# File 'lib/raylib_helper.rb', line 70 def self.copy_from(vec) Vector2.create(vec[:x], vec[:y]) end |
.create(x = 0, y = 0) ⇒ Object
66 67 68 |
# File 'lib/raylib_helper.rb', line 66 def self.create(x = 0, y = 0) Vector2.new.set(x, y) end |
Instance Method Details
#set(x, y) ⇒ Object
74 75 76 77 78 |
# File 'lib/raylib_helper.rb', line 74 def set(x, y) self[:x] = x self[:y] = y self end |
#x ⇒ Object
80 |
# File 'lib/raylib_helper.rb', line 80 def x() self[:x] end |
#x=(v) ⇒ Object
81 |
# File 'lib/raylib_helper.rb', line 81 def x=(v) self[:x] = v end |
#y ⇒ Object
82 |
# File 'lib/raylib_helper.rb', line 82 def y() self[:y] end |
#y=(v) ⇒ Object
83 |
# File 'lib/raylib_helper.rb', line 83 def y=(v) self[:y] = v end |