#
Class: Image#
HierarchyHandle<image>
↳ Image
#
Constructors#
constructornew Image(file: string, sizeX: number, sizeY: number, sizeZ: number, posX: number, posY: number, posZ: number, originX: number, originY: number, originZ: number, imageType: ImageType): Image
Creates a new image, the first ID given being 0 and then counting upwards (0, 1, 2, 3, ...). Multiple images with the same type are drawn in their order of creation, meaning that the image created first is drawn below the image created after.
#
Parameters:Name | Type | Description |
---|---|---|
file | string | The path to the image. The image itself should have its border alpha-ed out completely. If an invalid path is specified CreateImage returns image(-1). |
sizeX | number | The x-dimensions of the image. |
sizeY | number | The y-dimensions of the image. |
sizeZ | number | The z-dimensions of the image. |
posX | number | The x-cooridnate of where to create the image. This is the bottom left corner of the image. |
posY | number | The y-cooridnate of where to create the image. This is the bottom left corner of the image. |
posZ | number | The z-cooridnate of where to create the image. |
originX | number | Moves the origin (bottom left corner) of the image from posX in negative X-direction. |
originY | number | Moves the origin (bottom left corner) of the image from posY in negative Y-direction. |
originZ | number | Moves the origin (bottom left corner) of the image from posZ in negative Z-direction. |
imageType | ImageType |
Returns: Image
Defined in: handles/image.ts:24
#
Properties#
handle• Readonly
handle: image
Defined in: handles/handle.ts:6
#
Accessors#
idid(): number
Get the unique ID of the handle. The ID is recycled once you destroy the object.
Returns: number
The unique ID of a handle object.
Defined in: handles/handle.ts:18
#
Methods#
destroydestroy(): void
Destroys the image specified and recycles the handle ID of that image instantly (no ref counting for images).
bug
May crash the game if an invalid image is used (null, before the first image is created).
Returns: void
Defined in: handles/image.ts:66
#
setAboveWatersetAboveWater(flag: boolean, useWaterAlpha: boolean): void
Every ImageType other than Selection doesnt seem to appear above water.
#
Parameters:Name | Type | Description |
---|---|---|
flag | boolean | Draws the specified image above the water if the flag is true. |
useWaterAlpha | boolean |
Returns: void
Defined in: handles/image.ts:75
#
setColorsetColor(red: number, green: number, blue: number, alpha: number): void
Valid values for all channels range from 0 to 255.
#
Parameters:Name | Type |
---|---|
red | number |
green | number |
blue | number |
alpha | number |
Returns: void
Defined in: handles/image.ts:82
#
setConstantHeightsetConstantHeight(flag: boolean, height: number): void
This is the only function that is able to modify an image's z-offset.
#
Parameters:Name | Type | Description |
---|---|---|
flag | boolean | |
height | number | The z-offset of the image. |
Returns: void
Defined in: handles/image.ts:91
#
setPositionsetPosition(x: number, y: number, z: number): void
Sets the X/Y position of the provided image. This is the bottom left corner of the image, unless you used values form originX/Y/Z in the constructor other than 0, in which case the bottom left corner is moved further into negative X/Y/Z direction.
#
Parameters:Name | Type |
---|---|
x | number |
y | number |
z | number |
Returns: void
Defined in: handles/image.ts:100
#
setRendersetRender(flag: boolean): void
Enable or disable the rendering of the image.
#
Parameters:Name | Type | Description |
---|---|---|
flag | boolean | render if true, don't render if false |
Returns: void
Defined in: handles/image.ts:108
#
setTypesetType(imageType: ImageType): void
Change image's type.
#
Parameters:Name | Type | Description |
---|---|---|
imageType | ImageType | Influence the order in which images are drawn above one another. |
Returns: void
Defined in: handles/image.ts:116
#
showshow(flag: boolean): void
Show or hide the image depending on boolean flag. Seems like a redundant function in the light of SetImageRender(Always).
#
Parameters:Name | Type | Description |
---|---|---|
flag | boolean | true shows, false hides |
Returns: void
Defined in: handles/image.ts:125
#
fromHandlestatic fromHandle(handle: image): Image
#
Parameters:Name | Type |
---|---|
handle | image |
Returns: Image
Defined in: handles/image.ts:129