UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
Plugins Library
High-Level Systems
Samples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Content Creation
Materials
Unigine Material Library
Tutorials

WidgetSpriteMaterial Class

This class is used to display material samples like the ones in material preview pane of UnigineEditor. Materials can be displayed on one of the following primitive shapes: a box, a dodecahedron or a sphere.

WidgetSpriteMaterial Class

This class inherits from WidgetSprite

Members


WidgetSpriteMaterial (Gui gui, int width, int height)

Constructor. Creates a new sprite with given properties.

Arguments

  • Gui gui - GUI, to which the new sprite will belong.
  • int width - Width of the sprite.
  • int height - Height of the sprite.

Material getMaterial ()

Returns the currently displayed material.

Return value

Material.

mat4 getModelview ()

Returns the current model-view matrix.

Return value

Model-view matrix.

int getPrimitive ()

Returns the type of the primitive, which will display the material.

Return value

One of the WIDGET_SPRITE_MATERIAL_* pre-defined variables.

mat4 getProjection ()

Returns the current projection matrix.

Return value

Projection matrix.

int getTextureHeight ()

Returns the height of the texture buffer used for a widget that affects the widget size.

Return value

Height of the texture buffer size.

int getTextureWidth ()

Returns the width of the texture buffer used for a widget that affects the widget size.

Return value

Width of the texture buffer size.

void renderImage (Image image)

Renders the viewport into an image.

Arguments

  • Image image - Reference to a target image.

void setMaterial (Material material)

Sets a material to display.

Arguments

  • Material material - Material.

void setModelview (mat4 matrix)

Sets a model-view matrix.

Arguments

  • mat4 matrix - Model-view matrix.

void setPrimitive (int shape)

Sets a primitive, which will display the material.

Arguments

  • int shape - One of the WIDGET_SPRITE_MATERIAL_* pre-defined variables.

void setProjection (mat4 matrix)

Sets a projection matrix.

Arguments

  • mat4 matrix - Projection matrix.

void setTextureHeight (int height)

Sets the height of the texture buffer used for a widget. This affects the widget size accordingly.

Arguments

  • int height - Height of the texture buffer size.

void setTextureWidth (int width)

Sets the width of the texture buffer used for a widget. This affects the widget size accordingly.

Arguments

  • int width - Width of the texture buffer size.

int WIDGET_SPRITE_MATERIAL_BOX

Description

Material will be displayed on a box. This is the default primitive.

int WIDGET_SPRITE_MATERIAL_PRIMITIVE_BOX

Description

Material will be displayed on a box. This is the default primitive.

int WIDGET_SPRITE_MATERIAL_PRIMITIVE_DODECAHEDRON

Description

Material will be displayed on a dodecahedron.

int WIDGET_SPRITE_MATERIAL_PRIMITIVE_SPHERE

Description

Material will be displayed on a sphere.

int WIDGET_SPRITE_MATERIAL_SPHERE

Description

Material will be displayed on a sphere.
Last update: 2017-07-03