Drag[en]gine Script Module DragonScript
1.21
|
Color list element class property for use with XML loading. More...
Public Member Functions | |
void | addColor (Color color) |
Add color. More... | |
void | copyValue (ElementClass elementClass, ElementClassProperty property) |
Copy value from another element class property of the same type. More... | |
CodecPropertyString | getCodec () |
Coded used to decode color string. More... | |
Color | getColorAt (int index) |
Color at index. More... | |
int | getColorCount () |
Count of colors. More... | |
Array | getColors () |
Colors as Array of Color. More... | |
Array | getColors (StubWithProperties stub) |
Color list modified by stub property if present. More... | |
Array | getColors (StubWithProperties stub, String name) |
Color list modified by stub property if present. More... | |
String | getColorsString () |
Color list string. More... | |
ECPColorList | new (String name, CodecPropertyString codec) |
Create property. More... | |
ECPColorList | new (String name, CodecPropertyString codec, Array colors) |
Create property with initial path. More... | |
Color | randomColor () |
Random color or null if list is empty. More... | |
void | setColors (Array colors) |
Set colors as Array of Color. More... | |
Public Member Functions inherited from Dragengine.Scenery.ElementClassProperty | |
void | dispose () |
Dispose of element class property to break reference loops. More... | |
String | getName () |
Name. More... | |
bool | logPreloadProblems (ElementClass elementClass, Console console) |
Log preloading problems. More... | |
ElementClassProperty | new (String name) |
Create property. More... | |
void | preloadResources (ElementClass elementClass, PreloadCounter counter) |
Preload resources if supported. More... | |
void | setValue (Object value) |
Set value of property from XML decoded value. More... | |
Color list element class property for use with XML loading.
Color list is stored as Array of Color. From XML the color list is read using an encoded string decoded using CodecPropertyString. The following example defines a list with three colors:
In stub properties the coding is of the form "r1,g1,b1 r2,g2,b2 ...". The following example defines the same three colors as above in sub property string form:
"1,0,0 0,1,0.5 0.25,0.5,1"
Optionally newline can be used instead of whitespace. This can be easier to write with long list of colors.
void Dragengine.Scenery.ECPColorList.addColor | ( | Color | color | ) |
Add color.
void Dragengine.Scenery.ECPColorList.copyValue | ( | ElementClass | elementClass, |
ElementClassProperty | property | ||
) |
Copy value from another element class property of the same type.
CodecPropertyString Dragengine.Scenery.ECPColorList.getCodec | ( | ) |
Coded used to decode color string.
Color Dragengine.Scenery.ECPColorList.getColorAt | ( | int | index | ) |
Color at index.
int Dragengine.Scenery.ECPColorList.getColorCount | ( | ) |
Count of colors.
Array Dragengine.Scenery.ECPColorList.getColors | ( | ) |
Colors as Array of Color.
Array Dragengine.Scenery.ECPColorList.getColors | ( | StubWithProperties | stub | ) |
Color list modified by stub property if present.
If named stub property is not present the stored color list is returned. If the named stub property is present it is decoded using the stored decoder and the result returned.
Uses the stored property name as stub property name.
Array Dragengine.Scenery.ECPColorList.getColors | ( | StubWithProperties | stub, |
String | name | ||
) |
Color list modified by stub property if present.
If named stub property is not present the stored color list is returned. If the named stub property is present it is decoded using the stored decoder and the result returned.
String Dragengine.Scenery.ECPColorList.getColorsString | ( | ) |
Color list string.
ECPColorList Dragengine.Scenery.ECPColorList.new | ( | String | name, |
CodecPropertyString | codec | ||
) |
Create property.
ECPColorList Dragengine.Scenery.ECPColorList.new | ( | String | name, |
CodecPropertyString | codec, | ||
Array | colors | ||
) |
Create property with initial path.
Color Dragengine.Scenery.ECPColorList.randomColor | ( | ) |
Random color or null if list is empty.
void Dragengine.Scenery.ECPColorList.setColors | ( | Array | colors | ) |
Set colors as Array of Color.