本文整理汇总了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 );