Drag[en]gine Script Module DragonScript
1.23
|
List of annotations for Skin resources. More...
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... | |
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:
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.
void Dragengine.Utils.SkinAnnotations.forEach | ( | Block | ablock | ) |
Visit annotations with block.
Block has signature String path, Dictionary annotations.
Object Dragengine.Utils.SkinAnnotations.get | ( | Skin | skin, |
String | annotation | ||
) |
Get best matching annotation for skin.
Object Dragengine.Utils.SkinAnnotations.get | ( | Skin | skin, |
String | texture, | ||
String | annotation | ||
) |
Get best matching annotation for texture inside skin.
Dictionary Dragengine.Utils.SkinAnnotations.getAll | ( | Skin | skin | ) |
Get all annotations for skin as Dictionary mapping String key to Object value.
Dictionary Dragengine.Utils.SkinAnnotations.getAll | ( | Skin | skin, |
String | texture | ||
) |
Get all annotations for skin as Dictionary mapping String key to Object value.
SkinAnnotations Dragengine.Utils.SkinAnnotations.new | ( | ) |
Create skin annotations.
void Dragengine.Utils.SkinAnnotations.removeAll | ( | ) |
Remove all annotations.
void Dragengine.Utils.SkinAnnotations.removeAll | ( | Skin | skin | ) |
Remove all annotations for skin if present.
void Dragengine.Utils.SkinAnnotations.removeAll | ( | Skin | skin, |
String | texture | ||
) |
Remove all annotations for skin if present.
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().
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().
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:
You should not use this method directlry. It is used by LoadSkinAnnotations.