Class: Xibe::Layer

Inherits:
Object
  • Object
show all
Defined in:
lib/xibe.rb

Direct Known Subclasses

Image, Sprite, Tilemap

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLayer

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

#heightObject

Returns the value of attribute height.



335
336
337
# File 'lib/xibe.rb', line 335

def height
  @height
end

#visibleObject

Returns the value of attribute visible.



335
336
337
# File 'lib/xibe.rb', line 335

def visible
  @visible
end

#widthObject

Returns the value of attribute width.



335
336
337
# File 'lib/xibe.rb', line 335

def width
  @width
end

#xObject

Returns the value of attribute x.



335
336
337
# File 'lib/xibe.rb', line 335

def x
  @x
end

#yObject

Returns the value of attribute y.



335
336
337
# File 'lib/xibe.rb', line 335

def y
  @y
end

#zObject

Returns the value of attribute z.



335
336
337
# File 'lib/xibe.rb', line 335

def z
  @z
end

Instance Method Details

#bottomObject

Returns the bottom position



364
365
366
# File 'lib/xibe.rb', line 364

def bottom
  @y + @height
end

#hideObject



349
350
351
# File 'lib/xibe.rb', line 349

def hide
  @visible = false
end

#leftObject

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

#rightObject

Returns the right position



359
360
361
# File 'lib/xibe.rb', line 359

def right
  @x + @width
end

#showObject



345
346
347
# File 'lib/xibe.rb', line 345

def show
  @visible = true
end

#topObject

Returns the top position



354
355
356
# File 'lib/xibe.rb', line 354

def top
  @y
end