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


C++ AnimatedSprite::addImage方法代码示例

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


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

示例1: main


//.........这里部分代码省略.........
            sf::Color(255,255,255)
        };
        for(int i=0;i<9;i++) {
            const char *s = texts[i].c_str();
            for(int j=0;j<(int)strlen(s);j++) {
                wrap.feed( FormattedCharacter( myFtFont, colours[i], (uint32_t) s[j] ) );
            }
        }
        wrap.end();

        textPopup = rr.createImage();
    }

    // The radial HexMap shape is actually incredibly unsuitable
    // for this map shape. Radial was of course written with other
    // applications in mind (e.g. a scrollable game map where
    // rectangularity is just awkward).
    HexMap<MyTile> myMap( 11 );
    myMap.getDefault().tileType = MyTile::OFF_MAP;
    for(int i=-6;i<=6;i++) for(int j=-6;j<=6;j++) {
        int x = i * 3, y = 2 * j + i;
        MyTile::MyColour type = MyTile::NEUTRAL;
        if( abs(i) == 6 && abs(j) == 6 ) {
            continue;
        }
        if( abs(i) == 6 ) type = MyTile::WHITE_EDGE;
        if( abs(j) == 6 ) type = MyTile::BLACK_EDGE;
        myMap.get(x,y).tileType = type;
    }
    myMap.get(-18,6).tileType = MyTile::BLACKWHITE_EDGE;
    myMap.get(18,-6).tileType = MyTile::WHITEBLACK_EDGE;

    AnimatedSprite kittenBlink ( 1.0, true );
    kittenBlink.addImage( kittenImage );
    kittenBlink.addImage( kittenRednoseImage );
    kittenBlink.SetColor( sf::Color(255,255,255,225) );

    sf::Sprite textSprite;
    textSprite.SetImage( *textPopup );

    sf::Shape textBackgroundBox;

    bool kittenMode = false;

    HexTorusGoMap myTorusMap(5);
    myTorusMap.debugLabelCore();

    MyHexBlitter blitter (grid, hexSprites, myMap, myTorusMap);

    HtGoTile::TileState myCurrentColour = HtGoTile::BLACK;

    win.SetFramerateLimit( 60 );
    win.UseVerticalSync( true );

    sf::Sound failSound( soundBuffers["fail-sound"] );

    ChatInputLine *chatInput = 0;

    while( win.IsOpened() ) {
        using namespace std;

        sf::Event ev;
        const double dt = clock.GetElapsedTime();
        clock.Reset();

        kittenBlink.animate( dt );
开发者ID:svk,项目名称:fto-engine,代码行数:67,代码来源:test-hexfml.cpp


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