BaseMenuScreen::BaseMenuScreen(const SmashData&smashData) { AssetManager* assetManager = smashData.getMenuData()->getAssetManager(); img_headerbar_small = assetManager->getTexture("elements/headerbar_small.png"); img_headerbar_full = assetManager->getTexture("elements/headerbar_full.png"); hoverPulseScale = 1; hoverPulseGrowing = true; hoverPulseEnabled = false; hoverPressed = false; ScreenElement* element = getElement(); backgroundElement = new ImageElement(assetManager->getTexture("backgrounds/main.png"), ImageElement::DISPLAY_ZOOM); backgroundElement->setLayoutRule(LAYOUTRULE_LEFT, 0, LAYOUTVALUE_RATIO); backgroundElement->setLayoutRule(LAYOUTRULE_TOP, 0, LAYOUTVALUE_RATIO); backgroundElement->setLayoutRule(LAYOUTRULE_RIGHT, 1, LAYOUTVALUE_RATIO); backgroundElement->setLayoutRule(LAYOUTRULE_BOTTOM, 1, LAYOUTVALUE_RATIO); element->addChildElement(backgroundElement); headerbarElement = new ImageElement(img_headerbar_full, ImageElement::DISPLAY_ZOOM); headerbarElement->setLayoutRule(LAYOUTRULE_LEFT, 0.0, LAYOUTVALUE_RATIO); headerbarElement->setLayoutRule(LAYOUTRULE_TOP, 0.0, LAYOUTVALUE_RATIO); headerbarElement->setLayoutRule(LAYOUTRULE_RIGHT, 1.0, LAYOUTVALUE_RATIO); headerbarElement->setLayoutRule(LAYOUTRULE_BOTTOM, 0.134, LAYOUTVALUE_RATIO); element->addChildElement(headerbarElement); element->sendChildElementToBack(headerbarElement); element->sendChildElementToBack(backgroundElement); backButton = (SpriteActor*)getItem(addItem(RectD(0, 0, 0.145, 0.145), new Animation(1, assetManager, "buttons/back.png"))); }
void Terrain::load( std::string name ) { std::string pathPrefix = "terrain/" + name + "/"; AssetManager* assetManager = AssetManager::get(); mTexture = assetManager->getTexture( pathPrefix + "texture.png" ); mMaskTexture = assetManager->getTexture( pathPrefix + "mask.png" ); std::string edgePathPrefix = pathPrefix + "edge/"; mEdgeMeshes[ BlockMeshCenter ] = assetManager->getVboMesh( edgePathPrefix + "center.obj" ); mEdgeMeshes[ BlockMeshWall ] = assetManager->getVboMesh( edgePathPrefix + "wall.obj" ); mEdgeMeshes[ BlockMeshCorner ] = assetManager->getVboMesh( edgePathPrefix + "corner.obj" ); mEdgeMeshes[ BlockMeshInnerCorner ] = assetManager->getVboMesh( edgePathPrefix + "inner_corner.obj" ); mEdgeMeshes[ BlockMeshBridge ] = assetManager->getVboMesh( edgePathPrefix + "bridge.obj" ); mEdgeMeshes[ BlockMeshNone ] = NULL; std::string tilePathPrefix = pathPrefix + "tile/"; mTileMeshes[ BlockMeshCenter ] = assetManager->getVboMesh( tilePathPrefix + "center.obj" ); mTileMeshes[ BlockMeshWall ] = assetManager->getVboMesh( tilePathPrefix + "wall.obj" ); mTileMeshes[ BlockMeshCorner ] = assetManager->getVboMesh( tilePathPrefix + "corner.obj" ); mTileMeshes[ BlockMeshInnerCorner ] = assetManager->getVboMesh( tilePathPrefix + "inner_corner.obj" ); mTileMeshes[ BlockMeshBridge ] = assetManager->getVboMesh( tilePathPrefix + "bridge.obj" ); mTileMeshes[ BlockMeshNone ] = NULL; }
Block::Block( Game* game ) : mRotation( 0.0f ), mTerrain( NULL ), mGame( game ) { mNode = new Node(); mNode->colors[ MaterialSpecular ] = ColorA( 0, 0, 0, 0 ); AssetManager* assetManager = AssetManager::get(); tilePosition = Vec3f::zero(); mTextureOffset = Vec2i( 2, 3 ); mNode->scale = Vec3f::one() * kTileSize; setTerrainIndex( 0 ); mBlankMask = assetManager->getTexture( "textures/default_black.png" ); mTexturePaintMask = NULL; }