Class: Raylib::Rectangle
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- Raylib::Rectangle
- Defined in:
- lib/raylib/core/structs/rectangle.rb
Overview
Rectangle, 4 components
Class Method Summary collapse
Instance Method Summary collapse
-
#height ⇒ Float
Rectangle height.
-
#height=(new_height) ⇒ Object
Sets Rectangle height.
- #to_s ⇒ Object
-
#width ⇒ Float
Rectangle width.
-
#width=(new_width) ⇒ Object
Sets Rectangle width.
-
#x ⇒ Float
Rectangle top-left corner position x.
-
#x=(new_x) ⇒ Object
Sets Rectangle top-left corner position x.
-
#y ⇒ Float
Rectangle top-left corner position y.
-
#y=(new_y) ⇒ Object
Sets Rectangle top-left corner position y.
Class Method Details
.create(x, y, width, height) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/raylib/core/structs/rectangle.rb', line 11 def self.create(x, y, width, height) new.tap do |instance| instance[:x] = x instance[:y] = y instance[:width] = width instance[:height] = height end end |
Instance Method Details
#height ⇒ Float
Rectangle height
53 |
# File 'lib/raylib/core/structs/rectangle.rb', line 53 def height = self[:height] |
#height=(new_height) ⇒ Object
Sets Rectangle height
56 57 58 |
# File 'lib/raylib/core/structs/rectangle.rb', line 56 def height=(new_height) self[:height] = new_height end |
#to_s ⇒ Object
20 21 22 |
# File 'lib/raylib/core/structs/rectangle.rb', line 20 def to_s "Raylib::Rectangle##{object_id} x=#{x} y=#{y} width=#{width} height=#{height}" end |
#width ⇒ Float
Rectangle width
44 |
# File 'lib/raylib/core/structs/rectangle.rb', line 44 def width = self[:width] |
#width=(new_width) ⇒ Object
Sets Rectangle width
47 48 49 |
# File 'lib/raylib/core/structs/rectangle.rb', line 47 def width=(new_width) self[:width] = new_width end |
#x ⇒ Float
Rectangle top-left corner position x
26 |
# File 'lib/raylib/core/structs/rectangle.rb', line 26 def x = self[:x] |
#x=(new_x) ⇒ Object
Sets Rectangle top-left corner position x
29 30 31 |
# File 'lib/raylib/core/structs/rectangle.rb', line 29 def x=(new_x) self[:x] = new_x end |
#y ⇒ Float
Rectangle top-left corner position y
35 |
# File 'lib/raylib/core/structs/rectangle.rb', line 35 def y = self[:y] |
#y=(new_y) ⇒ Object
Sets Rectangle top-left corner position y
38 39 40 |
# File 'lib/raylib/core/structs/rectangle.rb', line 38 def y=(new_y) self[:y] = new_y end |