Constructor
new Size2(width, height)
Creates a new Size2.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
width |
Number | 0 | The width of the size. |
height |
Number | 0 | The height of the size. |
Methods
aspectRatio() → {Number}
Calculates the aspect ratio of the size (its width divided by its height).
Returns:
The aspect ratio of the size.
- Type
- Number
clone() → {Size2}
Creates a clone of the size.
Returns:
The cloned size.
- Type
- Size2
copy(size) → {Size2}
Copies the width and the height of another size.
Parameters:
Name | Type | Description |
---|---|---|
size |
Size2 | The size to copy. |
Returns:
The size.
- Type
- Size2
equals(size) → {Boolean}
Compares the properties to another size.
Parameters:
Name | Type | Description |
---|---|---|
size |
Size2 | The size to compare to. |
Returns:
A value indicating whether the properties of the sizes are equal.
- Type
- Boolean
set(width, height) → {Size2}
Sets the width and the height of the size.
Parameters:
Name | Type | Description |
---|---|---|
width |
Number | The width to set. |
height |
Number | The height to set. |
Returns:
The size.
- Type
- Size2