|
|
int | getNumPalettes () |
| Returns the number of whole palette overrides. More...
|
|
String | palettePath (int index) |
| Returns the full path (including name and extension) of the palette override at postion 'index'. More...
|
|
void | setPalettePath (int index, String &path) |
| Set the path (including name and extension) of the palette at position 'index'. More...
|
|
void | clearPalettes () |
| Clear the list of whole palette overrides. More...
|
|
void | addPalette (String &path) |
| Add a full palette path at the bottom of the list of whole palette overrides. More...
|
|
void | removePalette (String &path) |
| Remove a palette with the supplied path from the list of whole palette overrides. More...
|
|
|
int | getNumColorOverrides () |
| Returns the number of individual colour overrides. More...
|
|
int | addColorOverride (String &palettePath, String &colorId, QObject newValue, String &mode, String &texture=String()) |
| Add an Individual Color Override with a specific mode, colour and texture filename. More...
|
|
bool | removeColorOverride (int idx) |
| Removes a specific color override at the given index. More...
|
|
bool | setOverridePaletteId (int index, String &paletteId) |
| Change the paletteId of a color override entry on a node. More...
|
|
String | getOverridePaletteId (int index) |
| Get the paletteId of a color override entry on a node. More...
|
|
bool | setOverrideMode (int index, String &mode) |
| Change the override mode of a color override entry on a node. More...
|
|
String | getOverrideMode (int index) |
| Get the override mode of a color override entry on a node. More...
|
|
bool | setOverrideColor (int index, QObject newValue) |
| Change the override color of a color override entry on a node. More...
|
|
ColorRGBA | getOverrideColor (int index) |
| Get the override color of a color override entry on a node. More...
|
|
String | getOverrideTexturePath (int index) |
| Returns the path of a texture file for the colour override at the specified position in the list. More...
|
|
void | setOverrideTexturePath (int index, String &path) |
| Sets the path of a texture file for the colour override at the specified position in the list. More...
|
|
String | getOverridePalettePath (int index) |
| Returns the full path (including name and extension) of the palette to which the override colour belongs. More...
|
|
void | setOverridePalettePath (int index, String &path) |
| Sets the full path (including name and extension) of the palette to which the override colour belongs. More...
|
|
|
int | getNumSelectedColors () |
| Returns the number of selected colours. More...
|
|
String | getSelectedPalettePath (int index) |
| Returns the full path (including name and extension) of the palette to which the selected colour belongs. More...
|
|
void | setSelectedPalettePath (int index, String &path) |
| Sets the full path (including name and extension) of the palette to which the selected colour belongs. More...
|
|
The JavaScript class for manipulating colour override nodes. Created from the node global object.
Used to get information about palettes associated to a colour override node, or to add or remove a palette from the node.
int ColorOverride::addColorOverride |
( |
String & |
palettePath, |
|
|
String & |
colorId, |
|
|
QObject |
newValue, |
|
|
String & |
mode, |
|
|
String & |
texture = String() |
|
) |
| |
|
slot |
Add an Individual Color Override with a specific mode, colour and texture filename.
- Parameters
-
palettePath | : The palette path for the color to override. |
paletteId | : The palette ID of the color to override. |
newValue | : The new colour value to which the id is overridden – defined as a ColorRGBA object. |
mode | : The string that defines the color override mode. |
texture | : The file path for the texture. |
- Returns
- Returns the index of the newly created colour override.
Valid types include the following: RGB,
ALPHA,
RGBA,
TEXTURE, TEX_GLOBAL_BBOX, TEX_GLOBAL_BBOX_CENTRE, TEX_LOCAL_BBOX, TEX_SCREEN, TEX_PENCIL_RGBA, TEX_PENCIL_RGBA_COMBINE_MATRIX, TEX_PENCIL_MATRIX, TEX_PENCIL_COMBINE_MATRIX, TEXTURE_DYNAMIC_CENTERING, TEXTURE_REPLACE_MATRIX, TEXTURE_COMBINE_MATRIX, TEX_PEG, TEX_DYNAMIC
myColorOverride.addColorOverride(
"palette-library/ScenePalette.plt",
"0b5482a850701084",
new ColorRGBA(255,255,255, 255),
"RGBA",
"" );
An example of creating and extending a Colour-Override node.
function randomColourOverride()
{
if( !curPalobj )
{
return;
}
var newColorOverride =
node.
add(
"Top",
"RANDOM_COLOUR_OVERRIDE",
"COLOR_OVERRIDE_TVG", 0, 0, 0);
if( !newColorOverride )
{
return;
}
var colPath = curPalobj.getPath() + "/" + curPalobj.getName() + ".plt";
if( colPath.slice( 0, scenePath.length ) == scenePath )
colPath = colPath.slice(scenePath.length+1);
for( var n=0; n<curPalobj.nColors; n++ )
{
var col = curPalobj.getColorByIndex( n );
var newIdx = myColorOverride.addColorOverride( colPath, col.id,
"RGBA", "" );
}
}
bool ColorOverride::setOverrideMode |
( |
int |
index, |
|
|
String & |
mode |
|
) |
| |
|
slot |
Change the override mode of a color override entry on a node.
- Parameters
-
index | : The index of the color override in the node's color override list. |
mode | : The mode for the color override type. |
Valid types include the following: RGB, ALPHA, RGBA, TEXTURE, TEX_GLOBAL_BBOX, TEX_GLOBAL_BBOX_CENTRE, TEX_LOCAL_BBOX, TEX_SCREEN, TEX_PENCIL_RGBA, TEX_PENCIL_RGBA_COMBINE_MATRIX, TEX_PENCIL_MATRIX, TEX_PENCIL_COMBINE_MATRIX, TEXTURE_DYNAMIC_CENTERING, TEXTURE_REPLACE_MATRIX, TEXTURE_COMBINE_MATRIX, TEX_PEG, TEX_DYNAMIC
myColorOverride.setOverrideMode( 0, "RGBA" );
- Returns
- Returns true if the color override mode has been set appropriately.