Functions |
BBDECL BillBoard *BBCALL | xCreateSprite (Entity *parent=NULL) |
| Creates a sprite entity and returns its handle. Sprites are simple flat (usually textured) rectangles made from two triangles. The sprite will be positioned at 0, 0, 0 and extend from 1, -1 to +1, +1. Sprites have two real strengths. The first is that they consist of only two polygons; meaning you can use many of them at once. This makes them ideal for particle effects and 2D-using-3D games where you want lots of sprites on-screen at once. Secondly, sprites can be assigned a view mode using cSpriteViewMode(). By default this view mode is set to SPRITE_FIXED, which means the sprite will always face the camera. So no matter what the orientation of the camera is relative to the sprite, you will never actually notice that they are flat; by giving them a spherical texture, you can make them appear to look no different than a normal sphere. The parent parameter allow you to specify a parent entity for the sprite so that when the parent is moved the child sprite will move with it. However, this relationship is one way; applying movement commands to the child will not affect the parent. Specifying a parent entity will still result in the sprite being created at position 0, 0, 0 rather than at the parent entity's position. Note: Sprites have their own commands for rotation and scaling.
|
BBDECL void BBCALL | xHandleSprite (BillBoard *sprite, float x, float y) |
| Sets a sprite handle. Defaults to 0, 0.
|
BBDECL BillBoard *BBCALL | xLoadSprite (const char *path, int flags=9, Entity *parent=NULL) |
| Creates a sprite entity, assigns a texture to it, and retuns sprite handle.
|
BBDECL void BBCALL | xRotateSprite (BillBoard *sprite, float angle) |
| Rotates a sprite.
|
BBDECL void BBCALL | xScaleSprite (BillBoard *sprite, float xScale, float yScale) |
| Scales a sprite.
|
BBDECL void BBCALL | xSpriteViewMode (BillBoard *sprite, int mode) |
| Sets the view mode of a sprite.
|
BBDECL BillBoard* BBCALL xCreateSprite |
( |
Entity * |
parent = NULL | ) |
|
Creates a sprite entity and returns its handle. Sprites are simple flat (usually textured) rectangles made from two triangles. The sprite will be positioned at 0, 0, 0 and extend from 1, -1 to +1, +1. Sprites have two real strengths. The first is that they consist of only two polygons; meaning you can use many of them at once. This makes them ideal for particle effects and 2D-using-3D games where you want lots of sprites on-screen at once. Secondly, sprites can be assigned a view mode using cSpriteViewMode(). By default this view mode is set to SPRITE_FIXED, which means the sprite will always face the camera. So no matter what the orientation of the camera is relative to the sprite, you will never actually notice that they are flat; by giving them a spherical texture, you can make them appear to look no different than a normal sphere. The parent parameter allow you to specify a parent entity for the sprite so that when the parent is moved the child sprite will move with it. However, this relationship is one way; applying movement commands to the child will not affect the parent. Specifying a parent entity will still result in the sprite being created at position 0, 0, 0 rather than at the parent entity's position. Note: Sprites have their own commands for rotation and scaling.
- Parameters:
-
parent | Parent entity handle |