Example #1
0
void ParticleScene::Resize()
{
//	LumosGame* lumosGame = static_cast<LumosGame*>( game );
	PositionStd( &okay, 0 );

	LayoutCalculator layout = DefaultLayout();
	layout.SetSize( LAYOUT_SIZE_X*0.75f, LAYOUT_SIZE_Y*0.5f );
	int x=0;
	int y=1;
	for( int i=0; i<buttonArr.Size(); ++i ) {
		layout.PosAbs( buttonArr[i], x*2, y );
		++x;
		if ( x == 6 ) {
			++y; x = 0;
		}
	}
}
Example #2
0
void TitleScene::Resize()
{
	const Screenport& port = game->GetScreenport();

	// Dowside of a local Engine: need to resize it.
	if (engine) {
		engine->GetScreenportMutable()->Resize(port.PhysicalWidth(), port.PhysicalHeight());
		for (int i = 0; i < NUM_MODELS; ++i) {
			if (model[i])
				model[i]->SetFlag(Model::MODEL_INVISIBLE);
		}
	}
	background.SetPos( 0, 0 );

	float aspect = gamui2D.AspectRatio();
	float factor = 0.5;
	if ( aspect >= 0.5f ) {
		background.SetSize(gamui2D.Width()*factor, gamui2D.Width()*0.5f*factor);
	}
	else {
		background.SetSize(gamui2D.Height()*2.0f*factor, gamui2D.Height()*factor);
	}
	background.SetCenterPos(gamui2D.Width()*0.5f, gamui2D.Height()*0.5f*factor);

	bool visible = game->GetDebugUI();
	LayoutCalculator layout = DefaultLayout();
	int c = 0;
	for( int i=0; i<NUM_TESTS; ++i ) {
		testScene[i].SetVisible( visible );

		int y = c / TESTS_PER_ROW;
		int x = c - y*TESTS_PER_ROW;
		layout.PosAbs( &testScene[i], x, y );
		++c;
	}
	layout.SetSize( LAYOUT_SIZE_X, LAYOUT_SIZE_Y );

	layout.PosAbs(&gameScene[GENERATE_WORLD], -2, -1, 2, 1);
	layout.PosAbs(&gameScene[CONTINUE], 0, -1, 2, 1);

	gameScene[CONTINUE].SetEnabled( false );
//	const char* datPath = game->GamePath( "game", 0, "dat" );
	const char* mapPath = game->GamePath( "map",  0, "dat" );

	GLString fullpath;
	GetSystemPath(GAME_SAVE_DIR, mapPath, &fullpath);
	FILE* fp = fopen(fullpath.c_str(), "rb");
	if (fp) {
		StreamReader reader(fp);
		if (reader.Version() == CURRENT_FILE_VERSION) {
			gameScene[CONTINUE].SetEnabled(true);
		}
		fclose(fp);
	}

	layout.PosAbs( &note, 0, -2 );
	note.SetVisible(!visible);
	note.SetBounds( gamui2D.Width() -(layout.GutterX() * 2.0f), 0 );

	layout.PosAbs(&audioButton, -1, 0);
	layout.PosAbs(&mouseTouchButton, -2, 0);
	layout.PosAbs(&creditsButton, -3, 0);

	testCanvas.SetPos(gamui2D.Width() - 100, gamui2D.Height() - 100);
	testCanvas.SetVisible(false);
}