/* Draw the string that moving objects should be drawn on top of */ void SimpleDemo::DrawStringsUnderneath() { // Build the string to print char buf[128]; sprintf(buf, "Changing random %6d", rand() ); DrawScreenString(50, 10, buf, 0x00ffff, NULL); DrawScreenString(450, 10, "Underneath the objects", 0xff0000, NULL); }
/* Draw any string which should appear on top of moving objects - i.e. objects move behind these */ void SimpleDemo::DrawStringsOnTop() { // Build the string to print char buf[128]; sprintf(buf, "Time %6d", rand(), rand()); DrawScreenString(150, 40, buf, 0xff00ff, NULL); DrawScreenString(450, 40, "On top of the objects", 0x00ff00, 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 ); }
/* 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; } }
/* 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*/ ); }