Drag[en]gine Script Module DragonScript  1.21
Dragengine.Utils.SkinAnnotations Class Reference

List of annotations for Skin resources. More...

Inheritance diagram for Dragengine.Utils.SkinAnnotations:

Public Member Functions

void forEach (Block ablock)
 Visit annotations with block. More...
 
Object get (Skin skin, String annotation)
 Get best matching annotation for skin. More...
 
Object get (Skin skin, String texture, String annotation)
 Get best matching annotation for texture inside skin. More...
 
Dictionary getAll (Skin skin)
 Get all annotations for skin as Dictionary mapping String key to Object value. More...
 
Dictionary getAll (Skin skin, String texture)
 Get all annotations for skin as Dictionary mapping String key to Object value. More...
 
SkinAnnotations new ()
 Create skin annotations. More...
 
void removeAll ()
 Remove all annotations. More...
 
void removeAll (Skin skin)
 Remove all annotations for skin if present. More...
 
void removeAll (Skin skin, String texture)
 Remove all annotations for skin if present. More...
 
void set (Skin skin, String annotation, Object value)
 Set annotation replacing existing one if present. More...
 
void set (Skin skin, String texture, String annotation, Object value)
 Set annotation replacing existing one if present. More...
 
void set (String path, String annotation, Object value)
 Set annotation replacing existing one if present. More...
 

Detailed Description

List of annotations for Skin resources.

Skin resources store texture properties for engine modules to know how to use the skin according to the designer wishes. They though do not contain game sepcific information. While it is possible to assign skin related properties to element classes directly it works only as long as the skins used for the element class are well known. Many world geometry like buildings, rooms or exterior places have skins assigned by the mapper. In this case skin related properties would have to be duplicated and maintained all over the place. In this situation the SkinAnnotations class helps storing game related properties which are linked to Skin resources themselves.

Skin annotations are organized hierarchically by path. See BestMatchTreeList for an explanation of how this process works. What goes for this class annotations for skins can be attached to directories affecting all skin files underneath, individual skin files and also individual textures inside skin files. Annotations can be either retrieved in best match mode or accumulated mode. In best match mode the annotation with the longest path (most specific) will be returned. In accumulated mode all annotations for a path are collected using best match mode and returned.

These are example path that can be used:

  • "directory": Applies to all skins in the directory and subdirectories
  • "directory/material.deskin": Applies to the skin and all textures inside.
  • "directory/material.deskin/texture": Applies to only a specific texture inside the skin

Annotations are stored in "*.deskinann" (Drag[en]gine Skin Annotations) and can be loaded using LoadSkinAnnotations. This class provides concenience methods for loading annotations.

Annotations for skins are stored as dictionary each containing one annotation keyed by name. The value can be any type you want similar ParameterTree class. See LoadSkinAnnotations for the supported tags that you can use in the XML files.

Member Function Documentation

◆ forEach()

void Dragengine.Utils.SkinAnnotations.forEach ( Block  ablock)

Visit annotations with block.

Block has signature String path, Dictionary annotations.

◆ get() [1/2]

Object Dragengine.Utils.SkinAnnotations.get ( Skin  skin,
String  annotation 
)

Get best matching annotation for skin.

◆ get() [2/2]

Object Dragengine.Utils.SkinAnnotations.get ( Skin  skin,
String  texture,
String  annotation 
)

Get best matching annotation for texture inside skin.

◆ getAll() [1/2]

Dictionary Dragengine.Utils.SkinAnnotations.getAll ( Skin  skin)

Get all annotations for skin as Dictionary mapping String key to Object value.

◆ getAll() [2/2]

Dictionary Dragengine.Utils.SkinAnnotations.getAll ( Skin  skin,
String  texture 
)

Get all annotations for skin as Dictionary mapping String key to Object value.

◆ new()

SkinAnnotations Dragengine.Utils.SkinAnnotations.new ( )

Create skin annotations.

◆ removeAll() [1/3]

void Dragengine.Utils.SkinAnnotations.removeAll ( )

Remove all annotations.

◆ removeAll() [2/3]

void Dragengine.Utils.SkinAnnotations.removeAll ( Skin  skin)

Remove all annotations for skin if present.

◆ removeAll() [3/3]

void Dragengine.Utils.SkinAnnotations.removeAll ( Skin  skin,
String  texture 
)

Remove all annotations for skin if present.

◆ set() [1/3]

void Dragengine.Utils.SkinAnnotations.set ( Skin  skin,
String  annotation,
Object  value 
)

Set annotation replacing existing one if present.

Path is not required to start with the path separator. If property is null the property is ignored during getAt().

◆ set() [2/3]

void Dragengine.Utils.SkinAnnotations.set ( Skin  skin,
String  texture,
String  annotation,
Object  value 
)

Set annotation replacing existing one if present.

Path is not required to start with the path separator. If property is null the property is ignored during getAt().

◆ set() [3/3]

void Dragengine.Utils.SkinAnnotations.set ( String  path,
String  annotation,
Object  value 
)

Set annotation replacing existing one if present.

Path is not required to start with the path separator. If property is null the property is ignored during getAt(). Valid path formats are these:

  • "directory": Applies to all skins in the directory and subdirectories
  • "directory/material.deskin": Applies to the skin and all textures inside.
  • "directory/material.deskin/texture": Applies to only a specific texture inside the skin

You should not use this method directlry. It is used by LoadSkinAnnotations.


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