![]() |
Xors3d Engine
|
Functions | |
void | xBrushAlpha (Brush *brush, float alpha) |
Sets the alpha level of a brush. | |
void | xBrushBlend (Brush *brush, int blend) |
Sets the blending mode for a brush. | |
void | xBrushColor (Brush *brush, int red, int green, int blue) |
Sets the colour of a brush. | |
void | xBrushFX (Brush *brush, int FX) |
Sets miscellaneous effects for a brush. | |
void | xBrushName (Brush *brush, const char *name) |
Sets brush name. | |
void | xBrushShininess (Brush *brush, float shininess) |
Sets the specular shininess of a brush. | |
void | xBrushTexture (Brush *brush, Texture *texture, int frame=0, int index=0) |
Assigns a texture to a brush. | |
Brush * | xCreateBrush (float red=255.0f, float green=255.0f, float blue=255.0f) |
Creates a brush and returns a brush handle. | |
void | xFreeBrush (Brush *brush) |
Frees up a brush. | |
float | xGetBrushAlpha (Brush *brush) |
Returns brush alpha value. | |
int | xGetBrushBlend (Brush *brush) |
Returns brush blend mode. | |
int | xGetBrushBlue (Brush *brush) |
Returns brush blue diffuse color. | |
int | xGetBrushFX (Brush *brush) |
Returns brush FX flags. | |
int | xGetBrushGreen (Brush *brush) |
Returns brush green diffuse color. | |
const char * | xGetBrushName (Brush *brush) |
Returns brush name. | |
int | xGetBrushRed (Brush *brush) |
Returns brush red diffuse color. | |
float | xGetBrushShininess (Brush *brush) |
Returns brush shininess value. | |
Texture * | xGetBrushTexture (Brush *brush, int index=0) |
Returns texture assigned to brush. | |
Brush * | 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. |
Brush* 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 |
Brush* 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 |
void xFreeBrush | ( | Brush * | brush | ) |
Frees up a brush.
brush | Brush handle |
Texture* xGetBrushTexture | ( | Brush * | brush, |
int | index = 0 |
||
) |
Returns texture assigned to brush.
brush | Brush handle |
index | Texture layer index. Must be in range 0-7 |
void 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 |
void 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 |
void 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 |
void xBrushBlend | ( | Brush * | brush, |
int | blend | ||
) |
Sets the blending mode for a brush.
brush | Brush handle |
blend | Blending type. See 'Blending modes' for more infromation |
void 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 |
void 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 |
const char* xGetBrushName | ( | Brush * | brush | ) |
Returns brush name.
brush | Brush handle |
void xBrushName | ( | Brush * | brush, |
const char * | name | ||
) |
Sets brush name.
brush | Brush handle |
name | New brush name |
float xGetBrushAlpha | ( | Brush * | brush | ) |
Returns brush alpha value.
brush | Brush handle |
int xGetBrushBlend | ( | Brush * | brush | ) |
Returns brush blend mode.
brush | Brush handle |
int xGetBrushRed | ( | Brush * | brush | ) |
Returns brush red diffuse color.
brush | Brush handle |
int xGetBrushGreen | ( | Brush * | brush | ) |
Returns brush green diffuse color.
brush | Brush handle |
int xGetBrushBlue | ( | Brush * | brush | ) |
Returns brush blue diffuse color.
brush | Brush handle |
int xGetBrushFX | ( | Brush * | brush | ) |
Returns brush FX flags.
brush | Brush handle |
float xGetBrushShininess | ( | Brush * | brush | ) |
Returns brush shininess value.
brush | Brush handle |