Graphics
The Graphics
namespace contains various graphics-related functions.
Constants
Name | Value |
---|---|
BLEND_NORMAL |
0 |
BLEND_ADD |
1 |
BLEND_SUBTRACT |
2 |
BLEND_REVERSESUBTRACT |
3 |
BLEND_MODULATE |
4 |
Functions
Overview
Image Format
Images
ImageFormat
Parameters
formatId (string ): The id of the format to get
Returns
ImageFormat : The format matching the givenformatId . Will be the 'unknown' format if no format with a matching id was found
AllImageFormats
Returns
ImageFormat[] : An array of all supported image formats
DetectImageFormat
Parameters
data (DataBlock ): The image data to check
Returns
ImageFormat : The formatdata was detected as, or the 'unknown' format if the data couldn't be detected as a known format
GetImageInfo
Returns a
Parameters
data (DataBlock ): The image data to read[index] (integer ): The index of the image in the data (for cases where the image format contains multiple images, eg. Duke3D ART). Default is0
Returns
table : A table containing information about the image (see notes below)
Notes
The table returned by this function has the following keys:
Name | Type | Description |
---|---|---|
width |
The pixel width of the image | |
height |
The pixel height of the image | |
type |
The pixel format of the image (see .PIXELFORMAT_ constants) |
|
format |
The format id of the image (see . |
|
imageCount |
The number of sub-images contained in the image | |
offsetX |
The X-offset of the image | |
offsetY |
The Y-offset of the image | |
hasPalette |
true if the image contains an internal palette |