Drag[en]gine Script Module DragonScript  1.23
Dragengine.Scenery.SkinBuilder Class Reference

Skin builder. More...

Inheritance diagram for Dragengine.Scenery.SkinBuilder:

Public Member Functions

Constructors
SkinBuilder new ()
 Create skin builder. More...
 

Management

Skin build (String filename)
 Build skin using filename. More...
 
void buildSkin ()
 Build skin. More...
 
void addTexture (String name)
 Add texture. More...
 
void addPropertyValue (int texture, String type, String texCoordSet, String renderable, float value)
 Add value texture property. More...
 
void addPropertyColor (int texture, String type, String texCoordSet, String renderable, Color color)
 Add color texture property. More...
 
void addPropertyImage (int texture, String type, String texCoordSet, String renderable, String pathImage, Image image)
 Add image texture property. More...
 
void addPropertyVideo (int texture, String type, String texCoordSet, String renderable, String pathVideo, Video video, bool sharedTime)
 Add video texture property. More...
 
void addPropertyConstructed (int texture, String type, String texCoordSet, String renderable, Color color, bool tileX, bool tileY, Point3 size)
 Add constructed texture property. More...
 
void addPropertyMapped (int texture, String type, String texCoordSet, String renderable, CurveBezier redCurve, SkinPropertyMappedInputType redInputType, Vector2 redInputRange, bool redInputClamped, String redBone, CurveBezier greenCurve, SkinPropertyMappedInputType greenInputType, Vector2 greenInputRange, bool greenInputClamped, String greenBone, CurveBezier blueCurve, SkinPropertyMappedInputType blueInputType, Vector2 blueInputRange, bool blueInputClamped, String blueBone, CurveBezier alphaCurve, SkinPropertyMappedInputType alphaInputType, Vector2 alphaInputRange, bool alphaInputClamped, String alphaBone)
 Add mapped texture property. More...
 
void addPropertyMapped (int texture, String type, String texCoordSet, String renderable, int red, int green, int blue, int alpha)
 Add mapped texture property. More...
 
void setPropertyBone (int texture, int property, String bone)
 Set bone name of texture property. More...
 
void constructedOpenContent (int texture, int property)
 Open constructed property content node. More...
 
void addNodeImage (Point3 position, Point3 size, float rotation, float shear, float brightness, float contrast, float gamma, Color colorize, float transparency, SkinPropertyNodeCombineMode combineMode, String path, Image image, Point repeat)
 Add image node to open node. More...
 
void addNodeText (Point3 position, Point3 size, float rotation, float shear, float brightness, float contrast, float gamma, Color colorize, float transparency, SkinPropertyNodeCombineMode combineMode, String path, Font font, float fontSize, String text, Color color)
 Add text node to open node. More...
 
void addNodeShape (Point3 position, Point3 size, float rotation, float shear, float brightness, float contrast, float gamma, Color colorize, float transparency, SkinPropertyNodeCombineMode combineMode, int shapeType, Color fillColor, Color lineColor, float thickness)
 Add shape node to open node. More...
 
void addNodeGroup (Point3 position, Point3 size, float rotation, float shear, float brightness, float contrast, float gamma, Color colorize, float transparency, SkinPropertyNodeCombineMode combineMode)
 Add group node to open node. More...
 
void nextNodeAsMask ()
 Set the next node created using addNode*() call as node mask. More...
 
void closeNode ()
 Close open node. More...
 

Detailed Description

Skin builder.

Builds skin resource without requiring a skin resource file. The created skin can either be unnamed (if filename is empty string) or named (if filename is not empty string). Named skins can not clash with filenames present in the virtual file system. For this reason use unnamed skins if possible. Using named skins though can be useful if you want to provide skin resources to scripts not needing to know if the path they try to load is a build skin instead of a resource one.

To use the skin builder create a subclass and implement SkinBuilder.buildSkin() . You are only allowed to call methods from SkinBuilder from inside this function call. To create the skin call SkinBuilder.build() . This will call SkinBuilder.buildSkin() to fill a new skin resource with content. Once finished the build method returns the ready to use skin resource. Otherwise an exception is thrown.

This is a native class.

Member Function Documentation

◆ addNodeGroup()

void Dragengine.Scenery.SkinBuilder.addNodeGroup ( Point3  position,
Point3  size,
float  rotation,
float  shear,
float  brightness,
float  contrast,
float  gamma,
Color  colorize,
float  transparency,
SkinPropertyNodeCombineMode  combineMode 
)
protected

Add group node to open node.

Sets created group node as new open node to operate on.

◆ addNodeImage()

void Dragengine.Scenery.SkinBuilder.addNodeImage ( Point3  position,
Point3  size,
float  rotation,
float  shear,
float  brightness,
float  contrast,
float  gamma,
Color  colorize,
float  transparency,
SkinPropertyNodeCombineMode  combineMode,
String  path,
Image  image,
Point  repeat 
)
protected

Add image node to open node.

◆ addNodeShape()

void Dragengine.Scenery.SkinBuilder.addNodeShape ( Point3  position,
Point3  size,
float  rotation,
float  shear,
float  brightness,
float  contrast,
float  gamma,
Color  colorize,
float  transparency,
SkinPropertyNodeCombineMode  combineMode,
int  shapeType,
Color  fillColor,
Color  lineColor,
float  thickness 
)
protected

Add shape node to open node.

◆ addNodeText()

void Dragengine.Scenery.SkinBuilder.addNodeText ( Point3  position,
Point3  size,
float  rotation,
float  shear,
float  brightness,
float  contrast,
float  gamma,
Color  colorize,
float  transparency,
SkinPropertyNodeCombineMode  combineMode,
String  path,
Font  font,
float  fontSize,
String  text,
Color  color 
)
protected

Add text node to open node.

◆ addPropertyColor()

void Dragengine.Scenery.SkinBuilder.addPropertyColor ( int  texture,
String  type,
String  texCoordSet,
String  renderable,
Color  color 
)
protected

Add color texture property.

◆ addPropertyConstructed()

void Dragengine.Scenery.SkinBuilder.addPropertyConstructed ( int  texture,
String  type,
String  texCoordSet,
String  renderable,
Color  color,
bool  tileX,
bool  tileY,
Point3  size 
)
protected

Add constructed texture property.

◆ addPropertyImage()

void Dragengine.Scenery.SkinBuilder.addPropertyImage ( int  texture,
String  type,
String  texCoordSet,
String  renderable,
String  pathImage,
Image  image 
)
protected

Add image texture property.

◆ addPropertyMapped() [1/2]

void Dragengine.Scenery.SkinBuilder.addPropertyMapped ( int  texture,
String  type,
String  texCoordSet,
String  renderable,
CurveBezier  redCurve,
SkinPropertyMappedInputType  redInputType,
Vector2  redInputRange,
bool  redInputClamped,
String  redBone,
CurveBezier  greenCurve,
SkinPropertyMappedInputType  greenInputType,
Vector2  greenInputRange,
bool  greenInputClamped,
String  greenBone,
CurveBezier  blueCurve,
SkinPropertyMappedInputType  blueInputType,
Vector2  blueInputRange,
bool  blueInputClamped,
String  blueBone,
CurveBezier  alphaCurve,
SkinPropertyMappedInputType  alphaInputType,
Vector2  alphaInputRange,
bool  alphaInputClamped,
String  alphaBone 
)
protected

◆ addPropertyMapped() [2/2]

void Dragengine.Scenery.SkinBuilder.addPropertyMapped ( int  texture,
String  type,
String  texCoordSet,
String  renderable,
int  red,
int  green,
int  blue,
int  alpha 
)
protected

Add mapped texture property.

Version
1.18

Red, green, blue and alpha are indices into added mapped values (addMapped) or -1 to disable. Throws EInvalidParam if indices are less than -1 or larger than or equal to the count of mapped values.

◆ addPropertyValue()

void Dragengine.Scenery.SkinBuilder.addPropertyValue ( int  texture,
String  type,
String  texCoordSet,
String  renderable,
float  value 
)
protected

Add value texture property.

◆ addPropertyVideo()

void Dragengine.Scenery.SkinBuilder.addPropertyVideo ( int  texture,
String  type,
String  texCoordSet,
String  renderable,
String  pathVideo,
Video  video,
bool  sharedTime 
)
protected

Add video texture property.

◆ addTexture()

void Dragengine.Scenery.SkinBuilder.addTexture ( String  name)
protected

Add texture.

◆ build()

Skin Dragengine.Scenery.SkinBuilder.build ( String  filename)

Build skin using filename.

The created skin can either be unnamed (if filename is empty string) or named (if filename is not empty string). Named skins can not clash with filenames present in the virtual file system. For this reason use unnamed skins if possible. Using named skins though can be useful if you want to provide skin resources to scripts not needing to know if the path they try to load is a build skin instead of a resource one.

To create the skin call build() . This will call buildSkin() to fill a new skin resource with content. Once finished the build method returns the ready to use skin resource. Otherwise an exception is thrown.

◆ buildSkin()

void Dragengine.Scenery.SkinBuilder.buildSkin ( )
protected

Build skin.

Called by build(String) to fill a new skin resource with content. You are only allowed to call methods from SkinBuilder from inside this function call.

◆ closeNode()

void Dragengine.Scenery.SkinBuilder.closeNode ( )
protected

Close open node.

Sets the previous open node as the open node to operate on.

◆ constructedOpenContent()

void Dragengine.Scenery.SkinBuilder.constructedOpenContent ( int  texture,
int  property 
)
protected

Open constructed property content node.

Content node becomes open node to operate on. Call closeNode() to close it.

◆ new()

SkinBuilder Dragengine.Scenery.SkinBuilder.new ( )

Create skin builder.

◆ nextNodeAsMask()

void Dragengine.Scenery.SkinBuilder.nextNodeAsMask ( )
protected

Set the next node created using addNode*() call as node mask.

◆ setPropertyBone()

void Dragengine.Scenery.SkinBuilder.setPropertyBone ( int  texture,
int  property,
String  bone 
)
protected

Set bone name of texture property.

Version
1.18

Used by texture properties using vertex position instead of texture coordinates. The vertex position is evaluated relative to the bone coordinate system.


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