Class: Hokusai::Canvas
- Inherits:
-
Object
- Object
- Hokusai::Canvas
- Defined in:
- ui/src/hokusai/types.rb
Instance Attribute Summary collapse
-
#height ⇒ Object
Returns the value of attribute height.
-
#reverse ⇒ Object
Returns the value of attribute reverse.
-
#vertical ⇒ Object
Returns the value of attribute vertical.
-
#width ⇒ Object
Returns the value of attribute width.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
-
#initialize(width, height, x = 0.0, y = 0.0, vertical = true, reverse = false) ⇒ Canvas
constructor
A new instance of Canvas.
- #reset(x, y, width, height, vertical: true, reverse: false) ⇒ Object
- #reverse? ⇒ Boolean
- #to_bounds ⇒ Object
- #to_hoku_rect ⇒ Object
Constructor Details
#initialize(width, height, x = 0.0, y = 0.0, vertical = true, reverse = false) ⇒ Canvas
Returns a new instance of Canvas.
125 126 127 128 129 130 131 132 |
# File 'ui/src/hokusai/types.rb', line 125 def initialize(width, height, x = 0.0, y = 0.0, vertical = true, reverse = false) @width = width @height = height @x = x @y = y @vertical = vertical @reverse = reverse end |
Instance Attribute Details
#height ⇒ Object
Returns the value of attribute height.
124 125 126 |
# File 'ui/src/hokusai/types.rb', line 124 def height @height end |
#reverse ⇒ Object
Returns the value of attribute reverse.
124 125 126 |
# File 'ui/src/hokusai/types.rb', line 124 def reverse @reverse end |
#vertical ⇒ Object
Returns the value of attribute vertical.
124 125 126 |
# File 'ui/src/hokusai/types.rb', line 124 def vertical @vertical end |
#width ⇒ Object
Returns the value of attribute width.
124 125 126 |
# File 'ui/src/hokusai/types.rb', line 124 def width @width end |
#x ⇒ Object
Returns the value of attribute x.
124 125 126 |
# File 'ui/src/hokusai/types.rb', line 124 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
124 125 126 |
# File 'ui/src/hokusai/types.rb', line 124 def y @y end |
Instance Method Details
#reset(x, y, width, height, vertical: true, reverse: false) ⇒ Object
134 135 136 137 138 139 140 141 |
# File 'ui/src/hokusai/types.rb', line 134 def reset(x, y, width, height, vertical: true, reverse: false) self.x = x self.y = y self.width = width self.height = height self.vertical = vertical self.reverse = reverse end |
#reverse? ⇒ Boolean
147 148 149 |
# File 'ui/src/hokusai/types.rb', line 147 def reverse? reverse end |
#to_bounds ⇒ Object
143 144 145 |
# File 'ui/src/hokusai/types.rb', line 143 def to_bounds Hokusai::Rect.new(x, y, width, height) end |
#to_hoku_rect ⇒ Object
151 152 153 |
# File 'ui/src/hokusai/types.rb', line 151 def to_hoku_rect LibHokusai::HmlRect.create(x, y, width, height) end |