This page has been translated automatically.
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
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

WidgetSpriteNode Class

This class is used to display separate nodes together with all their children (like the View object option in the Nodes settings). This widget supports alpha channel masking. But unlike WidgetSpriteViewport, it does not support engine postprocesses (like HDR, DOF, motion blur, glow, etc.); only postprocess materials can be applied to it.

WidgetSpriteNode Class

This class inherits from WidgetSprite

Members


WidgetSpriteNode (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.

vec3 getCameraOffset ()

Returns an offset vector of the camera.

Return value

Offset of the camera, X, Y and Z axes.

float getIFps ()

Returns the current frame duration set to render WidgetSpriteNode viewport.

Return value

Inverse frame duration in seconds (1 / FPS).

string getMaterials ()

Returns materials used for postprocessing visual effects.

Return value

Comma-separated list of material names.

mat4 getModelview ()

Returns the current model-view matrix.

Return value

Model-view matrix.

Node getNode ()

Returns the current node set for displaying.

Return value

The node.

mat4 getProjection ()

Returns the current projection matrix.

Return value

Projection matrix.

int getReflectionMask ()

Returns the current bit mask for rendering reflections into the viewport. Reflections are rendered in the sprite viewport if masks of reflective materials match this one.

Return value

Integer, each bit of which is a mask.

int getShadows ()

Returns a value indicating if the shadows rendering is enabled.

Return value

1 if the shadows are enabled; 0 if disabled.

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.

int getViewportMask ()

Returns the current bit mask for rendering into the viewport. Node is rendered in the sprite viewport if its mask matches this one.

Return value

Integer, each bit of which is a mask.

void renderImage (Image image)

Renders the viewport into an image.

Arguments

  • Image image - Reference to a target image.

void setCameraOffset (vec3 offset)

Sets an offset vector of the camera.

Arguments

  • vec3 offset - Offset of the camera, X, Y and Z axes.

void setIFps (float ifps)

Sets a constant framerate used to render WidgetSpriteNode viewport. For example, it can be used to decrease its framerate to get higher performance.

Arguments

  • float ifps - Inverse frame duration in seconds. The value should be reciprocal, that is (1.0f / frame_duration). If a too small value is provided, 1E-6 will be used instead.

void setMaterials (string materials)

Sets postprocessing materials which are used to create special visual effects. Materials are applied in the order of listing.

Arguments

  • string materials - Comma-separated list of material names.

void setModelview (mat4 matrix)

Sets a model-view matrix.

Arguments

  • mat4 matrix - Model-view matrix.

void setNode (Node node)

Sets a node to be displayed.

Arguments

  • Node node - Node.

void setProjection (mat4 matrix)

Sets a projection matrix.

Arguments

  • mat4 matrix - Projection matrix.

void setReflectionMask (int mask)

Sets a bit mask for rendering reflections into the viewport. Reflections are rendered in the sprite viewport if masks of reflective materials match this one.

Arguments

  • int mask - Integer, each bit of which is a mask.

void setShadows (int shadows)

Enables/disables shadows rendering. The default is 0 (disabled).

Arguments

  • int shadows - 1 to enable shadows, 0 to disable.

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.

void setViewportMask (int mask)

Sets a bit mask for rendering into the viewport. Node is rendered in the sprite viewport if its mask matches this one.

Arguments

  • int mask - Integer, each bit of which is a mask.
Last update: 2017-07-03
Build: ()