当前位置: 首页>>代码示例>>C++>>正文


C++ ImageManager::getTexture方法代码示例

本文整理汇总了C++中ImageManager::getTexture方法的典型用法代码示例。如果您正苦于以下问题:C++ ImageManager::getTexture方法的具体用法?C++ ImageManager::getTexture怎么用?C++ ImageManager::getTexture使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ImageManager的用法示例。


在下文中一共展示了ImageManager::getTexture方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: init

/** \brief Initialize textures and sprites
 *
 * \return void
 *
 */
void SplashScreen::init()
{
    ImageManager* im = Locator::getImageManager();
    _splashTexture = im->getTexture(IMAGES_PATH"splashscreen.png");
    assert(_splashTexture != NULL);

    _splash.setTexture(*_splashTexture, true);
}
开发者ID:YoruNoHikage,项目名称:CaSFML-Defender,代码行数:13,代码来源:splashscreen.cpp

示例2: init

void GameOver::init()
{
    ImageManager* im = Locator::getImageManager();
    _texture = im->getTexture(IMAGES_PATH"gameover.png");
    assert(_texture != NULL);

    _sprite.setTexture(*_texture, true);
}
开发者ID:YoruNoHikage,项目名称:CaSFML-Defender,代码行数:8,代码来源:GameOver.cpp

示例3: initInterface

void UserInterface::initInterface(Screen newScreen, ImageManager& imageManager)
{
    // Clearing the previous UI elements
    elements.clear();

    // Updating the screenstate
    screenState = newScreen;

    // Populating the screen based on the input
    switch(newScreen)
    {
    case Screen::TITLE:
        elements["exitButton"] = InterfaceElement(resolution.x - 150, resolution.y - 50,"exit",font,10,10);
        elements["exitButton"].sprite.setTexture(imageManager.getTexture("button"));

        elements["startButton"] = InterfaceElement(50,resolution.y - 50,"start",font,10,10);
        elements["startButton"].sprite.setTexture(imageManager.getTexture("button"));

        elements["titleText"] = InterfaceElement(resolution.x / 2 - 150, 50, "BoulderDash",font,0,0);
        backgroundSprite.setTexture(imageManager.getTexture("titleBG"));
        break;

    case Screen::PLAY:
        elements["livesText"] = InterfaceElement(0,0,"",font,64,0,true);
        elements["livesText"].headerText.setColor(sf::Color::Transparent);

        elements["diamondsText"] = InterfaceElement(0,0,"",font,64,0,true);
        elements["diamondsText"].headerText.setColor(sf::Color::Transparent);
        backgroundSprite.setTexture(sf::Texture());
        break;

    case Screen::GAMEOVER:
        elements["endText"] = InterfaceElement(resolution.x / 2 - 150, 50, "Game Over",font,0,0);
        backgroundSprite.setTexture(imageManager.getTexture("endBG"));
        break;

    case Screen::WIN:
        elements["winText"] = InterfaceElement(resolution.x / 2 - 150, 50, "Congratulations!",font,0,0);
        elements["winText"].headerText.setColor(sf::Color::Green);
        backgroundSprite.setTexture(imageManager.getTexture("titleBG"));
    }
}
开发者ID:Xemerau,项目名称:Boulderdash,代码行数:42,代码来源:UserInterface.cpp


注:本文中的ImageManager::getTexture方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。