/* Draws a welcome message before game play begins */ void welcome(){ gText t3 = gText(10, GLCD.CenterY, 20, 1, SystemFont5x7); t3.Printf("Get ready to play..."); delay(2000); GLCD.ClearScreen(); t3 = gText(10, GLCD.CenterY, 20, 1, SystemFont5x7); t3.Printf("BALLDUINO!"); delay(500); GLCD.ClearScreen(); }
/* Tell the user they won */ void winner(){ GLCD.ClearScreen(); gText t3 = gText(10, GLCD.CenterY, 8, 1, SystemFont5x7); t3.Printf("YOU WIN!"); delay(3000); GLCD.ClearScreen(); reset(); }
/* Start a new game */ void gameOver(){ GLCD.ClearScreen(); gText t3 = gText(10, GLCD.CenterY, 8, 1, SystemFont5x7); t3.Printf("FAILURE!"); delay(3000); GLCD.ClearScreen(); reset(); }
static int drawGraphic2(PARAM *p, int id, DATA *d) { int x,y,w,h,fontsize; x = 80; y = 50; w = 350; h = 180; fontsize = 10; gBeginDraw (p,id); //gSetFloatFormat(p,"%5.2f"); gComment (p,"This is a comment in the metafile"); gSetColor (p,BLACK); gSetFont (p,TIMES,fontsize,Normal,0); gBoxWithText (p,x,y,w,h,fontsize,"phi/rad","sin(phi)",NULL); gXAxis (p,0,1.0f,2.0f*PI,1); gYAxis (p,-1.5f,0.5f,1.5f,1); //gSetStyle (p,1); gSetStyle (p,DotLine); gXGrid (p); gYGrid (p); //gSetStyle (p,0); gSetColor (p,RED); gSetStyle (p,DashDotLine); /* gSetLinestyle (p,LINESTYLE_RECT); */ gLine (p,d->x,d->y,d->n); gSetColor (p,BLUE); gText (p,x+w/2,y-fontsize*2,"Date: 19-NOV-2000",ALIGN_CENTER); fontsize = 24; gSetFont (p,TIMES,fontsize,Bold,1); gText (p,x+w/2,y-fontsize*2,"This is a Diagram",ALIGN_CENTER); gDrawPie (p,10,10,30,30,0,130); gRect (p,10,50,30,30); gEndDraw (p); return 0; }
#include <stdlib.h> #include "armcmx.h" #include "GLCD/glcd.h" #include <math.h> #include "GLCD/fonts/allFonts.h" // system and arial14 fonts are used #include "GLCD/bitmaps/allBitmaps.h" // all images in the bitmap dir Image icon; gText textArea; // a text area to be defined later in the sketch gText textAreaArray[3]; // an array of text areas gText countdownArea = gText(GLCD.CenterX, GLCD.CenterY,1,1,Arial_14); // text area for countdown digits unsigned long startMillis; unsigned int loops = 0; unsigned int iter = 0; int theDelay = 20; //glcd GLCD; // w/ init() void introScreen(); void countdown(int count); void scrollingDemo(); void textAreaDemo(); void showArea(predefinedArea area, char *description); void scribble( const unsigned int duration ); byte fn_x( float tick ); byte fn_y( float tick ); void moveBall(unsigned int duration); void showCharacters(char * title, Font_t font);