Drag[en]gine Script Module DragonScript
1.23
|
Construct dynamic skins with multiple skin properties from items. More...
Public Member Functions | |
void | addItem (ConstructedDynamicSkinItem item) |
Add item. More... | |
void | addRenderable (String name, Point size, Color color) |
Add renderable with default color. More... | |
void | addRenderable (String name, Point size, float value) |
Add renderable with default value. More... | |
void | addRenderable (String name, Point size, Image image) |
Add renderable with default image. More... | |
void | addRenderable (String name, Point size, Skin skin, int texture) |
Add renderable with default value. More... | |
void | forEachItem (Block ablock) |
Visit items with block with parameter ConstructedDynamicSkinItem. More... | |
DynamicSkin | getDynamicSkin () |
Dynamic skin. More... | |
ConstructedDynamicSkinItem | getItemAt (int index) |
Item at index. More... | |
int | getItemCount () |
Number of items. More... | |
ConstructedDynamicSkin | new () |
Create constructed dynamic skin. More... | |
ConstructedDynamicSkin | new (DynamicSkin dynamicSkin) |
Create constructed dynamic skin. More... | |
void | removeAllItems () |
Remove all items. More... | |
void | removeAllRenderables () |
Remove all renderables. More... | |
void | removeItem (ConstructedDynamicSkinItem item) |
Remove item. More... | |
Protected Member Functions | |
void | addCanvasForProperty (ConstructedDynamicSkinItem item, ConstructedDynamicSkinProperty property, CanvasView view) |
Add canvas for item property. More... | |
void | removeCanvasForItem (ConstructedDynamicSkinItem item) |
Remove canvas for item. More... | |
Construct dynamic skins with multiple skin properties from items.
Supports adding items defining multiple optional skin properties using images or colors. The renderables in the dynamic skin are named after skin property names and the items used to update the content for each of them. All renderables are canvas type with each item adding appropriate canvas instances. All combined this yields a dynamic skin that is able to fully replace the content of a skin texture where each supported texture property has the renderable property set with the name of the texture property.
After creating a new instance the contained dynamic skin has no renderables. Add first all properties supported by your skin of choice with the default color or value to use. Whenever an item canvas are created and added for all properties in item matching renderables names defined above. No additional renderables will be created. If an item property name does not match it is ignored.
|
protected |
Add canvas for item property.
void Dragengine.Utils.ConstructedDynamicSkin.addItem | ( | ConstructedDynamicSkinItem | item | ) |
Add item.
Add renderable with default color.
void Dragengine.Utils.ConstructedDynamicSkin.addRenderable | ( | String | name, |
Point | size, | ||
float | value | ||
) |
Add renderable with default value.
Add renderable with default image.
void Dragengine.Utils.ConstructedDynamicSkin.addRenderable | ( | String | name, |
Point | size, | ||
Skin | skin, | ||
int | texture | ||
) |
Add renderable with default value.
Looks up property named "name" in texture in skin.
void Dragengine.Utils.ConstructedDynamicSkin.forEachItem | ( | Block | ablock | ) |
Visit items with block with parameter ConstructedDynamicSkinItem.
DynamicSkin Dragengine.Utils.ConstructedDynamicSkin.getDynamicSkin | ( | ) |
Dynamic skin.
ConstructedDynamicSkinItem Dragengine.Utils.ConstructedDynamicSkin.getItemAt | ( | int | index | ) |
Item at index.
int Dragengine.Utils.ConstructedDynamicSkin.getItemCount | ( | ) |
Number of items.
ConstructedDynamicSkin Dragengine.Utils.ConstructedDynamicSkin.new | ( | ) |
Create constructed dynamic skin.
Creates a new dynamic skin.
ConstructedDynamicSkin Dragengine.Utils.ConstructedDynamicSkin.new | ( | DynamicSkin | dynamicSkin | ) |
Create constructed dynamic skin.
If dynamicSkin is null creates a new dynamic skin. Otherwise takes control of dynamicSkin removing all renderables.
void Dragengine.Utils.ConstructedDynamicSkin.removeAllItems | ( | ) |
Remove all items.
void Dragengine.Utils.ConstructedDynamicSkin.removeAllRenderables | ( | ) |
Remove all renderables.
|
protected |
Remove canvas for item.
void Dragengine.Utils.ConstructedDynamicSkin.removeItem | ( | ConstructedDynamicSkinItem | item | ) |
Remove item.