Drag[en]gine Script Module DragonScript  1.23
Dragengine.Utils.ConstructedDynamicSkin Class Reference

Construct dynamic skins with multiple skin properties from items. More...

Inheritance diagram for Dragengine.Utils.ConstructedDynamicSkin:

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...
 

Detailed Description

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.

Member Function Documentation

◆ addCanvasForProperty()

void Dragengine.Utils.ConstructedDynamicSkin.addCanvasForProperty ( ConstructedDynamicSkinItem  item,
ConstructedDynamicSkinProperty  property,
CanvasView  view 
)
protected

Add canvas for item property.

◆ addItem()

void Dragengine.Utils.ConstructedDynamicSkin.addItem ( ConstructedDynamicSkinItem  item)

Add item.

◆ addRenderable() [1/4]

void Dragengine.Utils.ConstructedDynamicSkin.addRenderable ( String  name,
Point  size,
Color  color 
)

Add renderable with default color.

◆ addRenderable() [2/4]

void Dragengine.Utils.ConstructedDynamicSkin.addRenderable ( String  name,
Point  size,
float  value 
)

Add renderable with default value.

◆ addRenderable() [3/4]

void Dragengine.Utils.ConstructedDynamicSkin.addRenderable ( String  name,
Point  size,
Image  image 
)

Add renderable with default image.

◆ addRenderable() [4/4]

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.

◆ forEachItem()

void Dragengine.Utils.ConstructedDynamicSkin.forEachItem ( Block  ablock)

Visit items with block with parameter ConstructedDynamicSkinItem.

◆ getDynamicSkin()

DynamicSkin Dragengine.Utils.ConstructedDynamicSkin.getDynamicSkin ( )

Dynamic skin.

◆ getItemAt()

ConstructedDynamicSkinItem Dragengine.Utils.ConstructedDynamicSkin.getItemAt ( int  index)

Item at index.

◆ getItemCount()

int Dragengine.Utils.ConstructedDynamicSkin.getItemCount ( )

Number of items.

◆ new() [1/2]

ConstructedDynamicSkin Dragengine.Utils.ConstructedDynamicSkin.new ( )

Create constructed dynamic skin.

Creates a new dynamic skin.

◆ new() [2/2]

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.

◆ removeAllItems()

void Dragengine.Utils.ConstructedDynamicSkin.removeAllItems ( )

Remove all items.

◆ removeAllRenderables()

void Dragengine.Utils.ConstructedDynamicSkin.removeAllRenderables ( )

Remove all renderables.

◆ removeCanvasForItem()

void Dragengine.Utils.ConstructedDynamicSkin.removeCanvasForItem ( ConstructedDynamicSkinItem  item)
protected

Remove canvas for item.

◆ removeItem()

void Dragengine.Utils.ConstructedDynamicSkin.removeItem ( ConstructedDynamicSkinItem  item)

Remove item.


The documentation for this class was generated from the following file: