Class: Raylib::Vector2
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- Raylib::Vector2
- Defined in:
- lib/raylib/core/structs/vector2.rb
Overview
Vector2, 2 components
Class Method Summary collapse
Instance Method Summary collapse
- #to_s ⇒ Object
-
#x ⇒ Float
Vector x component.
-
#x=(new_x) ⇒ Object
Sets Vector x component.
-
#y ⇒ Float
Vector y component.
-
#y=(new_y) ⇒ Object
Sets Vector y component.
Class Method Details
.create(x, y) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/raylib/core/structs/vector2.rb', line 9 def self.create(x, y) new.tap do |instance| instance[:x] = x instance[:y] = y end end |
Instance Method Details
#to_s ⇒ Object
16 17 18 |
# File 'lib/raylib/core/structs/vector2.rb', line 16 def to_s "Raylib::Vector2##{object_id} x=#{x} y=#{y}" end |
#x ⇒ Float
Vector x component
22 |
# File 'lib/raylib/core/structs/vector2.rb', line 22 def x = self[:x] |
#x=(new_x) ⇒ Object
Sets Vector x component
25 26 27 |
# File 'lib/raylib/core/structs/vector2.rb', line 25 def x=(new_x) self[:x] = new_x end |
#y ⇒ Float
Vector y component
31 |
# File 'lib/raylib/core/structs/vector2.rb', line 31 def y = self[:y] |
#y=(new_y) ⇒ Object
Sets Vector y component
34 35 36 |
# File 'lib/raylib/core/structs/vector2.rb', line 34 def y=(new_y) self[:y] = new_y end |