本文整理汇总了C++中AnimatedSprite::animate方法的典型用法代码示例。如果您正苦于以下问题:C++ AnimatedSprite::animate方法的具体用法?C++ AnimatedSprite::animate怎么用?C++ AnimatedSprite::animate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnimatedSprite
的用法示例。
在下文中一共展示了AnimatedSprite::animate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
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 );
while( win.GetEvent( ev ) ) switch( ev.Type ) {
case sf::Event::Resized:
chatbox.resize( win.GetWidth(), 200 );
viewport.setRectangle( 0,
0,
(ev.Size.Width),
(ev.Size.Height - chatbox.getHeight()) );
chatbox.setPosition( 0, win.GetHeight() - chatbox.getHeight() );
if( chatInput ) {
chatInput->setWidth( win.GetWidth() );
}
mainView.SetHalfSize( sf::Vector2f( ev.Size.Width / 2, ev.Size.Height / 2 ) );
break;
case sf::Event::Closed:
win.Close();
break;
case sf::Event::TextEntered:
if( chatInput ) {
chatInput->textEntered( ev.Text.Unicode );
if( chatInput->isDone() ) {
std::string chatline = chatInput->getString();
chatbox.add( ChatLine( "user", red,
chatline, white ) );
delete chatInput;
chatInput = 0;
}
}
break;
case sf::Event::KeyPressed:
if( chatInput ) {