예제 #1
0
/* 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);
}
예제 #2
0
/* 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);
}
예제 #3
0
/* 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 );
}
예제 #4
0
/* 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*/ );
}
예제 #5
0
/* 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;
	}
}
예제 #6
0
/* Draw text labels */
void BouncingBallMain::DrawStrings()
{
	CopyBackgroundPixels( 0/*X*/, 0/*Y*/, GetScreenWidth(), 30/*Height*/ );
	DrawScreenString( 150, 10, "Example text", 0xffffff, NULL );
}
예제 #7
0
/* Draw text labels */
void Demo3Main::DrawStrings()
{
	CopyBackgroundPixels( 0/*X*/, 0/*Y*/, GetScreenWidth(), 30/*Height*/ );
	DrawScreenString( 150, 10, "Tile placement example", 0xffffff, NULL );
}
예제 #8
0
/* 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*/ );
}