diff --git a/menu_v1 b/menu_v1 new file mode 100755 index 0000000..a4d5b28 Binary files /dev/null and b/menu_v1 differ diff --git a/menu_v1.c b/menu_v1.c new file mode 100644 index 0000000..479abcd --- /dev/null +++ b/menu_v1.c @@ -0,0 +1,84 @@ +#include +#include +#include + +int menu_principal(void){ + int x; + int y; + EffacerEcran(CouleurParNom("grey")); + + ChoisirCouleurDessin(CouleurParNom("red")); + RemplirRectangle(180,580,100,25); + RemplirRectangle(720,580,100,25); + + ChoisirCouleurDessin(CouleurParNom("black")); + EcrireTexte(475,200,"Memorie",2); + EcrireTexte(200,600,"Quitter",1); + EcrireTexte(750,600,"jouer",1); + + ToucheEnAttente(); + while(1){ + if(SourisCliquee()){ + x=_X; + y=_Y; + + if((x>180) && (x<280) && (y>580) && (y<605)){ + break; + } + + if((x>720) && (x<820) && (y>580) && (y<605)){ + mode_jeu(); + } + } + } + FermerGraphique(); + return EXIT_SUCCESS; +} + +int mode_jeu(void){ + int x; + int y; + EffacerEcran(CouleurParNom("gray")); + ChoisirCouleurDessin(CouleurParNom("red")); + RemplirRectangle(450,300,100,25); + RemplirRectangle(400,400,200,380); + RemplirRectangle(700,400,200,380); + RemplirRectangle(100,400,200,380); + + ChoisirCouleurDessin(CouleurParNom("Black")); + RemplirRectangle(100,780,200,50); + RemplirRectangle(400,780,200,50); + RemplirRectangle(700,780,200,50); + EcrireTexte(400,200,"Mode de Jeu",2); + EcrireTexte(470,320,"retour",1); + + ChoisirCouleurDessin(CouleurParNom("white")); + EcrireTexte(140,810,"theme_1",2); + EcrireTexte(440,810,"theme_2",2); + EcrireTexte(740,810,"theme_3",2); + + + + ToucheEnAttente(); + while(1){ + if (SourisCliquee()){ + x=_X; + y=_Y; + if((x>450) && (x<550) && (y>300) && (y<325)){ + menu_principal(); + } + } + } + return EXIT_SUCCESS; +} + +int main(void){ + int x ; + int y ; + couleur c; + + InitialiserGraphique(); + CreerFenetre(10,10,1000,1000); + menu_principal(); + return EXIT_SUCCESS; +} diff --git a/souris_test b/souris_test new file mode 100755 index 0000000..370a149 Binary files /dev/null and b/souris_test differ diff --git a/souris_test.c b/souris_test.c new file mode 100644 index 0000000..2c15f73 --- /dev/null +++ b/souris_test.c @@ -0,0 +1,33 @@ +#include +#include + +#define tx 300 +#define ty 300 + +int main(void){ + char t[50]; + int x,y; + couleur c; + + InitialiserGraphique(); + CreerFenetre(100,100,tx,ty); + c=CouleurParNom("black"); + SourisPosition(); + x=_X; + y=_Y; + sprintf(t,"x=%3d:y=%3d",_X,_Y); + EffacerEcran(CouleurParNom("white")); + EcrireTexteC((tx-TailleChaineEcran(t,0))/2,ty/2,t,c,0); + + while(!SourisCliquee()){ + SourisPosition(); + if(_X!=x||_Y!=y){ + sprintf(t,"x=%3d:y=%3d",_X,_Y); + EffacerEcran(CouleurParNom("white")); + EcrireTexteC((tx-TailleChaineEcran(t,0))/2,ty/2,t,c,0); + x=_X; + y=_Y; + } + } + FermerGraphique(); +}