![]() |
Xors3d Engine
|
Functions | |
BBDECL void BBCALL | xBrushAlpha (Brush *brush, float alpha) |
Sets the alpha level of a brush. | |
BBDECL void BBCALL | xBrushBlend (Brush *brush, int blend) |
Sets the blending mode for a brush. | |
BBDECL void BBCALL | xBrushColor (Brush *brush, int red, int green, int blue) |
Sets the colour of a brush. | |
BBDECL void BBCALL | xBrushFX (Brush *brush, int FX) |
Sets miscellaneous effects for a brush. | |
BBDECL void BBCALL | xBrushName (Brush *brush, const char *name) |
Sets brush name. | |
BBDECL void BBCALL | xBrushShininess (Brush *brush, float shininess) |
Sets the specular shininess of a brush. | |
BBDECL void BBCALL | xBrushTexture (Brush *brush, Texture *texture, int frame=0, int index=0) |
Assigns a texture to a brush. | |
BBDECL Brush *BBCALL | xCreateBrush (float red=255.0f, float green=255.0f, float blue=255.0f) |
Creates a brush and returns a brush handle. | |
BBDECL void BBCALL | xFreeBrush (Brush *brush) |
Frees up a brush. | |
BBDECL float BBCALL | xGetBrushAlpha (Brush *brush) |
Returns brush alpha value. | |
BBDECL int BBCALL | xGetBrushBlend (Brush *brush) |
Returns brush blend mode. | |
BBDECL int BBCALL | xGetBrushBlue (Brush *brush) |
Returns brush blue diffuse color. | |
BBDECL int BBCALL | xGetBrushFX (Brush *brush) |
Returns brush FX flags. | |
BBDECL int BBCALL | xGetBrushGreen (Brush *brush) |
Returns brush green diffuse color. | |
BBDECL const char *BBCALL | xGetBrushName (Brush *brush) |
Returns brush name. | |
BBDECL int BBCALL | xGetBrushRed (Brush *brush) |
Returns brush red diffuse color. | |
BBDECL float BBCALL | xGetBrushShininess (Brush *brush) |
Returns brush shininess value. | |
BBDECL Texture *BBCALL | xGetBrushTexture (Brush *brush, int index=0) |
Returns texture assigned to brush. | |
BBDECL Brush *BBCALL | xLoadBrush (const char *path, int flags=9, float xScale=1.0f, float yScale=1.0f) |
Creates a brush, loads and assigns a texture to it, and returns a brush handle. |
BBDECL Brush* BBCALL xLoadBrush | ( | const char * | path, |
int | flags = 9 , |
||
float | xScale = 1.0f , |
||
float | yScale = 1.0f |
||
) |
Creates a brush, loads and assigns a texture to it, and returns a brush handle.
path | Filename of texture |
flags | Loading flags. See 'Texture loading flags' for more information |
xScale | Brush u scale |
yScale | Brush v scale |
BBDECL Brush* BBCALL xCreateBrush | ( | float | red = 255.0f , |
float | green = 255.0f , |
||
float | blue = 255.0f |
||
) |
Creates a brush and returns a brush handle.
The green, red and blue values allow you to set the colour of the brush. Values should be in the range [0; 255]. If omitted the values default to 255. A brush is a collection of properties such as color, alpha, shininess, textures, etc that are all stored as part of the brush. Then, all these properties can be applied to an entity, mesh or surface at once just by using xPaintEntity(), xPaintMesh() or xPaintSurface(). When creating your own mesh, if you wish for certain surfaces to look differently from one another, then you will need to use brushes to paint individual surfaces. Using commands such as xEntityColor(), xEntityAlpha() will apply the effect to all surfaces at once, which may not be what you wish to achieve.
red | Brush red value |
green | Brush green value |
blue | Brush blue value |
BBDECL void BBCALL xFreeBrush | ( | Brush * | brush | ) |
Frees up a brush.
brush | Brush handle |
BBDECL Texture* BBCALL xGetBrushTexture | ( | Brush * | brush, |
int | index = 0 |
||
) |
Returns texture assigned to brush.
brush | Brush handle |
index | Texture layer index. Must be in range 0-7 |
BBDECL void BBCALL xBrushColor | ( | Brush * | brush, |
int | red, | ||
int | green, | ||
int | blue | ||
) |
Sets the colour of a brush.
The green, red and blue values should be in the range [0; 255]. The default brush color is 255, 255, 255. Please note that if xEntityFX() or xBrushFX() flag FX_VERTEXCOLOR is being used, brush colour will have no effect and vertex colours will be used instead.
brush | Brush handle |
red | Red value of brush |
green | Green value of brush |
blue | Blue value of brush |
BBDECL void BBCALL xBrushAlpha | ( | Brush * | brush, |
float | alpha | ||
) |
Sets the alpha level of a brush.
The alpha value should be in the range [0.0; 1.0]. The default brush alpha setting is 1.0. The alpha level is how transparent an entity is. A value of 1.0 will mean the entity is non-transparent, i.e. opaque. A value of 0.0 will mean the entity is completely transparent, i.e. invisible. Values between 0.0 and 1.0 will cause varying amount of transparency accordingly, useful for imitating the look of objects such as glass and ice.
brush | Brush handle |
alpha | Alpha level of brush |
BBDECL void BBCALL xBrushShininess | ( | Brush * | brush, |
float | shininess | ||
) |
Sets the specular shininess of a brush.
The shininess value should be in the range [0.0; 1.0]. The default shininess setting is 0.0 Shininess is how much brighter certain areas of an object will appear to be when a light is shone directly at them. Setting a shininess value of 1.0 for a medium to high poly sphere, combined with the creation of a light shining in the direction of it, will give it the appearance of a shiny snooker ball
brush | Brush handle |
shininess | Shininess of brush |
BBDECL void BBCALL xBrushBlend | ( | Brush * | brush, |
int | blend | ||
) |
Sets the blending mode for a brush.
brush | Brush handle |
blend | Blending type. See 'Blending modes' for more infromation |
BBDECL void BBCALL xBrushFX | ( | Brush * | brush, |
int | FX | ||
) |
Sets miscellaneous effects for a brush.
Flags can be added to combine two or more effects.
brush | Brush handle |
FX | ffects flags See 'FX flags' for more infromation |
BBDECL void BBCALL xBrushTexture | ( | Brush * | brush, |
Texture * | texture, | ||
int | frame = 0 , |
||
int | index = 0 |
||
) |
Assigns a texture to a brush.
The optional frame parameter specifies which animation frame, if any exist, should be assigned to the brush. The optional index parameter specifies texture layer that the texture should be assigned to.
brush | Brush handle |
texture | Texture handle |
frame | Texture frame |
index | Texture layer |
BBDECL const char* BBCALL xGetBrushName | ( | Brush * | brush | ) |
Returns brush name.
brush | Brush handle |
BBDECL void BBCALL xBrushName | ( | Brush * | brush, |
const char * | name | ||
) |
Sets brush name.
brush | Brush handle |
name | New brush name |
BBDECL float BBCALL xGetBrushAlpha | ( | Brush * | brush | ) |
Returns brush alpha value.
brush | Brush handle |
BBDECL int BBCALL xGetBrushBlend | ( | Brush * | brush | ) |
Returns brush blend mode.
brush | Brush handle |
BBDECL int BBCALL xGetBrushRed | ( | Brush * | brush | ) |
Returns brush red diffuse color.
brush | Brush handle |
BBDECL int BBCALL xGetBrushGreen | ( | Brush * | brush | ) |
Returns brush green diffuse color.
brush | Brush handle |
BBDECL int BBCALL xGetBrushBlue | ( | Brush * | brush | ) |
Returns brush blue diffuse color.
brush | Brush handle |
BBDECL int BBCALL xGetBrushFX | ( | Brush * | brush | ) |
Returns brush FX flags.
brush | Brush handle |
BBDECL float BBCALL xGetBrushShininess | ( | Brush * | brush | ) |
Returns brush shininess value.
brush | Brush handle |