Class: Raylib::Camera2D
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- Raylib::Camera2D
- Defined in:
- lib/raylib/core/structs/camera2_d.rb
Overview
Camera2D, defines position/orientation in 2d space
Class Method Summary collapse
Instance Method Summary collapse
-
#offset ⇒ Vector2
Camera offset (displacement from target).
-
#offset=(new_offset) ⇒ Object
Sets Camera offset (displacement from target).
-
#rotation ⇒ Float
Camera rotation in degrees.
-
#rotation=(new_rotation) ⇒ Object
Sets Camera rotation in degrees.
-
#target ⇒ Vector2
Camera target (rotation and zoom origin).
-
#target=(new_target) ⇒ Object
Sets Camera target (rotation and zoom origin).
- #to_s ⇒ Object
-
#zoom ⇒ Float
Camera zoom (scaling), should be 1.0f by default.
-
#zoom=(new_zoom) ⇒ Object
Sets Camera zoom (scaling), should be 1.0f by default.
Class Method Details
.create(offset, target, rotation, zoom) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/raylib/core/structs/camera2_d.rb', line 11 def self.create(offset, target, rotation, zoom) new.tap do |instance| instance[:offset] = offset instance[:target] = target instance[:rotation] = rotation instance[:zoom] = zoom end end |
Instance Method Details
#offset ⇒ Vector2
Camera offset (displacement from target)
26 |
# File 'lib/raylib/core/structs/camera2_d.rb', line 26 def offset = self[:offset] |
#offset=(new_offset) ⇒ Object
Sets Camera offset (displacement from target)
29 30 31 |
# File 'lib/raylib/core/structs/camera2_d.rb', line 29 def offset=(new_offset) self[:offset] = new_offset end |
#rotation ⇒ Float
Camera rotation in degrees
44 |
# File 'lib/raylib/core/structs/camera2_d.rb', line 44 def rotation = self[:rotation] |
#rotation=(new_rotation) ⇒ Object
Sets Camera rotation in degrees
47 48 49 |
# File 'lib/raylib/core/structs/camera2_d.rb', line 47 def rotation=(new_rotation) self[:rotation] = new_rotation end |
#target ⇒ Vector2
Camera target (rotation and zoom origin)
35 |
# File 'lib/raylib/core/structs/camera2_d.rb', line 35 def target = self[:target] |
#target=(new_target) ⇒ Object
Sets Camera target (rotation and zoom origin)
38 39 40 |
# File 'lib/raylib/core/structs/camera2_d.rb', line 38 def target=(new_target) self[:target] = new_target end |
#to_s ⇒ Object
20 21 22 |
# File 'lib/raylib/core/structs/camera2_d.rb', line 20 def to_s "Raylib::Camera2D##{object_id} offset=#{offset} target=#{target} rotation=#{rotation} zoom=#{zoom}" end |
#zoom ⇒ Float
Camera zoom (scaling), should be 1.0f by default
53 |
# File 'lib/raylib/core/structs/camera2_d.rb', line 53 def zoom = self[:zoom] |
#zoom=(new_zoom) ⇒ Object
Sets Camera zoom (scaling), should be 1.0f by default
56 57 58 |
# File 'lib/raylib/core/structs/camera2_d.rb', line 56 def zoom=(new_zoom) self[:zoom] = new_zoom end |