Drag[en]gine Script Module DragonScript
1.21
|
Immutable image resources. More...
Constructors | |
Image | new (String filename) |
Load image from file. More... | |
static void | loadAsynchron (String filename, ResourceListener listener) |
Load image from file asynchronously. More... | |
Management | |
String | getFilename () |
Normalized filename the image has been loaded from. More... | |
int | getWidth () |
Width in pixels. More... | |
int | getHeight () |
Height in pixels. More... | |
Point | getSize () |
Width and height in pixels. More... | |
int | getDepth () |
Depth in layers. More... | |
int | getComponentCount () |
Component count in the range from 1 to 4. More... | |
int | getBitCount () |
Bit count which is 8, 16 or 32. More... | |
void | saveToFile (String filename) |
Save image to file. More... | |
Image | dropAlpha () |
Drop alpha component. More... | |
bool | equals (Object other) |
Image is equal to another object. More... | |
int | hashCode () |
Hash code for use as dictionary keys. More... | |
static bool | equals (Image image1, Image image2) |
Images are equal. More... | |
Immutable image resources.
Images can be loaded from file or produced by the game engine or modules. Once created the image content is immutable.
This is a native class. It can not be subclassed.
Image Dragengine.Gui.Image.dropAlpha | ( | ) |
Drop alpha component.
Images are equal.
In contrary to equals(Object) this is safe to be called with null values.
bool Dragengine.Gui.Image.equals | ( | Object | other | ) |
int Dragengine.Gui.Image.getBitCount | ( | ) |
Bit count which is 8, 16 or 32.
int Dragengine.Gui.Image.getComponentCount | ( | ) |
Component count in the range from 1 to 4.
int Dragengine.Gui.Image.getDepth | ( | ) |
Depth in layers.
String Dragengine.Gui.Image.getFilename | ( | ) |
Normalized filename the image has been loaded from.
int Dragengine.Gui.Image.getHeight | ( | ) |
Height in pixels.
Point Dragengine.Gui.Image.getSize | ( | ) |
Width and height in pixels.
int Dragengine.Gui.Image.getWidth | ( | ) |
Width in pixels.
int Dragengine.Gui.Image.hashCode | ( | ) |
Hash code for use as dictionary keys.
Implements Object.hashCode().
|
static |
Load image from file asynchronously.
Registers a request in the game engine to load an image. Once finished or if the file is already loaded the listener is used to deliver the loaded image or null if the loading failed.
Image Dragengine.Gui.Image.new | ( | String | filename | ) |
Load image from file.
If the image file has been already loaded it is assigned to this object. If the image is not loaded yet the engine loads the image. This call blocks until the image is fully loaded and ready to be used. For asynchronous loading use loadAsynchron(). Multiple objects can point to the same loaded image resource. Once no object instance uses an image file anymore it is released from memory.
void Dragengine.Gui.Image.saveToFile | ( | String | filename | ) |
Save image to file.