/* Draw text labels */ void MyProjectMain::DrawStrings() { // Build the string to print char buf[128]; sprintf( buf, "Changing text %6d %6d", rand(), rand() ); // Clear the top of the screen, since we about to draw text on it. CopyBackgroundPixels( 0, 0, GetScreenWidth(), 35 ); // Then draw the strings DrawScreenString( 150, 10, buf, 0xffffff, NULL ); }
/* Draw text labels */ void MyProjectMain::DrawStrings() { // Build the string to print char buf[128]; sprintf( buf, "Changing text %6d %6d", rand(), rand() ); // Clear the top of the screen, since we about to draw text on it. CopyBackgroundPixels( 0, 0, GetScreenWidth(), 35 ); // Then draw the strings DrawScreenString( 150, 10, buf, 0xffffff, NULL ); // And mark that area of the screen as having been changed, so it gets redrawn SetNextUpdateRect( 0/*X*/, 0/*Y*/, GetScreenWidth(), 35/*Height*/ ); }
/* Draw text labels */ void Demo4Main::DrawStrings() { // NEW SWITCH switch( m_state ) { case stateInit: CopyBackgroundPixels( 0/*X*/, 280/*Y*/, GetScreenWidth(), 40/*Height*/ ); DrawScreenString( 100, 300, "Initialised and waiting for SPACE", 0x0, NULL ); SetNextUpdateRect( 0/*X*/, 280/*Y*/, GetScreenWidth(), 40/*Height*/ ); break; case stateMain: CopyBackgroundPixels( 0/*X*/, 0/*Y*/, GetScreenWidth(), 30/*Height*/ ); DrawScreenString( 250, 10, "Running", 0xffffff, NULL ); SetNextUpdateRect( 0/*X*/, 0/*Y*/, GetScreenWidth(), 30/*Height*/ ); break; case statePaused: CopyBackgroundPixels( 0/*X*/, 280/*Y*/, GetScreenWidth(), 40/*Height*/ ); DrawScreenString( 200, 300, "Paused. Press SPACE to continue", 0xffffff, NULL ); SetNextUpdateRect( 0/*X*/, 280/*Y*/, GetScreenWidth(), 40/*Height*/ ); break; } }
/* Redraw the background over where you are drawing the strings.*/ void SimpleDemo::UnDrawStrings() { // Clear the top of the screen, since we about to draw text on it. CopyBackgroundPixels(0, 0, GetScreenWidth(), 70); }
/* Draw text labels */ void BouncingBallMain::DrawStrings() { CopyBackgroundPixels( 0/*X*/, 0/*Y*/, GetScreenWidth(), 30/*Height*/ ); DrawScreenString( 150, 10, "Example text", 0xffffff, NULL ); }
/* Draw text labels */ void Demo3Main::DrawStrings() { CopyBackgroundPixels( 0/*X*/, 0/*Y*/, GetScreenWidth(), 30/*Height*/ ); DrawScreenString( 150, 10, "Tile placement example", 0xffffff, NULL ); }
/* Draw text labels */ void Demo2Main::DrawStrings() { CopyBackgroundPixels( 0/*X*/, 0/*Y*/, GetScreenWidth(), 30/*Height*/ ); DrawScreenString( 150, 10, "Example text", 0xffffff, NULL ); SetNextUpdateRect( 0/*X*/, 0/*Y*/, GetScreenWidth(), 30/*Height*/ ); }