Class: Raylib::Rectangle

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/raylib/core/structs/rectangle.rb

Overview

Rectangle, 4 components

Class Method Summary collapse

Instance Method Summary collapse

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

#heightFloat

Rectangle height

Returns:

  • (Float)

    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_sObject



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

#widthFloat

Rectangle width

Returns:

  • (Float)

    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

#xFloat

Rectangle top-left corner position x

Returns:

  • (Float)

    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

#yFloat

Rectangle top-left corner position y

Returns:

  • (Float)

    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