Size
Description:
A size object with a given width and height.
Class Object: Size Class.
Inherits from: ContainerItem.
width
Type: Field.
Description:
The width of the size.
Signature:
width: number
height
Type: Field.
Description:
The height of the size.
Signature:
height: number
set
Type: Function.
Description:
Set the width and height of the size.
Signature:
set: function(self: Size, width: number, height: number)
Parameters:
Parameter | Type | Description |
---|---|---|
width | number | The new width of the size. |
height | number | The new height of the size. |
equals
Type: Function.
Description:
Check if two sizes are equal.
Signature:
equals: function(self: Size, other: Size): boolean
Usage:
sizeA == sizeB or sizeC ~= sizeD
Parameters:
Parameter | Type | Description |
---|---|---|
other | Size | The other size to compare to. |
Returns:
Return Type | Description |
---|---|
boolean | Whether or not the two sizes are equal. |
mul
Type: Function.
Description:
Multiply the size by a vector.
Signature:
mul: function(self: Size, vec: Dora.Vec2.Type): Size
Usage:
local halfSize = size * Vec2(0.5, 0.5)
Parameters:
Parameter | Type | Description |
---|---|---|
vec | Vec2 | The vector to multiply by. |
Returns:
Return Type | Description |
---|---|
Size | The result of multiplying the size by the vector. |
__eq
Type: Metamethod.
Description: