Drag[en]gine Script Module DragonScript
1.23
|
Texture replacement for use with element classes. More...
Public Member Functions | |
void | applyToComponent (Component component) |
Apply texture replacement to matching component texture if present. More... | |
DynamicSkin | createDynamicSkin () |
Create dynamic skin from texture replace definition. More... | |
Color | getColorTint () |
Color tint or null to not replace the color tint. More... | |
String | getName () |
Name of the texture in the component. More... | |
String | getPath () |
Path to skin or null to not replace the skin. More... | |
Skin | getSkin () |
Skin resource or null to not replace the skin. More... | |
TexMatrix2 | getTransform () |
Texture coordinate transformation or null to not replace the transformation. More... | |
TextureReplacement | new (String name) |
Create texture replace object. More... | |
TextureReplacement | new (StubElementTexture stub) |
Create texture replacement from stub. More... | |
TextureReplacement | new (TextureReplacement copy) |
Create copy of texture replace object. More... | |
void | setColorTint (Color color) |
Set color tint or null to not replace the color tint. More... | |
void | setPath (String path) |
Set path to skin or null to not replace the skin. More... | |
void | setSkin (Skin skin) |
Set skin resource or null to not replace the skin. More... | |
void | setTransform (TexMatrix2 matrix) |
Set texture coordinate transformation or null to not replace the transformation. More... | |
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 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.
DynamicSkin Dragengine.Utils.TextureReplacement.createDynamicSkin | ( | ) |
Create dynamic skin from texture replace definition.
If no dynamic skin is required null is returned.
Color Dragengine.Utils.TextureReplacement.getColorTint | ( | ) |
Color tint or null to not replace the color tint.
String Dragengine.Utils.TextureReplacement.getName | ( | ) |
Name of the texture in the component.
String Dragengine.Utils.TextureReplacement.getPath | ( | ) |
Path to skin or null to not replace the skin.
Skin Dragengine.Utils.TextureReplacement.getSkin | ( | ) |
Skin resource or null to not replace the skin.
TexMatrix2 Dragengine.Utils.TextureReplacement.getTransform | ( | ) |
Texture coordinate transformation or null to not replace the transformation.
TextureReplacement Dragengine.Utils.TextureReplacement.new | ( | String | name | ) |
Create texture replace object.
TextureReplacement Dragengine.Utils.TextureReplacement.new | ( | StubElementTexture | stub | ) |
Create texture replacement from stub.
TextureReplacement Dragengine.Utils.TextureReplacement.new | ( | TextureReplacement | copy | ) |
Create copy of texture replace object.
void Dragengine.Utils.TextureReplacement.setColorTint | ( | Color | color | ) |
Set color tint or null to not replace the color tint.
void Dragengine.Utils.TextureReplacement.setPath | ( | String | path | ) |
Set path to skin or null to not replace the skin.
void Dragengine.Utils.TextureReplacement.setSkin | ( | Skin | skin | ) |
Set skin resource or null to not replace the skin.
void Dragengine.Utils.TextureReplacement.setTransform | ( | TexMatrix2 | matrix | ) |
Set texture coordinate transformation or null to not replace the transformation.