class UIImage
Image element in a UI.
class UIImage extends UIElement
Inheritance UIElement –> UIImage
| Name | Description |
|---|---|
| Constructors | |
| UIImage() | Creates a new UIImage. |
| Properties | |
| size | A Vector2 representing the ui-image’s size. |
| Methods | |
| getSize() | Get the value of .size |
| setSize() | Set the value of .size |
| setImage() | Set the content of the ui-image. |
Constructors
UIImage()
UIImage()
Creates a new UIImage.
Properties
See the base UIElement class for common properties.
size
.size: Object
A Vector2 representing the ui-image’s size.
Read-only. Use method setSize() to modify this property.
Default is {x: 100, y: 100}.
Methods
See the base UIElement class for common methods.
getSize()
.getSize(vector: Vector2): Vector2
Copy the value of .size into vector.
setSize()
.setSize(vector: Vector2): undefined
Set the value of .size according to vector.
.setSize(x: Number, y: Number ): undefined
Set the value of .size according to the x, y coordinates.
setImage()
.setImage(image: Image): undefined
Set the content of the ui-image using a Image object.
.size will be set according to the image contetnt.