本文整理汇总了C++中gd::Project::GetImageManager方法的典型用法代码示例。如果您正苦于以下问题:C++ Project::GetImageManager方法的具体用法?C++ Project::GetImageManager怎么用?C++ Project::GetImageManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gd::Project
的用法示例。
在下文中一共展示了Project::GetImageManager方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadResources
void TileSet::LoadResources(gd::Project &game)
{
try
{
gd::ImageResource & image = dynamic_cast<gd::ImageResource&>(game.GetResourcesManager().GetResource(textureName));
//Load the resource into a wxBitmap (IDE only) and also get its SFMLTextureWrapper
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
//Force to change the working directory to make it work
wxString oldWorkingDir = wxGetCwd();
wxSetWorkingDirectory(wxFileName::FileName(game.GetProjectFile()).GetPath());
#endif
m_tilesetTexture = game.GetImageManager()->GetSFMLTexture(textureName);
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
wxSetWorkingDirectory(oldWorkingDir);
if ( wxFileExists(image.GetAbsoluteFile(game)) )
{
m_tilesetBitmap.LoadFile(image.GetAbsoluteFile(game), wxBITMAP_TYPE_ANY);
}
#endif
//Readjust the m_collidable std::vector according to the number of tiles
m_collidable.resize(GetTilesCount(), true);
}
catch(...)
{
m_tilesetTexture = std::shared_ptr<SFMLTextureWrapper>();
}
}
示例2: LoadResources
void TileSet::LoadResources(gd::Project &game)
{
m_dirty = true;
if(game.GetResourcesManager().HasResource(textureName))
{
gd::ImageResource & image = dynamic_cast<gd::ImageResource&>(game.GetResourcesManager().GetResource(textureName));
//Load the resource into a wxBitmap (IDE only) and also get its SFMLTextureWrapper
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
//Force to change the working directory to make it work
wxString oldWorkingDir = wxGetCwd();
wxSetWorkingDirectory(wxFileName::FileName(game.GetProjectFile()).GetPath());
#endif
m_tilesetTexture = game.GetImageManager()->GetSFMLTexture(textureName);
#if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
wxSetWorkingDirectory(oldWorkingDir);
if ( wxFileExists(image.GetAbsoluteFile(game)) )
{
wxBitmap bmp( image.GetAbsoluteFile(game), wxBITMAP_TYPE_ANY);
m_tilesetBitmap = bmp;
}
#endif
}
else
{
m_tilesetTexture = std::shared_ptr<SFMLTextureWrapper>();
}
}
示例3:
void Box3DObject::LoadResources(gd::Project & project, gd::Layout & layout)
{
frontTexture = project.GetImageManager()->GetSFMLTexture(frontTextureName);
topTexture = project.GetImageManager()->GetSFMLTexture(topTextureName);
bottomTexture = project.GetImageManager()->GetSFMLTexture(bottomTextureName) ;
leftTexture = project.GetImageManager()->GetSFMLTexture(leftTextureName);
rightTexture = project.GetImageManager()->GetSFMLTexture(rightTextureName);
backTexture = project.GetImageManager()->GetSFMLTexture(backTextureName);
}
示例4: LoadResources
void SpriteObject::LoadResources(gd::Project & project, gd::Layout & layout)
{
for ( std::size_t j = 0; j < animations.size();j++ )
{
Animation & anim = animations[j];
for ( std::size_t k = 0;k < anim.GetDirectionsCount();k++ )
{
for ( std::size_t l = 0;l < anim.GetDirection(k).GetSpritesCount();l++ )
{
Sprite & sprite = anim.GetDirection(k).GetSprite(l);
sprite.LoadImage(project.GetImageManager()->GetSFMLTexture(sprite.GetImageName()));
}
}
}
}
示例5: LoadResources
void TiledSpriteObject::LoadResources(gd::Project & project, gd::Layout & layout)
{
texture = project.GetImageManager()->GetSFMLTexture(textureName);
}