本文整理汇总了C++中ImageManager::Get方法的典型用法代码示例。如果您正苦于以下问题:C++ ImageManager::Get方法的具体用法?C++ ImageManager::Get怎么用?C++ ImageManager::Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageManager
的用法示例。
在下文中一共展示了ImageManager::Get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ArenaDocument
TileMap::TileMap(string sourceFile, ImageManager &ImageManager_)
{
//Load the XML source file.
string str = "Data/Arenas/";
str = str + sourceFile;
TiXmlDocument ArenaDocument(str.c_str());
if(!ArenaDocument.LoadFile())
{
cerr<<"Error while loading "<<sourceFile<<endl;
cerr<<ArenaDocument.ErrorDesc()<<endl;
}
TiXmlHandle ArenaHandle(&ArenaDocument);
//Load the tile set.
TiXmlNode* TileSetNode = ArenaHandle.FirstChild("Arena").FirstChild("TileSet").ToNode();
TiXmlElement* TileElement = NULL;
while(TileSetNode->IterateChildren("Tile", TileElement) != NULL)
{
TileElement = TileSetNode->IterateChildren("Tile", TileElement)->ToElement();
str = "Data/Tiles/";
str = str + TileElement->Attribute("file");
TileSet.push_back(Tile(ImageManager_.Get(str)));
TileSet.back().sourceFile = str;
if(strcmp(TileElement->Attribute("isBlockingCharacters"),"true") == 0)
{
TileSet.back().blocksCharacters = true;
}
else
TileSet.back().blocksCharacters = false;
if(strcmp(TileElement->Attribute("isBlockingSpells"), "true") == 0)
TileSet.back().blocksSpells = true;
else
TileSet.back().blocksSpells = false;
}
//Load the tile map.
TiXmlNode* MapNode = ArenaHandle.FirstChildElement("Arena").FirstChild("Map").ToNode();
TiXmlElement* Line = NULL;
string tileLine;
int temp;
while(MapNode->IterateChildren("Line", Line) != NULL)
{
Line = MapNode->IterateChildren("Line", Line)->ToElement();
tileLine = Line->Attribute("TileLine");
Tiles.push_back(vector<int>(tileLine.size()));
for(int i=0; i<tileLine.size(); i++)
{
temp = tileLine.c_str()[i] - '0';
Tiles.back()[i] = temp;
}
}
}
示例2:
Teleportation::Teleportation(Vector2f Position, ImageManager& ImageManager_)
{
this->SetImage(*ImageManager_.Get("Data/Spells/SpeedBuff.png"));
this->SetPosition(Position);
timeLeft = 50;
}