GMBR
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.
Entrar

Esqueci-me da senha

Últimos assuntos
» Como ajustar velocidade de cada frame da animação no game maker
por Ralphed Ontem à(s) 18:28

» PROBLEMAS COM FÍSICAS DE ÁGUA
por aminaro Ter 16 Abr 2024, 10:07

» Retorno da GMBR!!!
por Ralphed Sex 12 Abr 2024, 22:45

» JOGADOR PARANDO NO AR QUANDO ATACA
por aminaro Qua 10 Abr 2024, 13:51

» Problemas com texto interativo
por Kaaru72 Dom 07 Abr 2024, 11:31

» Erro escondido e indecifrável
por dev_gabize.azv Qui 04 Abr 2024, 10:11

» Mudar cor de apenas uma palavra
por Ralphed Sáb 30 Mar 2024, 00:39

» Procuro Programador de game maker
por Wou Sex 15 Mar 2024, 10:27

» Mod APK
por gamerainha Qua 13 Mar 2024, 06:30

» Aceito pedidos de sprites (Com exemplos meus)
por Sevilha Qua 28 Fev 2024, 12:17

» Inventário simples
por Isquilo_Roedor Qui 22 Fev 2024, 15:18

» Problemas na programaçnao de inimigo [jogo DOOM LIKE]
por Black Mirror Dom 11 Fev 2024, 13:34

» ANDROID MULTI TOUCH
por DiegoBr Dom 04 Fev 2024, 12:13

» Servidor de Discord do fórum?
por Lighter Sáb 27 Jan 2024, 17:18

» Save e Load Json
por Klinton Rodrigues Qui 25 Jan 2024, 11:12

» Colisão com mais de um objeto
por aminaro Seg 22 Jan 2024, 15:02

» Oi sou novo aqui
por Thiago Silveira Alexandre Sáb 20 Jan 2024, 20:55

» Como acessar conteudo comprado no marketplace
por macmilam Sex 19 Jan 2024, 07:42

» Devlogs em vídeos do Block Room
por Joton Seg 15 Jan 2024, 16:56

» Alguém aqui já ganha dinheiro com seus games?
por Joton Seg 15 Jan 2024, 16:49

» ACERVO GMBR MAGAZINE
por Joton Qui 11 Jan 2024, 19:21

» como aumentar o obj sem aumentar a colisão??
por GabrielXavier Qua 10 Jan 2024, 07:21

» Asteroid Core - Early Acesse Update [0.2.0.0]
por JOZ. Seg 08 Jan 2024, 14:39

» Versionamento de código com GitHub
por GabrielXavier Seg 08 Jan 2024, 07:32

» Rio Rise - novo launcher do Gta San Andreas SAMP Brasil
por kolesovsup Sex 29 Dez 2023, 07:16


Simple Menu System (SMS, by CPinheiro)

3 participantes

Ir para baixo

Simple Menu System (SMS, by CPinheiro) Empty Simple Menu System (SMS, by CPinheiro)

Mensagem por CPinheiro Seg 20 Abr 2009, 02:03

Simple Menu System

.: Descrição
Um script de menu voltado para os iniciantes que querem ter menus bonitos em seus jogos, mas não tem recursos gráficos para isso. Este apresenta um belo botão, completamente funcional, textos com bordas, possibilidade de multiplas opções, etc...

.: Script


Código:

//SMS(posição x, posição y, tamanho do botão (por enquanto somente o tamanho "1" está disponível), total de botões (max. 3 botões),texto do botão 1, código do botão 1, texto do botão 2, código do botão 2, texto do botão 3, código do botão 3, cor (1=vermelho, 2=verde, 3=azul),fonte);

posicaox=argument0
posicaoy=argument1
tambut=argument2
totalbut=argument3
txtopcao1=argument4
codeopcao1=argument5
txtopcao2=argument6
codeopcao2=argument7
txtopcao3=argument8
codeopcao3=argument9
cor=argument10
fnt=argument11

draw_set_font(fnt);
for(i=0;i<10;i+=1;){idbut[i]=0}
if (cor==1) //Vermelho
{
        cor1_bt1=make_color_rgb(186,12,12);
        cor2_bt1=make_color_rgb(240,28,28);
        cor3_bt1=make_color_rgb(245,101,101);
        cor4_bt1=make_color_rgb(249,157,157);
}


if (cor==2) //Verde
{
        cor1_bt1=make_color_rgb(12,186,12);
        cor2_bt1=make_color_rgb(28,240,28);
        cor3_bt1=make_color_rgb(101,245,101);
        cor4_bt1=make_color_rgb(157,249,157);
}


if (cor==3) //Azul
{
        cor1_bt1=make_color_rgb(12,12,186);
        cor2_bt1=make_color_rgb(28,28,240);
        cor3_bt1=make_color_rgb(101,101,245);
        cor4_bt1=make_color_rgb(157,157,249);
}

// TAMANHO 1

if (tambut==1)
{
    if (totalbut==1)
    {
        if (mouse_x>=posicaox) && (mouse_x<=posicaox+128) && (mouse_y>=posicaoy) && (mouse_y<=posicaoy+24)
        {                idbut[1]=1;
            posmou=1;
            draw_set_color(c_white)
            draw_rectangle(posicaox,posicaoy,posicaox+128,posicaoy+24,true)
            draw_set_color(c_black)
            draw_rectangle(posicaox+1,posicaoy+1,posicaox+127,posicaoy+23,true)
            draw_rectangle_color(posicaox+2,posicaoy+2,posicaox+127,posicaoy+23,cor1_bt1,cor2_bt1,cor3_bt1,cor4_bt1,0);
            draw_text(posicaox+61,posicaoy+5,txtopcao1);
            draw_text(posicaox+63,posicaoy+5,txtopcao1);
            draw_text(posicaox+62,posicaoy+4,txtopcao1);
            draw_text(posicaox+62,posicaoy+6,txtopcao1);
            draw_set_color(c_white)
            draw_text(posicaox+62,posicaoy+5,txtopcao1);
            if (mouse_check_button_pressed(mb_left))
            {
execute_string(codeopcao1);
            }
        }
        else
        {posmou=0 idbut[1]=0
            draw_set_color(c_black)
            draw_rectangle(posicaox,posicaoy,posicaox+128,posicaoy+24,true)
            draw_set_color(c_white)
            draw_rectangle(posicaox+1,posicaoy+1,posicaox+127,posicaoy+23,true)
            draw_rectangle_color(posicaox+2,posicaoy+2,posicaox+127,posicaoy+23,cor1_bt1,cor2_bt1,cor3_bt1,cor4_bt1,0);
            draw_set_color(c_black);
            draw_text(posicaox+61,posicaoy+5,txtopcao1);
            draw_text(posicaox+63,posicaoy+5,txtopcao1);
            draw_text(posicaox+62,posicaoy+4,txtopcao1);
            draw_text(posicaox+62,posicaoy+6,txtopcao1);
            draw_set_color(c_white)
            draw_text(posicaox+62,posicaoy+5,txtopcao1);
        }
    }
   
        if (totalbut==2)
    {
      if (mouse_x>=posicaox) && (mouse_x<=posicaox+128) && (mouse_y>=posicaoy) && (mouse_y<=posicaoy+24)
        {                idbut[1]=1;
            posmou=1;
            draw_set_color(c_white)
            draw_rectangle(posicaox,posicaoy,posicaox+128,posicaoy+24,true)
            draw_set_color(c_black)
            draw_rectangle(posicaox+1,posicaoy+1,posicaox+127,posicaoy+23,true)
            draw_rectangle_color(posicaox+2,posicaoy+2,posicaox+127,posicaoy+23,cor1_bt1,cor2_bt1,cor3_bt1,cor4_bt1,0);
            draw_text(posicaox+61,posicaoy+5,txtopcao1);
            draw_text(posicaox+63,posicaoy+5,txtopcao1);
            draw_text(posicaox+62,posicaoy+4,txtopcao1);
            draw_text(posicaox+62,posicaoy+6,txtopcao1);
            draw_set_color(c_white)
            draw_text(posicaox+62,posicaoy+5,txtopcao1);
            if (mouse_check_button_pressed(mb_left))
            {
execute_string(codeopcao1);
            }
        }
        else
        {posmou=0 idbut[1]=0
            draw_set_color(c_black)
            draw_rectangle(posicaox,posicaoy,posicaox+128,posicaoy+24,true)
            draw_set_color(c_white)
            draw_rectangle(posicaox+1,posicaoy+1,posicaox+127,posicaoy+23,true)
            draw_rectangle_color(posicaox+2,posicaoy+2,posicaox+127,posicaoy+23,cor1_bt1,cor2_bt1,cor3_bt1,cor4_bt1,0);
            draw_set_color(c_black);
            draw_text(posicaox+61,posicaoy+5,txtopcao1);
            draw_text(posicaox+63,posicaoy+5,txtopcao1);
            draw_text(posicaox+62,posicaoy+4,txtopcao1);
            draw_text(posicaox+62,posicaoy+6,txtopcao1);
            draw_set_color(c_white)
            draw_text(posicaox+62,posicaoy+5,txtopcao1);
        }
        if (mouse_x>=posicaox) && (mouse_x<=posicaox+128) && (mouse_y>=posicaoy+24+6) && (mouse_y<=posicaoy+24+24+6)
        {            posmou=1;
            idbut[2]=1;
            draw_set_color(c_white)
            draw_rectangle(posicaox,posicaoy+24+6,posicaox+128,posicaoy+24+24+6,true)
            draw_set_color(c_black)
            draw_rectangle(posicaox+1,posicaoy+1+24+6,posicaox+127,posicaoy+23+24+6,true)
            draw_rectangle_color(posicaox+2,posicaoy+2+24+6,posicaox+127,posicaoy+23+24+6,cor1_bt1,cor2_bt1,cor3_bt1,cor4_bt1,0);
            draw_text(posicaox+61,posicaoy+2+21+12,txtopcao2);
            draw_text(posicaox+63,posicaoy+2+21+12,txtopcao2);
            draw_text(posicaox+62,posicaoy+1+21+12,txtopcao2);
            draw_text(posicaox+62,posicaoy+3+21+12,txtopcao2);
            draw_set_color(c_white)
            draw_text(posicaox+62,posicaoy+2+21+12,txtopcao2);
            if (mouse_check_button_pressed(mb_left))
            {
execute_string(codeopcao2);
            }
        }
        else
        {posmou=0 idbut[2]=0
            draw_set_color(c_black)
            draw_rectangle(posicaox,posicaoy+24+6,posicaox+128,posicaoy+24+24+6,true)
            draw_set_color(c_white)
            draw_rectangle(posicaox+1,posicaoy+1+24+6,posicaox+127,posicaoy+23+24+6,true)
            draw_rectangle_color(posicaox+2,posicaoy+2+24+6,posicaox+127,posicaoy+23+24+6,cor1_bt1,cor2_bt1,cor3_bt1,cor4_bt1,0);
            draw_set_color(c_black)
            draw_set_halign(fa_center)
            draw_text(posicaox+61,posicaoy+2+21+12,txtopcao2);
            draw_text(posicaox+63,posicaoy+2+21+12,txtopcao2);
            draw_text(posicaox+62,posicaoy+1+21+12,txtopcao2);
            draw_text(posicaox+62,posicaoy+3+21+12,txtopcao2);
            draw_set_color(c_white)
            draw_text(posicaox+62,posicaoy+2+21+12,txtopcao2);
        }

    }
   
            if (totalbut==3)
    {
        if (mouse_x>=posicaox) && (mouse_x<=posicaox+128) && (mouse_y>=posicaoy) && (mouse_y<=posicaoy+24)
        {                idbut[1]=1;
            posmou=1;
            draw_set_color(c_white)
            draw_rectangle(posicaox,posicaoy,posicaox+128,posicaoy+24,true)
            draw_set_color(c_black)
            draw_rectangle(posicaox+1,posicaoy+1,posicaox+127,posicaoy+23,true)
            draw_rectangle_color(posicaox+2,posicaoy+2,posicaox+127,posicaoy+23,cor1_bt1,cor2_bt1,cor3_bt1,cor4_bt1,0);
            draw_text(posicaox+61,posicaoy+5,txtopcao1);
            draw_text(posicaox+63,posicaoy+5,txtopcao1);
            draw_text(posicaox+62,posicaoy+4,txtopcao1);
            draw_text(posicaox+62,posicaoy+6,txtopcao1);
            draw_set_color(c_white)
            draw_text(posicaox+62,posicaoy+5,txtopcao1);
            if (mouse_check_button_pressed(mb_left))
            {
execute_string(codeopcao1);
            }
        }
        else
        {posmou=0 idbut[1]=0
            draw_set_color(c_black)
            draw_rectangle(posicaox,posicaoy,posicaox+128,posicaoy+24,true)
            draw_set_color(c_white)
            draw_rectangle(posicaox+1,posicaoy+1,posicaox+127,posicaoy+23,true)
            draw_rectangle_color(posicaox+2,posicaoy+2,posicaox+127,posicaoy+23,cor1_bt1,cor2_bt1,cor3_bt1,cor4_bt1,0);
            draw_set_color(c_black);
            draw_text(posicaox+61,posicaoy+5,txtopcao1);
            draw_text(posicaox+63,posicaoy+5,txtopcao1);
            draw_text(posicaox+62,posicaoy+4,txtopcao1);
            draw_text(posicaox+62,posicaoy+6,txtopcao1);
            draw_set_color(c_white)
            draw_text(posicaox+62,posicaoy+5,txtopcao1);
        }
        if (mouse_x>=posicaox) && (mouse_x<=posicaox+128) && (mouse_y>=posicaoy+24+6) && (mouse_y<=posicaoy+24+24+6)
        {            posmou=1;
            idbut[2]=1;
            draw_set_color(c_white)
            draw_rectangle(posicaox,posicaoy+24+6,posicaox+128,posicaoy+24+24+6,true)
            draw_set_color(c_black)
            draw_rectangle(posicaox+1,posicaoy+1+24+6,posicaox+127,posicaoy+23+24+6,true)
            draw_rectangle_color(posicaox+2,posicaoy+2+24+6,posicaox+127,posicaoy+23+24+6,cor1_bt1,cor2_bt1,cor3_bt1,cor4_bt1,0);
            draw_text(posicaox+61,posicaoy+2+21+12,txtopcao2);
            draw_text(posicaox+63,posicaoy+2+21+12,txtopcao2);
            draw_text(posicaox+62,posicaoy+1+21+12,txtopcao2);
            draw_text(posicaox+62,posicaoy+3+21+12,txtopcao2);
            draw_set_color(c_white)
            draw_text(posicaox+62,posicaoy+2+21+12,txtopcao2);
            if (mouse_check_button_pressed(mb_left))
            {
execute_string(codeopcao2);
            }
        }
        else
        {posmou=0 idbut[2]=0
            draw_set_color(c_black)
            draw_rectangle(posicaox,posicaoy+24+6,posicaox+128,posicaoy+24+24+6,true)
            draw_set_color(c_white)
            draw_rectangle(posicaox+1,posicaoy+1+24+6,posicaox+127,posicaoy+23+24+6,true)
            draw_rectangle_color(posicaox+2,posicaoy+2+24+6,posicaox+127,posicaoy+23+24+6,cor1_bt1,cor2_bt1,cor3_bt1,cor4_bt1,0);
            draw_set_color(c_black)
            draw_set_halign(fa_center)
            draw_text(posicaox+61,posicaoy+2+21+12,txtopcao2);
            draw_text(posicaox+63,posicaoy+2+21+12,txtopcao2);
            draw_text(posicaox+62,posicaoy+1+21+12,txtopcao2);
            draw_text(posicaox+62,posicaoy+3+21+12,txtopcao2);
            draw_set_color(c_white)
            draw_text(posicaox+62,posicaoy+2+21+12,txtopcao2);
        }
        if (mouse_x>=posicaox) && (mouse_x<=posicaox+128) && (mouse_y>=posicaoy+24+12+24) && (mouse_y<=posicaoy+24+24+24+12)
        {                idbut[3]=1;
                        draw_set_color(c_white)
            draw_rectangle(posicaox,posicaoy+24+24+12,posicaox+128,posicaoy+24+24+12+24,true)
            draw_set_color(c_black)
            draw_rectangle(posicaox+1,posicaoy+1+24+24+12,posicaox+127,posicaoy+23+24+12+24,true)
            draw_rectangle_color(posicaox+2,posicaoy+2+24+12+24,posicaox+127,posicaoy+23+24+12+24,cor1_bt1,cor2_bt1,cor3_bt1,cor4_bt1,0);
            draw_set_halign(fa_center)
            draw_text(posicaox+61,posicaoy+2+24+15+24,txtopcao3);
            draw_text(posicaox+63,posicaoy+2+24+15+24,txtopcao3);
            draw_text(posicaox+62,posicaoy+1+24+15+24,txtopcao3);
            draw_text(posicaox+62,posicaoy+3+24+15+24,txtopcao3);
            draw_set_color(c_white)
            draw_text(posicaox+62,posicaoy+2+24+15+24,txtopcao3);
                    if (mouse_check_button_pressed(mb_left))
            {
execute_string(codeopcao3);
            }
        }
        else
        {  idbut[3]=0
            draw_set_color(c_black)
            draw_rectangle(posicaox,posicaoy+24+24+12,posicaox+128,posicaoy+24+24+12+24,true)
            draw_set_color(c_white)
            draw_rectangle(posicaox+1,posicaoy+1+24+24+12,posicaox+127,posicaoy+23+24+12+24,true)
            draw_rectangle_color(posicaox+2,posicaoy+2+24+12+24,posicaox+127,posicaoy+23+24+12+24,cor1_bt1,cor2_bt1,cor3_bt1,cor4_bt1,0);
            draw_set_color(c_black)
            draw_set_halign(fa_center)
            draw_text(posicaox+61,posicaoy+2+24+15+24,txtopcao3);
            draw_text(posicaox+63,posicaoy+2+24+15+24,txtopcao3);
            draw_text(posicaox+62,posicaoy+1+24+15+24,txtopcao3);
            draw_text(posicaox+62,posicaoy+3+24+15+24,txtopcao3);
            draw_set_color(c_white)
            draw_text(posicaox+62,posicaoy+2+24+15+24,txtopcao3);
        }
    }
}

.: Versão
Esta é a versão 0.1a. Ela contém alguns pequenos erros de código (como algumas vars inúteis, mas NADA que atrapalhe seu projeto), que serão ajeitados na versão 0.1b. Logo depois, na versão 0.2, pretendo adicionar o Tamanho 2 e/ou novas cores para os botões.

Tentei deixar da forma mais simples possível para que qualquer iniciante entenda. Também me preocupei em que a caixa de texto ficasse bonita, e gostei bastante do resultado.


Comentem. x)
CPinheiro
CPinheiro

Data de inscrição : 01/06/2008
Reputação : 0
Número de Mensagens : 1015
Prêmios : Simple Menu System (SMS, by CPinheiro) Empty

Medalhas x 0 Tutoriais x 1 Moedas x 0

Ouro x 0 Prata x 0 Bronze x 0

Insignia 1 x 0 Insignia 2 x 0 Insignia 3 x 0

http://supermariobrasileiro.blogspot.com

Ir para o topo Ir para baixo

Simple Menu System (SMS, by CPinheiro) Empty Re: Simple Menu System (SMS, by CPinheiro)

Mensagem por patoki Seg 20 Abr 2009, 12:45

O script ta bem grande, mas e de facil compreensao! Irei experimentar os 3 scripts de menu(=D) aqui postados!
avatar
patoki

Data de inscrição : 19/12/2008
Reputação : 0
Número de Mensagens : 175
Prêmios : Simple Menu System (SMS, by CPinheiro) Empty

Medalhas x 0 Tutoriais x 0 Moedas x 0

Ouro x 0 Prata x 0 Bronze x 0

Insignia 1 x 0 Insignia 2 x 0 Insignia 3 x 0

Ir para o topo Ir para baixo

Simple Menu System (SMS, by CPinheiro) Empty Re: Simple Menu System (SMS, by CPinheiro)

Mensagem por Gusba Seg 20 Abr 2009, 13:49

cara, nao gostei pelo tamanho dele, axo q uma automação na posição dos draws ia diminuir o tamanho, e ajudar no processamento e memoria, mas para primeiros scripts ax oq ta bom, digo primeiro pq ainda nao domina outros loops e opções mais avançadas, se precisar de ajuda nisso pede q eu to ai, vlw!
Gusba
Gusba

Data de inscrição : 03/08/2008
Reputação : 0
Número de Mensagens : 1156
Prêmios : Simple Menu System (SMS, by CPinheiro) Empty

Medalhas x 0 Tutoriais x 0 Moedas x 0

Ouro x 1 Prata x 0 Bronze x 0

Insignia 1 x 0 Insignia 2 x 0 Insignia 3 x 0

http://www.ciganospictures.hd1.com.br

Ir para o topo Ir para baixo

Simple Menu System (SMS, by CPinheiro) Empty Re: Simple Menu System (SMS, by CPinheiro)

Mensagem por Conteúdo patrocinado


Conteúdo patrocinado


Ir para o topo Ir para baixo

Ir para o topo


 
Permissões neste sub-fórum
Não podes responder a tópicos