Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - DemonRax

Pages: [1]
1
SFML wiki / Re: Animated Sprite class
« on: January 01, 2014, 05:08:50 pm »
Yeah, I'm not saying you should use my example :) That's just the modified version I made for myself. But I thought the bug is quite important.

Funny thing is - it works same way, because it uses m_currentFrame variable when calling  the function and then basically the value is there, so you don't really need internal newFrame :) But when I tried to setFrame manually it made me scratch my head for a while before I've noticed the mistype.

Looking forward for the extended class! Thanks!

2
SFML wiki / Re: Animated Sprite class
« on: December 27, 2013, 08:54:37 pm »
Hey Foaly.

Thanks for the class! Helped me a lot as a beginner :)

There's a mystype if AnimatedSprite.cpp here, should be with newFrame,:
void AnimatedSprite::setFrame(std::size_t newFrame, bool resetTime)
{
...
sf::IntRect rect = m_animation->getFrame(newFrame);
...
}

I also attached modified version with backwards loop added and the formentioned piece fixed, if you're interested. And I also changed it so it stops at the last frame, because I thought this is correct way. Don't know for sure though.

Pages: [1]