Class: MG::Size
- Inherits:
-
Object
- Object
- MG::Size
- Defined in:
- motion-game
Overview
A size represents the dimensions of width and height of an object.
When calling a method that expects a Size
object, a 2-element
Array
can be passed instead, as a convenience shortcut. For
example,
node.size = [200, 400]
is the same as
size = MG::Size.new
size.x = 200
size.y = 400
node.size = size
Properties (collapse)
-
- (Float) height
The size height.
-
- (Float) width
The size width.
Helpers (collapse)
-
- (Size) *(delta)
Multiplies the dimensions of the receiver with the given number.
-
- (Size) +(size)
Adds the dimensions of the receiver with the dimensions of the given size object.
-
- (Size) -(size)
Substracts the dimensions of the receiver with the dimensions of the given size object.
-
- (Size) /(delta)
Divides the dimensions of the receiver with the given number.
Instance Attribute Details
- (Float) height
Returns the size height.
604 605 606 |
# File 'motion-game', line 604 def height @height end |
- (Float) width
Returns the size width.
601 602 603 |
# File 'motion-game', line 601 def width @width end |
Instance Method Details
- (Size) *(delta)
Multiplies the dimensions of the receiver with the given number.
629 |
# File 'motion-game', line 629 def *(delta); end |
- (Size) +(size)
Adds the dimensions of the receiver with the dimensions of the given size object.
613 |
# File 'motion-game', line 613 def +(size); end |
- (Size) -(size)
Substracts the dimensions of the receiver with the dimensions of the given size object.
619 |
# File 'motion-game', line 619 def -(size); end |
- (Size) /(delta)
Divides the dimensions of the receiver with the given number.
624 |
# File 'motion-game', line 624 def /(delta); end |