User Guide
362 Chapter 16: Working with Models and Model Resources
Texture methods
The pixel height and width of the 2D images you use as textures should be powers of 2 (that is,
2, 4, 8, 16, 32, and so on). If not, the image will be resized to a dimension that is a power of 2.
The
scaleDown() method lets you retain manual control over this procedure at the texture level.
compressed
Get and set The property can be TRUE (1) or FALSE
(0)
:
TRUE (1): the texture is compressed
FALSE (0): the texture is not
compressed
The value changes automatically from
TRUE (1) to FALSE (0) when the texture
is to be rendered.
The value can be set to
FALSE (0) to
decompress or to
TRUE (1) to remove
the decompressed representation from
memory.
TRUE (1)
renderFormat Get and set This property determines how many bits
are used to render the texture. It takes
the following values:
#default: the texure is rendered based
on the value of the
getRendererServices().textureRender
Format
property.
#rgbaWXYZ: renders the texture using W
bits for the red channel, X bits for the
green channel, Y bits for the blue
channel and Z bits for the alpha channel.
This is available using the following
possible combinations:
#rgba8888
#rgba8880
#rgba5650
#rgba5550
#rgba5551
#rgba4444
#default
Method Description Returns
scaleDown()
Reduces the height of the texture to the next lowest
power of 2. This is useful for dynamically resizing
textures to fit on a client machine.
Nothing
Property Access Description Default