Firstly, I would like to say that the API reference on the wiki has helped me
tons and that I really like it!
I only know little C++, and knew no C (though they are kinda the same) but I was able to learn a lot of Radium very quickly!
I do have question though, for more experienced (or maybe just plain experienced
) programmer with Raydium...
Is there somewhere that has tutorial for Gui, possibly?
I searched in Google lots, and found info about RayPHP (which maybe can display a PHP/HTML based gui?)
But... with lack of better words.. I am very new to this
I suppose I need a bit of explaining, like for instance, on the API reference...
Quote:
Raydium's GUI are themable, using ".gui" theme text files. A default "full"
theme is provided as "theme-raydium2.gui" (and suitable ".tga" file) on the
data repository.
What does a .gui file actually do, if you have API and must code Gui in C..?
Does it like change font color and text size? or something else?
Quote:
The idea is simple: build a window (position and size), and create
widgets over this window.
All widgets are created using the current sizes (x,y and font). See
suitable function).
This does make sense. For instance (what I am thinking?) is that you make a 'clear' window
over the actual map (say I have like hills.tri loaded) and then in that 'clear' window, you could display buttons, then put a texture on each button?
Do you get to specify texture for each button?
Like for instance..
I have window that is 500x500 (just example)
and I make a gui that was 500x500
then I make 4 buttons that are 50x50 each
could I put a 50x50 texture in each button?
or must I make a 500x500 texture for the whole gui? that has my 50x50 button textures on it?
Sorry for all questions...
Also, (I know I know, I must be very bugging to you all) could someone give a small example, with comments of what each piece of code do?
for instance, say I have this test application (just for reference, really.)
Code:
#include "raydium/index.c"
GLfloat sun[]={1.0,0.9,0.5,1.0};
GLfloat camx=10;
GLfloat camy=10;
GLfloat camz=20;
void display(void)
{
raydium_joy_key_emul();
camx+=raydium_joy_x;
camy+=raydium_joy_y;
if(raydium_key[GLUT_KEY_PAGE_DOWN]) camz--;
if(raydium_key[GLUT_KEY_PAGE_UP] ) camz++;
if(raydium_key_last==1027) exit(0);
raydium_clear_frame();
raydium_camera_look_at(camx,camy,camz,0,0,0);
raydium_object_draw_name("cocorobix.tri");
raydium_rendering_finish();
}
int main(int argc, char **argv)
{
raydium_init_args(argc,argv);
raydium_window_create(640,480,RAYDIUM_RENDERING_WINDOW,"Mon premier test !");
raydium_texture_filter_change(RAYDIUM_TEXTURE_FILTER_TRILINEAR);
raydium_projection_near=0.01;
raydium_projection_far=1000;
raydium_projection_fov=60;
raydium_window_view_update();
raydium_light_on(0);
memcpy(raydium_light_color[0],sun,raydium_internal_size_vector_float_4);
raydium_light_intensity[0]=1000000;
raydium_light_position[0][0]=50;
raydium_light_position[0][1]=150;
raydium_light_position[0][2]=200;
raydium_light_update_all(0);
raydium_background_color_change(sun[0],sun[1],sun[2],sun[3]);
raydium_fog_disable();
raydium_callback(&display);
return 0;
}
how would I go about adding a simplistic gui that just had a start, and exit button, with a texture (or no texture) on it?
Could someone example code for me?
Sorry about all the hassle I must cause