Texture Class Reference

The JavaScript class for manipulating textures. Can be created from a Palette object. More...

Public Slots

void setTiled (bool)
 Set the tiling attribute. More...
 
void setTextureFile (String &filename)
 Will load the file in a bitmap and make an internal copy. More...
 
void setTextureBitmap (QImage &image)
 Will make a copy of the image and store it in the texture. More...
 
- Public Slots inherited from BaseColor
void setName (String &n)
 

Properties

bool tiled
 True if the texture is tiled. More...
 
int width
 Width of the texture. -1 if invalid texture. More...
 
int height
 Height of the texture. -1 if invalid texture. More...
 
QImage bitmap
 Will return a copy of the texture bitmap. More...
 
- Properties inherited from BaseColor
bool isTexture
 If true, the color pot is a texture. More...
 
String name
 The color pot name. More...
 
String id
 Unique ID of the color. More...
 
bool isValid
 Returns true if the color is valid. More...
 

Detailed Description

The JavaScript class for manipulating textures. Can be created from a Palette object.

Class for texture color pots. The texture bitmap is stored internally in the palette once the texture color pot has been created.

var myTexture = myPalette.createNewTexture("myTextureName", filename, false);

Member Function Documentation

◆ setTextureBitmap

void Texture::setTextureBitmap ( QImage &  image)
slot

Will make a copy of the image and store it in the texture.

◆ setTextureFile

void Texture::setTextureFile ( String &  filename)
slot

Will load the file in a bitmap and make an internal copy.

◆ setTiled

void Texture::setTiled ( bool  )
slot

Set the tiling attribute.

Property Documentation

◆ bitmap

QImage Texture::bitmap
read

Will return a copy of the texture bitmap.

◆ height

int Texture::height
read

Height of the texture. -1 if invalid texture.

◆ tiled

bool Texture::tiled
read

True if the texture is tiled.

◆ width

int Texture::width
read

Width of the texture. -1 if invalid texture.