Drag[en]gine Script Module DragonScript  1.21
Dragengine.Gui.Image Class Reference

Immutable image resources. More...

Inheritance diagram for Dragengine.Gui.Image:

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...
 

Detailed Description

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.

Member Function Documentation

◆ dropAlpha()

Image Dragengine.Gui.Image.dropAlpha ( )

Drop alpha component.

◆ equals() [1/2]

static bool Dragengine.Gui.Image.equals ( Image  image1,
Image  image2 
)
static

Images are equal.

In contrary to equals(Object) this is safe to be called with null values.

◆ equals() [2/2]

bool Dragengine.Gui.Image.equals ( Object  other)

Image is equal to another object.

Implements Object.equals(Object).

Returns
true if other is of type Image and both point to the same engine image resource.

◆ getBitCount()

int Dragengine.Gui.Image.getBitCount ( )

Bit count which is 8, 16 or 32.

◆ getComponentCount()

int Dragengine.Gui.Image.getComponentCount ( )

Component count in the range from 1 to 4.

◆ getDepth()

int Dragengine.Gui.Image.getDepth ( )

Depth in layers.

◆ getFilename()

String Dragengine.Gui.Image.getFilename ( )

Normalized filename the image has been loaded from.

◆ getHeight()

int Dragengine.Gui.Image.getHeight ( )

Height in pixels.

◆ getSize()

Point Dragengine.Gui.Image.getSize ( )

Width and height in pixels.

◆ getWidth()

int Dragengine.Gui.Image.getWidth ( )

Width in pixels.

◆ hashCode()

int Dragengine.Gui.Image.hashCode ( )

Hash code for use as dictionary keys.

Implements Object.hashCode().

◆ loadAsynchron()

static void Dragengine.Gui.Image.loadAsynchron ( String  filename,
ResourceListener  listener 
)
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.

◆ new()

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.

◆ saveToFile()

void Dragengine.Gui.Image.saveToFile ( String  filename)

Save image to file.


The documentation for this class was generated from the following file: