Class: Xibe::Layer
- Inherits:
-
Object
- Object
- Xibe::Layer
- Defined in:
- lib/xibe.rb
Instance Attribute Summary collapse
-
#height ⇒ Object
Returns the value of attribute height.
-
#visible ⇒ Object
Returns the value of attribute visible.
-
#width ⇒ Object
Returns the value of attribute width.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
-
#z ⇒ Object
Returns the value of attribute z.
Instance Method Summary collapse
-
#bottom ⇒ Object
Returns the bottom position.
- #hide ⇒ Object
-
#initialize ⇒ Layer
constructor
A new instance of Layer.
-
#left ⇒ Object
Returns the left position.
-
#pos(x, y) ⇒ Object
Sets X and Y position.
-
#right ⇒ Object
Returns the right position.
- #show ⇒ Object
-
#top ⇒ Object
Returns the top position.
Constructor Details
#initialize ⇒ Layer
Returns a new instance of Layer.
336 337 338 339 340 341 342 343 |
# File 'lib/xibe.rb', line 336 def initialize @x = 0 @y = 0 @width = 0 @height = 0 @z = 0 @visible = true end |
Instance Attribute Details
#height ⇒ Object
Returns the value of attribute height.
335 336 337 |
# File 'lib/xibe.rb', line 335 def height @height end |
#visible ⇒ Object
Returns the value of attribute visible.
335 336 337 |
# File 'lib/xibe.rb', line 335 def visible @visible end |
#width ⇒ Object
Returns the value of attribute width.
335 336 337 |
# File 'lib/xibe.rb', line 335 def width @width end |
#x ⇒ Object
Returns the value of attribute x.
335 336 337 |
# File 'lib/xibe.rb', line 335 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
335 336 337 |
# File 'lib/xibe.rb', line 335 def y @y end |
#z ⇒ Object
Returns the value of attribute z.
335 336 337 |
# File 'lib/xibe.rb', line 335 def z @z end |
Instance Method Details
#bottom ⇒ Object
Returns the bottom position
364 365 366 |
# File 'lib/xibe.rb', line 364 def bottom @y + @height end |
#hide ⇒ Object
349 350 351 |
# File 'lib/xibe.rb', line 349 def hide @visible = false end |
#left ⇒ Object
Returns the left position
369 370 371 |
# File 'lib/xibe.rb', line 369 def left @x end |
#pos(x, y) ⇒ Object
Sets X and Y position
374 375 376 377 |
# File 'lib/xibe.rb', line 374 def pos(x, y) @x = x @y = y end |
#right ⇒ Object
Returns the right position
359 360 361 |
# File 'lib/xibe.rb', line 359 def right @x + @width end |
#show ⇒ Object
345 346 347 |
# File 'lib/xibe.rb', line 345 def show @visible = true end |
#top ⇒ Object
Returns the top position
354 355 356 |
# File 'lib/xibe.rb', line 354 def top @y end |