|
Drag[en]gine Script Module DragonScript 1.35
|
Construct dynamic skins with multiple skin properties from items. More...
Public Member Functions | |
| void | addItem (ConstructedDynamicSkinItem item) |
| Add item. | |
| void | addRenderable (String name, Point size, Color color) |
| Add renderable with default color. | |
| void | addRenderable (String name, Point size, float value) |
| Add renderable with default value. | |
| void | addRenderable (String name, Point size, Image image) |
| Add renderable with default image. | |
| void | addRenderable (String name, Point size, Skin skin, int texture) |
| Add renderable with default value. | |
| void | forEachItem (Block ablock) |
| Visit items with block with parameter ConstructedDynamicSkinItem. | |
| DynamicSkin | getDynamicSkin () |
| Dynamic skin. | |
| ConstructedDynamicSkinItem | getItemAt (int index) |
| Item at index. | |
| int | getItemCount () |
| Number of items. | |
| ConstructedDynamicSkin | new () |
| Create constructed dynamic skin. | |
| ConstructedDynamicSkin | new (DynamicSkin dynamicSkin) |
| Create constructed dynamic skin. | |
| void | removeAllItems () |
| Remove all items. | |
| void | removeAllRenderables () |
| Remove all renderables. | |
| void | removeItem (ConstructedDynamicSkinItem item) |
| Remove item. | |
Protected Member Functions | |
| void | addCanvasForProperty (ConstructedDynamicSkinItem item, ConstructedDynamicSkinProperty property, CanvasView view) |
| Add canvas for item property. | |
| void | removeCanvasForItem (ConstructedDynamicSkinItem item) |
| Remove canvas for item. | |
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.
Referenced by removeCanvasForItem().
| void Dragengine.Utils.ConstructedDynamicSkin.addItem | ( | ConstructedDynamicSkinItem | item | ) |
Add item.
Referenced by removeCanvasForItem().
Add renderable with default color.
| void Dragengine.Utils.ConstructedDynamicSkin.addRenderable | ( | String | name, |
| Point | size, | ||
| float | value ) |
Add renderable with default value.
Referenced by addRenderable(), getItemAt(), getItemCount(), and removeCanvasForItem().
Add renderable with default image.
References getDynamicSkin(), and removeAllRenderables().
| 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.
References addRenderable().
| void Dragengine.Utils.ConstructedDynamicSkin.forEachItem | ( | Block | ablock | ) |
Visit items with block with parameter ConstructedDynamicSkinItem.
Referenced by removeCanvasForItem().
| DynamicSkin Dragengine.Utils.ConstructedDynamicSkin.getDynamicSkin | ( | ) |
Dynamic skin.
Referenced by addRenderable().
| ConstructedDynamicSkinItem Dragengine.Utils.ConstructedDynamicSkin.getItemAt | ( | int | index | ) |
| int Dragengine.Utils.ConstructedDynamicSkin.getItemCount | ( | ) |
| ConstructedDynamicSkin Dragengine.Utils.ConstructedDynamicSkin.new | ( | ) |
| 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.
References new().
| void Dragengine.Utils.ConstructedDynamicSkin.removeAllItems | ( | ) |
Remove all items.
Referenced by removeCanvasForItem().
| void Dragengine.Utils.ConstructedDynamicSkin.removeAllRenderables | ( | ) |
Remove all renderables.
Referenced by addRenderable().
|
protected |
Remove canvas for item.
References addCanvasForProperty(), addItem(), addRenderable(), forEachItem(), getItemAt(), getItemCount(), removeAllItems(), removeCanvasForItem(), and removeItem().
Referenced by removeCanvasForItem().
| void Dragengine.Utils.ConstructedDynamicSkin.removeItem | ( | ConstructedDynamicSkinItem | item | ) |
Remove item.
Referenced by removeCanvasForItem().