Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
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.
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.

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.

Referenced by removeCanvasForItem().

◆ addItem()

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

Add item.

Referenced by removeCanvasForItem().

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

Referenced by addRenderable(), getItemAt(), getItemCount(), and removeCanvasForItem().

◆ addRenderable() [3/4]

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

Add renderable with default image.

References getDynamicSkin(), and removeAllRenderables().

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

References addRenderable().

◆ forEachItem()

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

Visit items with block with parameter ConstructedDynamicSkinItem.

Referenced by removeCanvasForItem().

◆ getDynamicSkin()

DynamicSkin Dragengine.Utils.ConstructedDynamicSkin.getDynamicSkin ( )

Dynamic skin.

Referenced by addRenderable().

◆ getItemAt()

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

Item at index.

References addRenderable().

Referenced by removeCanvasForItem().

◆ getItemCount()

int Dragengine.Utils.ConstructedDynamicSkin.getItemCount ( )

Number of items.

References addRenderable().

Referenced by removeCanvasForItem().

◆ new() [1/2]

ConstructedDynamicSkin Dragengine.Utils.ConstructedDynamicSkin.new ( )

Create constructed dynamic skin.

Creates a new dynamic skin.

References new().

Referenced by new(), and new().

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

References new().

◆ removeAllItems()

void Dragengine.Utils.ConstructedDynamicSkin.removeAllItems ( )

Remove all items.

Referenced by removeCanvasForItem().

◆ removeAllRenderables()

void Dragengine.Utils.ConstructedDynamicSkin.removeAllRenderables ( )

Remove all renderables.

Referenced by addRenderable().

◆ removeCanvasForItem()

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

◆ removeItem()

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

Remove item.

Referenced by removeCanvasForItem().


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