本文整理汇总了C++中sf::Music::getDuration方法的典型用法代码示例。如果您正苦于以下问题:C++ Music::getDuration方法的具体用法?C++ Music::getDuration怎么用?C++ Music::getDuration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sf::Music
的用法示例。
在下文中一共展示了Music::getDuration方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetDurationInSeconds
float32 Music::GetDurationInSeconds()
{ return music.getDuration().asSeconds(); }
示例2: while
int screen_1::Run(sf::RenderWindow &App)
{
hop.setBuffer(hopFile);
trucked.setBuffer(truckedFile);
dunked.setBuffer(dunkedFile);
// Clock
sf:: Clock clock;
sf::Time time;
sf::Time delay;
// Plays Intro
intro.play();
delay = intro.getDuration();
time = clock.getElapsedTime();
// Music
while ( clock.getElapsedTime() <= delay )
{
//cout << "NO";
}
froggerTheme.setVolume(50);
froggerTheme.play();
clock.restart();
sf::Event Event;
bool Running = true;
int sum = 0;// for log testing purposes
int sum2 = 0;
int sum3 = 0;
int sum4 = 0;
int sum5 = 0;
int sum6 = 0;
int sum7 = 0;
int sum8 = 0;
int sum9 = 0;
int sum10 = 0;
while (Running)
{
// Timer Rect and Clock
double time = clock.getElapsedTime().asSeconds();
if(time >= 1.5)
{
timeRect.width = timeRect.width - 2.383;
timer.setTextureRect(timeRect);
clock.restart();
}
if(timeRect.width <= 0)
{
frogOnLily1 = false;
frogOnLily2 = false;
frogOnLily3 = false;
frogOnLily4 = false;
frogOnLily5 = false;
mainPlayer.setNumLives(3);
rectSource.width = 115;
life.setTextureRect(rectSource);
occupied1.setPosition(-100, -100);
occupied2.setPosition(-100, -100);
occupied3.setPosition(-100, -100);
occupied4.setPosition(-100, -100);
occupied5.setPosition(-100, -100);
froggerTheme.pause();
clock.restart();
timeRect.width = 143;
timer.setTextureRect(timeRect);
frogger.setPosition(320, 605);
return 2;
}
// *********************************************************************
// Creating the objects of Object class for continuous movement
//
// Object(double posX, double posY, double speed)
// *********************************************************************
// Trucks
Object t1(130, 420,0.2 );
Object t2(550, 290, 0.2);
// Cars
Object c1(-50, 420, 0.3);
Object c2(280, 289, 0.2);
Object c3(0, 289, 0.2);
// Short Logs
Object sl1(0, 125, 0.2);
Object sl2(200, 61, 0.3);
Object sl3(300, 8, 0.4);
// Long Logs
Object l1(799, 8.3, 0.4);
Object l2(500, 125, 0.2);
// Sets object's direction
t1.moveRight(truck);
t2.moveLeft(truck2);
c1.moveRight(car);
c2.moveLeft(car2);
c3.moveLeft(car3);
//.........这里部分代码省略.........