experimental selection backgrounds for menus (ingamemenu-like)
This commit is contained in:
parent
d908dcede1
commit
aea10c8404
3 changed files with 51 additions and 22 deletions
|
@ -83,8 +83,9 @@ void create_main_menu(MenuData *m) {
|
|||
|
||||
|
||||
void draw_main_menu_bg(MenuData* menu) {
|
||||
glColor4f(1,1,1,1);
|
||||
draw_texture(SCREEN_W/2, SCREEN_H/2, "mainmenu/mainmenubgbg");
|
||||
glColor4f(1,1,1,0.9 + 0.1*sin(menu->frames/100.0));
|
||||
glColor4f(1,1,1,0.95 + 0.05*sin(menu->frames/100.0));
|
||||
|
||||
draw_texture(SCREEN_W/2, SCREEN_H/2, "mainmenu/mainmenubg");
|
||||
glColor4f(1,1,1,1);
|
||||
|
@ -99,29 +100,31 @@ void draw_main_menu(MenuData *menu) {
|
|||
glPushMatrix();
|
||||
glTranslatef(0, SCREEN_H-200, 0);
|
||||
|
||||
Texture *bg = get_tex("part/smoke");
|
||||
glPushMatrix();
|
||||
glTranslatef(135, menu->drawdata[2], 0);
|
||||
glScalef(270, 34, 1);
|
||||
|
||||
glColor4f(0,0,0,0.7);
|
||||
|
||||
draw_quad();
|
||||
|
||||
glTranslatef(50 + menu->drawdata[1]/2, menu->drawdata[2], 0); // 135
|
||||
glScalef(menu->drawdata[1]/100.0, 0.5, 1);
|
||||
glRotatef(menu->frames*2,0,0,1);
|
||||
glColor4f(0,0,0,0.5);
|
||||
draw_texture_p(0,0,bg);
|
||||
glPopMatrix();
|
||||
|
||||
int i;
|
||||
|
||||
int grey = 2;
|
||||
|
||||
menu->drawdata[1] += (stringwidth(menu->entries[menu->cursor].name, _fonts.mainmenu) - menu->drawdata[1])/10.0;
|
||||
menu->drawdata[2] += (35*menu->cursor - menu->drawdata[2])/10.0;
|
||||
|
||||
for(i = 0; i < menu->ecount; i++) {
|
||||
float s = 5*sin(menu->frames/80.0 + 20*i);
|
||||
|
||||
if(menu->entries[i].action == NULL && grey != 1) {
|
||||
menu->entries[i].drawdata += 0.2 * ((i == menu->cursor) - menu->entries[i].drawdata);
|
||||
|
||||
if(menu->entries[i].action == NULL) {
|
||||
glColor4f(0.5,0.5,0.5,0.7);
|
||||
grey = 1;
|
||||
} else if(grey != 0) {
|
||||
glColor4f(1,1,1,0.7);
|
||||
grey = 0;
|
||||
} else {
|
||||
//glColor4f(1,1,1,0.7);
|
||||
float a = 1 - menu->entries[i].drawdata;
|
||||
float b = 1.5;
|
||||
glColor4f(1, 0.7 + a, 0.4 + a, 0.7);
|
||||
}
|
||||
|
||||
draw_text(AL_Left, 50 + s, 35*i, menu->entries[i].name, _fonts.mainmenu);
|
||||
|
@ -129,7 +132,6 @@ void draw_main_menu(MenuData *menu) {
|
|||
|
||||
glPopMatrix();
|
||||
|
||||
menu->drawdata[2] += (35*menu->cursor - menu->drawdata[2])/10.0;
|
||||
|
||||
fade_out(menu->fade);
|
||||
}
|
||||
|
|
|
@ -461,21 +461,35 @@ void draw_options_menu(MenuData *menu) {
|
|||
draw_options_menu_bg(menu);
|
||||
|
||||
draw_text(AL_Right, 140*(1-menu->fade), 30, "Options", _fonts.mainmenu);
|
||||
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(100, 100, 0);
|
||||
|
||||
/*
|
||||
glPushMatrix();
|
||||
glTranslatef(SCREEN_W/2 - 100, menu->drawdata[2], 0);
|
||||
glScalef(SCREEN_W - 200, 20, 1);
|
||||
glColor4f(0,0,0,0.5);
|
||||
|
||||
draw_quad();
|
||||
glPopMatrix();
|
||||
*/
|
||||
|
||||
Texture *bg = get_tex("part/smoke");
|
||||
glPushMatrix();
|
||||
glTranslatef(menu->drawdata[0], menu->drawdata[2], 0);
|
||||
glScalef(menu->drawdata[1]/100.0, 0.2, 1);
|
||||
glRotatef(menu->frames*2,0,0,1);
|
||||
glColor4f(0,0,0,0.5);
|
||||
draw_texture_p(0,0,bg);
|
||||
glPopMatrix();
|
||||
|
||||
OptionBinding *binds = (OptionBinding*)menu->context;
|
||||
OptionBinding *bind;
|
||||
|
||||
menu->drawdata[0] += ((SCREEN_W/2 - 100) - menu->drawdata[0])/10.0;
|
||||
menu->drawdata[1] += ((SCREEN_W - 200) - menu->drawdata[1])/10.0;
|
||||
menu->drawdata[2] += (20*menu->cursor - menu->drawdata[2])/10.0;
|
||||
|
||||
int i, caption_drawn = 0;
|
||||
|
||||
for(i = 0; i < menu->ecount; i++) {
|
||||
|
@ -572,7 +586,6 @@ void draw_options_menu(MenuData *menu) {
|
|||
|
||||
|
||||
glPopMatrix();
|
||||
menu->drawdata[2] += (20*menu->cursor - menu->drawdata[2])/10.0;
|
||||
|
||||
fade_out(menu->fade);
|
||||
}
|
||||
|
|
|
@ -40,13 +40,28 @@ void draw_stage_menu(MenuData *m) {
|
|||
glPushMatrix();
|
||||
glTranslatef(100, 100 + ((m->ecount * 20 + 140 > SCREEN_W)? min(0, SCREEN_H * 0.7 - 100 - m->drawdata[2]) : 0), 0);
|
||||
|
||||
/*
|
||||
glPushMatrix();
|
||||
glTranslatef(SCREEN_W/2 - 100, m->drawdata[2], 0);
|
||||
glScalef(SCREEN_W - 200, 20, 1);
|
||||
glColor4f(0,0,0,0.5);
|
||||
|
||||
draw_quad();
|
||||
glPopMatrix();
|
||||
*/
|
||||
|
||||
Texture *bg = get_tex("part/smoke");
|
||||
glPushMatrix();
|
||||
glTranslatef(m->drawdata[0], m->drawdata[2], 0);
|
||||
glScalef(m->drawdata[1]/100.0, 0.2, 1);
|
||||
glRotatef(m->frames*2,0,0,1);
|
||||
glColor4f(0,0,0,0.5);
|
||||
draw_texture_p(0,0,bg);
|
||||
glPopMatrix();
|
||||
|
||||
MenuEntry *s = &(m->entries[m->cursor]);
|
||||
m->drawdata[0] += ((s->draw? SCREEN_W/2 - 100 : (stringwidth(s->name, _fonts.mainmenu)/2 - s->drawdata*1.5)) - m->drawdata[0])/10.0;
|
||||
m->drawdata[1] += ((s->draw? (SCREEN_W - 200)*0.85 : stringwidth(s->name, _fonts.mainmenu)) - m->drawdata[1])/10.0;
|
||||
m->drawdata[2] += (20*m->cursor - m->drawdata[2])/10.0;
|
||||
|
||||
int i;
|
||||
for(i = 0; i < m->ecount; i++) {
|
||||
|
@ -70,7 +85,6 @@ void draw_stage_menu(MenuData *m) {
|
|||
}
|
||||
|
||||
glPopMatrix();
|
||||
m->drawdata[2] += (20*m->cursor - m->drawdata[2])/10.0;
|
||||
|
||||
fade_out(m->fade);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue