本文整理汇总了C++中AssetManager::getTexture方法的典型用法代码示例。如果您正苦于以下问题:C++ AssetManager::getTexture方法的具体用法?C++ AssetManager::getTexture怎么用?C++ AssetManager::getTexture使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AssetManager
的用法示例。
在下文中一共展示了AssetManager::getTexture方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getElement
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")));
}
示例2: load
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;
}
示例3: mRotation
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;
}