|
Drag[en]gine Script Module DragonScript 1.35
|
Texture replacement for use with element classes. More...
Public Member Functions | |
| void | applyToComponent (Component component) |
| Apply texture replacement to matching component texture if present. | |
| DynamicSkin | createDynamicSkin () |
| Create dynamic skin from texture replace definition. | |
| Color | getColorTint () |
| Color tint or null to not replace the color tint. | |
| String | getName () |
| Name of the texture in the component. | |
| String | getPath () |
| Path to skin or null to not replace the skin. | |
| Skin | getSkin () |
| Skin resource or null to not replace the skin. | |
| TexMatrix2 | getTransform () |
| Texture coordinate transformation or null to not replace the transformation. | |
| TextureReplacement | new (String name) |
| Create texture replace object. | |
| TextureReplacement | new (StubElementTexture stub) |
| Create texture replacement from stub. | |
| TextureReplacement | new (TextureReplacement copy) |
| Create copy of texture replace object. | |
| void | setColorTint (Color color) |
| Set color tint or null to not replace the color tint. | |
| void | setName (String name) |
| Set name of the texture in the component. | |
| void | setPath (String path) |
| Set path to skin or null to not replace the skin. | |
| void | setSkin (Skin skin) |
| Set skin resource or null to not replace the skin. | |
| void | setTransform (TexMatrix2 matrix) |
| Set texture coordinate transformation or null to not replace the transformation. | |
Public Attributes | |
| Color | pColorTint |
| String | pName |
| Skin | pSkin |
| TexMatrix2 | pTransform |
Texture replacement for use with element classes.
Supports replacing Skin and DynamicSkin of a matching component texture.
If a Skin instance is present the texture defined by the component Skin instance or a manually set Skin is replaced with the new Skin instance. The first texture defined in the replacing Skin instance is used. It is possible to use skins with more than one texture but then only the first texture is used. Using a skin with no texture is possible to render parts of a component invisible.
If no Skin instance is present and no skin instance has been assigned to the component texture yet the component skin is used as skin instance with the matching texture index. This allows to easily replace the tint of a component texture no matter if a skin is explicitely set or not.
If a color tint is present a DynamicSkin is created and replaces the component or manually set dynamic skin. It is possible to use color tint without using a new Skin instance. In this case the currently used skin of the component texture is modified.
If a transform is present it replaces the component or manually set transformation if present. It is possible to use transform without using a new Skin instance. In this case the currently used skin of the component texture is modified.
Texture replacements have to be applied to a component using applyToComponent() method after setting up the component with all skin and dynamic skin instances. If no component texture matches the name the texture replacement has no effect.
To use a texture replacement in an element class use the ECPTextureReplacementList element class property.
| void Dragengine.Utils.TextureReplacement.applyToComponent | ( | Component | component | ) |
Apply texture replacement to matching component texture if present.
References getSkin(), pSkin, and setPath().
Referenced by createDynamicSkin().
| DynamicSkin Dragengine.Utils.TextureReplacement.createDynamicSkin | ( | ) |
Create dynamic skin from texture replace definition.
If no dynamic skin is required null is returned.
References applyToComponent(), createDynamicSkin(), getColorTint(), getTransform(), pColorTint, pName, pSkin, pTransform, setColorTint(), setSkin(), and setTransform().
Referenced by createDynamicSkin().
| Color Dragengine.Utils.TextureReplacement.getColorTint | ( | ) |
Color tint or null to not replace the color tint.
Referenced by createDynamicSkin().
| String Dragengine.Utils.TextureReplacement.getName | ( | ) |
| String Dragengine.Utils.TextureReplacement.getPath | ( | ) |
Path to skin or null to not replace the skin.
Referenced by setColorTint().
| Skin Dragengine.Utils.TextureReplacement.getSkin | ( | ) |
| TexMatrix2 Dragengine.Utils.TextureReplacement.getTransform | ( | ) |
Texture coordinate transformation or null to not replace the transformation.
References setName().
Referenced by createDynamicSkin().
| TextureReplacement Dragengine.Utils.TextureReplacement.new | ( | String | name | ) |
| TextureReplacement Dragengine.Utils.TextureReplacement.new | ( | StubElementTexture | stub | ) |
Create texture replacement from stub.
References pColorTint, pName, pSkin, and pTransform.
| TextureReplacement Dragengine.Utils.TextureReplacement.new | ( | TextureReplacement | copy | ) |
Create copy of texture replace object.
References new().
| void Dragengine.Utils.TextureReplacement.setColorTint | ( | Color | color | ) |
Set color tint or null to not replace the color tint.
References getPath().
Referenced by createDynamicSkin().
| void Dragengine.Utils.TextureReplacement.setName | ( | String | name | ) |
Set name of the texture in the component.
References pColorTint, pSkin, and pTransform.
Referenced by getTransform(), and new().
| void Dragengine.Utils.TextureReplacement.setPath | ( | String | path | ) |
Set path to skin or null to not replace the skin.
References getName().
Referenced by applyToComponent().
| void Dragengine.Utils.TextureReplacement.setSkin | ( | Skin | skin | ) |
Set skin resource or null to not replace the skin.
Referenced by createDynamicSkin().
| void Dragengine.Utils.TextureReplacement.setTransform | ( | TexMatrix2 | matrix | ) |
Set texture coordinate transformation or null to not replace the transformation.
References pName.
Referenced by createDynamicSkin().
| Color Dragengine.Utils.TextureReplacement.pColorTint |
Referenced by createDynamicSkin(), new(), and setName().
| String Dragengine.Utils.TextureReplacement.pName |
Referenced by createDynamicSkin(), getName(), getSkin(), new(), and setTransform().
| Skin Dragengine.Utils.TextureReplacement.pSkin |
Referenced by applyToComponent(), createDynamicSkin(), new(), and setName().
| TexMatrix2 Dragengine.Utils.TextureReplacement.pTransform |
Referenced by createDynamicSkin(), new(), and setName().