Ceci est une version archivée de
ApiOsdDetails à 2005-01-15 23:03:58.
29.2 Details
29.2.1 void raydium_osd_color_change(GLfloat r, GLfloat g, GLfloat b)
This function will change the font color for the next raydium_osd_printf* calls.
As usual: 0 <= (r,g and b) <= 1.
29.2.2 void raydium_osd_alpha_change(GLfloat a)
Same as above, but will change font transparency.
29.2.3 void raydium_osd_color_rgba(GLfloat r, GLfloat g, GLfloat b, GLfloat a)
This is a mix of raydium_osd_color_change and raydium_osd_alpha_change.
29.2.4 void raydium_osd_color_ega(char hexa)
This function will change font color with the corresponding hexadecimal code (as a char: '0' to 'F') in the standard EGA palette.
Here it is this palette:
Hexa | Color |
0 | Black |
1 | Blue |
2 | Green |
3 | Cyan |
4 | Red |
5 | Purple |
6 | Brown |
7 | White |
8 | Grey |
9 | Light Blue |
A | Light Green |
B | Light Cyan |
C | Light Red |
D | Light Purple |
E | Light Yellow |
F | Light White |
29.2.5 void raydium_osd_printf(GLfloat x, GLfloat y, GLfloat size, GLfloat spacer,char *texture, unsigned char *format, ...)
This function is an
OpenGL equivalent to the standard "printf" C function.
* (x,y) is the position of the text's beginning, as a screen percentage, with origin at lower left.
* size is the font size, using an arbitrary unit. This size is always proportionnal to frame size (font size will grow up with screen size, in other words).
* spacer is the factor of spacing between 2 consecutive letters. With standard fonts, 0.5 is a correct value (relatively condensed text).
* texture is obviously the texture filename to use (font*.tga are often provided with Raydium distribution).
* format is the standard printf format string, followed by corresponding arguments:
"^9Player ^Fname is: %10s", player_name
This format can use '^' char to change color text, followed by a color, indicated by a hexadecimal letter (EGA palette). See raydium_osd_color_ega function, above.
Here you are a simple example:
strcpy(version,"^Ctest 0.1^F");
[...]
raydium_osd_printf(2,98,16,0.5,"font2.tga","- %3i FPS - tech demo %s for Raydium %s, CQFD Corp.",last_fps,version,raydium_version);
29.2.6 void raydium_osd_printf_3D(GLfloat x, GLfloat y, GLfloat z, GLfloat size, GLfloat spacer,char *texture, unsigned char *format, ...)
Same as above, but you can place your text in your application 3D space, using x, y and z values.
29.2.7 void raydium_osd_logo(char *texture)
Will draw a logo for the current frame with texture filename.
29.2.8 void raydium_osd_cursor_set(char *texture,GLfloat xsize, GLfloat ysize)
This function will set mouse cursor with texture filename and with (xsize,ysize) size (percent of screen size).
You should use a RGBA texture for better results.
example:
raydium_osd_cursor_set("BOXcursor.tga",4,4);
29.2.9 void raydium_osd_draw(int tex ,GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
This function will draw "tex" texture using (x1,y1),(x2,y2) box (percent of screen).
29.2.10 void raydium_osd_draw_name(char *tex ,GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
Same as above, but using a texture name.
29.2.11 void raydium_osd_network_stat_draw(GLfloat px, GLfloat py, GLfloat size)
Graphic network monitor. Good luck. (px, py, and size: percent of screen)
Return to
RaydiumApiReference index.