Drag[en]gine Script Module DragonScript Script API  1.0
Image Class Reference

Immutable image resources. More...

Inheritance diagram for Image:

Public Member Functions

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

Constructors

Image new (String filename)
 Load image from file. More...
 
static void loadAsynchron (String filename, ResourceNotifier notifier)
 Load image from file asynchronously. 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.

Author
Roland Pl├╝ss
Version
1.0
Date
2015

Member Function Documentation

§ dropAlpha()

Image dropAlpha ( )

Drop alpha component.

§ equals()

bool 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 getBitCount ( )

Bit count which is 8, 16 or 32.

§ getComponentCount()

int getComponentCount ( )

Component count in the range from 1 to 4.

§ getDepth()

int getDepth ( )

Depth in layers.

§ getFilename()

String getFilename ( )

Normalized filename the image has been loaded from.

§ getHeight()

int getHeight ( )

Height in pixels.

§ getSize()

Point getSize ( )

Width and height in pixels.

§ getWidth()

int getWidth ( )

Width in pixels.

§ hashCode()

int hashCode ( )

Hash code for use as dictionary keys.

Implements Object.hashCode().

§ loadAsynchron()

static void loadAsynchron ( String  filename,
ResourceNotifier  notifier 
)
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 notifier is used to deliver the loaded image or null if the loading failed.

§ new()

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 saveToFile ( String  filename)

Save image to file.


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