// Called after our constructor is called void SceneSample::setup() { // Set our virtual camera width to be 320 // This means that the width of the view will be 320 camera->setCameraWidth( 320.0f ); { CCTile3DButton *tile = new CCTile3DButton( this, // Pass in this scene 100.0f, // Specify the width of the tile "Resources/f7u12_derp.png" ); // Texture to load } { CCTile3DButton *tile = new CCTile3DButton( this, // Pass in this scene 100.0f, // Specify the width of the tile "Resources/f7u12_troll.png" ); // Texture to load tile->translate( 0.0f, tile->collisionBoundsLength.y, 0.0f ); } // refresh the scene range refreshCameraView(); }
void SceneSplashScreen::setup() { CCText texPath = "Resources/"; texPath += CLIENT_NAME; texPath += "/uimenu/ui_background.png"; const float backgroundWidth = gEngine->textureManager->getTexture( texPath.buffer )->getRawWidth(); camera->setCameraWidth( backgroundWidth, false ); { CCTile3DButton *tile = new CCTile3DButton( this ); tile->setupTextured( "Resources/common/uimenu/ui_vs_whitestripe.png", Resource_Packaged, true ); tile->setTileScale( 1.0f ); tileWhiteStripe = tile; tile->shouldRender = false; } { { CCTile3DButton *tile = new CCTile3DButton( this ); tile->setupTextured( "Resources/common/uimenu/ui_vs_bluestripe.png", Resource_Packaged, true ); tile->setTileScale( 1.0f ); tile->positionTileAbove( tileWhiteStripe ); tile->drawOrder = 201; tileBlueStripe = tile; tile->translate( camera->targetWidth, 0.0f, 0.0f ); { CCTile3DButton *tile = new CCTile3DButton( this ); tile->setupTextured( "Resources/common/uimenu/ui_vs_whitestripe.png", Resource_Packaged, true ); tile->setTileScale( 1.0f ); tile->drawOrder = 202; tile->translate( 0.0f, ( tileBlueStripe->collisionBounds.y + tile->collisionBounds.y ), 0.0f ); tile->removeFromScene(); tileBlueStripe->addChild( tile ); } { CCTile3DButton *tile = new CCTile3DButton( this ); tile->setupTextured( "Resources/common/uimenu/ui_vs_whitestripe.png", Resource_Packaged, true ); tile->setTileScale( 1.0f ); tile->drawOrder = 203; tile->translate( 0.0f, -( tileBlueStripe->collisionBounds.y + tile->collisionBounds.y ), 0.0f ); tile->removeFromScene(); tileBlueStripe->addChild( tile ); } } } { { CCTile3DButton *tile = new CCTile3DButton( this ); tile->setupTextured( "Resources/common/uimenu/ui_vs_redstripe.png", Resource_Packaged, true ); tile->setTileScale( 1.0f ); tile->positionTileBelow( tileWhiteStripe ); tile->drawOrder = 201; tileRedStripe = tile; tile->translate( -camera->targetWidth, 0.0f, 0.0f ); { CCTile3DButton *tile = new CCTile3DButton( this ); tile->setupTextured( "Resources/common/uimenu/ui_vs_whitestripe.png", Resource_Packaged, true ); tile->setTileScale( 1.0f ); tile->drawOrder = 203; tile->translate( 0.0f, ( tileRedStripe->collisionBounds.y + tile->collisionBounds.y ), 0.0f ); tile->removeFromScene(); tileRedStripe->addChild( tile ); } { CCTile3DButton *tile = new CCTile3DButton( this ); tile->setupTextured( "Resources/common/uimenu/ui_vs_whitestripe.png", Resource_Packaged, true ); tile->setTileScale( 1.0f ); tile->drawOrder = 202; tile->translate( 0.0f, -( tileRedStripe->collisionBounds.y + tile->collisionBounds.y ), 0.0f ); tile->removeFromScene(); tileRedStripe->addChild( tile ); } } } { CCTile3DButton *tile = new CCTile3DButton( this ); tile->setTileScale( 1.0f ); tile->drawOrder = 203; tilePlayer1 = tile; } { CCTile3DButton *tile = new CCTile3DButton( this ); tile->setTileScale( 1.0f ); tile->drawOrder = 204; tilePlayer2 = tile; } { CCTile3DButton *tile = new CCTile3DButton( this ); tile->setTileScale( 1.0f ); tile->drawOrder = 203; tileCountry1 = tile; } { CCTile3DButton *tile = new CCTile3DButton( this ); tile->setTileScale( 1.0f ); tile->drawOrder = 204; tileCountry2 = tile; } { CCTile3DButton *tile = new CCTile3DButton( this ); tile->setupTextured( "Resources/common/uimenu/ui_vs.png", Resource_Packaged, true ); tile->setTileScale( 1.0f ); tile->drawOrder = 205; tileVS = tile; } refreshCameraView(); lockCameraView(); }