iSprite2DState Struct Reference (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions
iSprite2DState Struct Reference
Mesh plugins

This interface describes the API for the sprite factory mesh object. More...

`#include <imesh/sprite2d.h>`

Inheritance diagram for iSprite2DState:

List of all members.

## Public Member Functions
virtual void | CreateRegularVertices (int n, bool setuv)=0
| Set vertices to form a regular n-polygon around (0,0), optionally also set u,v to corresponding coordinates in a texture.
virtual void | EnsureVertexCopy ()=0
| Copies the vertices from the factory the mesh object if the mesh object doesn't own the vertices.
virtual iSprite2DUVAnimation * | GetUVAnimation (const char *name) const =0
| Get a specific UV animation by name.
virtual iSprite2DUVAnimation * | GetUVAnimation (int idx) const =0
| Get a specific UV animation by index.
virtual iSprite2DUVAnimation * | GetUVAnimation (int idx, int &style, bool &loop) const =0
| Get a specific UV animation by index.
virtual iColoredVertices * | GetVertices ()=0
| Get the vertex array.
virtual void | PlayUVAnimation (int idx, int style, bool loop)=0
| Play the animation starting from the idx'th frame.
virtual void | SetUVAnimation (const char *name, int style, bool loop)=0
| Select an UV animation to play.
virtual void | StopUVAnimation (int idx)=0
| Stop the animation and show the idx'th frame.

## Detailed Description

This interface describes the API for the sprite factory mesh object.

iSprite2DState inherits from iSprite2DFactoryState.

Definition at line 223 of file sprite2d.h.

## Member Function Documentation

virtual void iSprite2DState::CreateRegularVertices | ( | int | n,
|  | bool | setuv
| ) |  | `[pure virtual]`

Set vertices to form a regular n-polygon around (0,0), optionally also set u,v to corresponding coordinates in a texture.

Large n approximates a circle with radius 1. n must be > 2.

virtual void iSprite2DState::EnsureVertexCopy | ( |  | ) | `[pure virtual]`

Copies the vertices from the factory the mesh object if the mesh object doesn't own the vertices.

This is necessary if vertices are to be changed in the mesh object: without copying, changing the vertices affects the mesh factory.

virtual iSprite2DUVAnimation* iSprite2DState::GetUVAnimation | ( | const char * | name | ) | const`[pure virtual]`

Get a specific UV animation by name.

Returns 0 if not found.

Implements iSprite2DFactoryState.

virtual iSprite2DUVAnimation* iSprite2DState::GetUVAnimation | ( | int | idx | ) | const`[pure virtual]`

Get a specific UV animation by index.

Returns 0 if not found.

Implements iSprite2DFactoryState.

virtual iSprite2DUVAnimation* iSprite2DState::GetUVAnimation | ( | int | idx,
|  | int & | style,
|  | bool & | loop
| ) |  | const`[pure virtual]`

Get a specific UV animation by index.

Returns 0 if not found.

virtual iColoredVertices* iSprite2DState::GetVertices | ( |  | ) | `[pure virtual]`

Get the vertex array.

Warning:
  This may actually be the factory's vertices! If you want to modify the vertices call EnsureVertexCopy() first.

Implements iSprite2DFactoryState.

virtual void iSprite2DState::PlayUVAnimation | ( | int | idx,
|  | int | style,
|  | bool | loop
| ) |  | `[pure virtual]`

Play the animation starting from the idx'th frame.

Set idx to -1 to start it fro its current position. Style: 0 .. use the time values supplied in the frames > 0 .. every `style' millisecond skip to next frame < 0 .. every -1*`style'th frame skip to next frame Loop: true .. after last frame animations starts over from the beginning false .. after last frame the normal texture is shown

virtual void iSprite2DState::SetUVAnimation | ( | const char * | name,
|  | int | style,
|  | bool | loop
| ) |  | `[pure virtual]`

Select an UV animation to play.

Set name to 0 to select no animation to show. Style: 0 .. use the time values supplied in the frames > 0 .. every `style' millisecond skip to next frame < 0 .. every -1*`style'th frame skip to next frame Loop: true .. after last frame animations starts over from the beginning false .. after last frame the normal texture is shown

virtual void iSprite2DState::StopUVAnimation | ( | int | idx | ) | `[pure virtual]`

Stop the animation and show the idx'th frame.

Set idx to -1 to stop it at its current position.

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

- imesh/sprite2d.h