/*
Instrucciones:
1. Este script debe ser llamado: draw_highscore_plus;
2. En game maker studio 2 utilizar: function draw_highscore_plus(argument0,argument1,argument2){
3. Colocar en evento Draw/dibujo: draw_highscore_plus(color fondo,color titulo, color fuente);
4. Ejemplo: draw_highscore_plus(c_teal,c_navy,c_black);
*/
titulo_DXNS0006="Top Ten Players";
color_fondo_DXNS0006=argument0;
color_titulo_DXNS0006=argument1;
color_fuente_DXNS0006=argument2;
porcentaje_DXNS0006=95;
proporcion_DXNS0006=2/3;
scoreW_DXNS0006=porcentaje_DXNS0006*room_width/100;
scoreH_DXNS0006=scoreW_DXNS0006/proporcion_DXNS0006;
while(scoreH_DXNS0006>(95*room_height/100))
{
porcentaje_DXNS0006-=1;
scoreW_DXNS0006=porcentaje_DXNS0006*room_width/100;
scoreH_DXNS0006=scoreW_DXNS0006/proporcion_DXNS0006;
}
scorex1_DXNS0006=(room_width-scoreW_DXNS0006)/2;
scorex2_DXNS0006=scorex1_DXNS0006+scoreW_DXNS0006;
scorey1_DXNS0006=(room_height-scoreH_DXNS0006)/2;;
scorey2_DXNS0006=scorey1_DXNS0006+scoreH_DXNS0006;
draw_set_color(color_fondo_DXNS0006);
draw_roundrect(scorex1_DXNS0006,scorey1_DXNS0006,scorex2_DXNS0006,scorey2_DXNS0006,0);
draw_set_color(color_titulo_DXNS0006);
width_DXNS0006=string_width(titulo_DXNS0006);
titulox_DXNS0006=scorex1_DXNS0006+(scoreW_DXNS0006-width_DXNS0006)/2;
tituloY_DXNS0006=scorey1_DXNS0006+7*scoreH_DXNS0006/100;
draw_text(titulox_DXNS0006,tituloY_DXNS0006,titulo_DXNS0006);
draw_set_color(color_fuente_DXNS0006);
for(i_DXNS0006=1;i_DXNS0006<=10;i_DXNS0006+=1)
{
nombre_DXNS0006=string(highscore_name(i_DXNS0006))+".................................................................";
txt_DXNS0006=string(i_DXNS0006)+". "+string(nombre_DXNS0006)+string(highscore_value(i_DXNS0006));
while(string_width(txt_DXNS0006)>90*scoreW_DXNS0006/100)
{
length_DXNS0006=string_length(nombre_DXNS0006);
nombre_DXNS0006=string_delete(nombre_DXNS0006,length_DXNS0006-5,1);
txt_DXNS0006=string(i_DXNS0006)+". "+string(nombre_DXNS0006)+string(highscore_value(i_DXNS0006));
}
txt_DXNS0006=string(i_DXNS0006)+". "+string(nombre_DXNS0006);
x1_DXNS0006=scorex1_DXNS0006+5*scoreW_DXNS0006/100;
y1_DXNS0006=scorey1_DXNS0006+10*scoreH_DXNS0006/100;
draw_text(x1_DXNS0006,y1_DXNS0006+i_DXNS0006*30,txt_DXNS0006);
txt_DXNS0006=string(highscore_value(i_DXNS0006));
width_DXNS0006=string_width(txt_DXNS0006);
x1_DXNS0006=scorex1_DXNS0006+95*scoreW_DXNS0006/100-width_DXNS0006;
draw_text(x1_DXNS0006,y1_DXNS0006+i_DXNS0006*30,txt_DXNS0006);
}
Úsenlo junto al script highscore online para tener una agradable tabla de puntuaciones online sin saber de php,sql o hosting. script hishcore_online instantáneo: https://www.comunidadgm.org/desarrollo-de-scripts/highscore_online-instantaneo/ |