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 - mguerriero

Pages: [1]
1
SFML projects / Re: Thor 2.0
« on: June 11, 2012, 10:27:01 pm »
Nexus can you implement the function isAnimating() in Animator? It should return bool and should be used to know if there is an animation in progress or not

2
General / Re: Thor Animations, moving sprite
« on: June 11, 2012, 10:25:55 pm »
I fixed adding a "animator.stopAnimation ();" in each KeyReleased events

3
General / Re: Thor Animations, moving sprite
« on: June 11, 2012, 04:01:24 pm »
No, wait! It didn't really solve my problem. I do this
bool right = true;
   
    // Clock
    sf::Time time = frameClock.getElapsedTime();
    float elapsed_time = time.asSeconds();
   
    switch (event.type)
        {
                case sf::Event::KeyPressed:
                    if (event.key.code == sf::Keyboard::Right)
                    {      
                if (right)
                {
                    animator.update(frameClock.restart());
                    animator.playAnimation("move_right", true);
                    right = false;
                }
                move(15 * elapsed_time, 0);
                    }
                break;
               
                case sf::Event::KeyReleased:
                    if (event.key.code == sf::Keyboard::Right)
                    {
                right = true;
                    }
                break;
        }
and the animation is stopped when the Sprite starts the transition. animator is a "thor::Animator<sf::Sprite, std::string>"

4
General / Re: Thor Animations, moving sprite
« on: June 11, 2012, 03:44:30 pm »
Oh ok, I solved using a KeyReleased event! Thank you very much :)

5
General / Thor Animations, moving sprite
« on: June 11, 2012, 12:54:54 pm »
Hi, I' m using the animation example in Thor's source code (https://github.com/Bromeon/Thor/blob/master/examples/Animation.cpp) and, when I try to move the sprite, the animation automatically stops!

If I put at line 69 of the example this:
case sf::Keyboard::D:
                animator.playAnimation("drive", true);
                sprite.move(100, 0);
                break;

the sprite is moved but during the transiction the animation is stopped. Can anyone help me having an animated transiction?

6
SFML projects / Re: Thor 2.0
« on: June 10, 2012, 08:54:14 am »
ok thanks, I forgot to add C++11 flag

7
SFML projects / Re: Thor 2.0
« on: June 09, 2012, 07:31:49 pm »
Hi Nexus, this is my first post here and I'd like to know a thing about Thor and SFML.

I installed SFML 2.0 and the latest Thor from git. The installation of the two libs went well but when I try to compile some files using Thor I get the following errors
In file included from /usr/local/include/Thor/Animation.hpp:32:0,
                 from /home/mario/revenge/revenge-test/src/Character.cpp:1:
/usr/local/include/Thor/Animation/Animator.hpp:59:11: error: ‘function’ in namespace ‘std’ does not name a type
/usr/local/include/Thor/Animation/Animator.hpp:73:46: error: ‘AnimationFunction’ does not name a type
/usr/local/include/Thor/Animation/Animator.hpp:99:39: error: ‘AnimationFunction’ does not name a type
/usr/local/include/Thor/Animation/Animator.hpp:105:21: error: ‘AnimationFunction’ was not declared in this scope
/usr/local/include/Thor/Animation/Animator.hpp:105:48: error: template argument 1 is invalid
In file included from /usr/local/include/Thor/Animation/Animator.hpp:129:0,
                 from /usr/local/include/Thor/Animation.hpp:32,
                 from /home/mario/revenge/revenge-test/src/Character.cpp:1:
/usr/local/include/Thor/Animation/Detail/Animator.inl: In constructor ‘thor::Animator<Animated, Id>::Animator()’:
/usr/local/include/Thor/Animation/Detail/Animator.inl:35:21: error: ‘nullptr’ was not declared in this scope
/usr/local/include/Thor/Animation/Detail/Animator.inl: At global scope:
/usr/local/include/Thor/Animation/Detail/Animator.inl:43:63: error: ‘AnimationFunction’ does not name a type
/usr/local/include/Thor/Animation/Detail/Animator.inl: In member function ‘void thor::Animator<Animated, Id>::stopAnimation()’:
/usr/local/include/Thor/Animation/Detail/Animator.inl:62:24: error: request for member ‘first’ in ‘((thor::Animator<Animated, Id>*)this)->thor::Animator<Animated, Id>::mDefaultAnimation’, which is of non-class type ‘thor::Animator<Animated, Id>::ScaledAnimation {aka int}’
/usr/local/include/Thor/Animation/Detail/Animator.inl:65:23: error: ‘nullptr’ was not declared in this scope
/usr/local/include/Thor/Animation/Detail/Animator.inl: In member function ‘void thor::Animator<Animated, Id>::update(sf::Time)’:
/usr/local/include/Thor/Animation/Detail/Animator.inl:76:51: error: request for member ‘second’ in ‘((thor::Animator<Animated, Id>*)this)->thor::Animator<Animated, Id>::mPlayingAnimation->’, which is of non-class type ‘const ScaledAnimation {aka const int}’
/usr/local/include/Thor/Animation/Detail/Animator.inl: In member function ‘void thor::Animator<Animated, Id>::animate(Animated&) const’:
/usr/local/include/Thor/Animation/Detail/Animator.inl:93:22: error: request for member ‘first’ in ‘((const thor::Animator<Animated, Id>*)this)->thor::Animator<Animated, Id>::mPlayingAnimation->’, which is of non-class type ‘const ScaledAnimation {aka const int}’
/usr/local/include/Thor/Animation/Detail/Animator.inl: At global scope:
/usr/local/include/Thor/Animation/Detail/Animator.inl:105:56: error: ‘AnimationFunction’ does not name a type
/usr/local/include/Thor/Animation/Detail/Animator.inl: In member function ‘void thor::Animator<Animated, Id>::setDefaultAnimation(const int&, sf::Time)’:
/usr/local/include/Thor/Animation/Detail/Animator.inl:109:23: error: ‘nullptr’ was not declared in this scope
/usr/local/include/Thor/Animation/Detail/Animator.inl:112:20: error: request for member ‘first’ in ‘((thor::Animator<Animated, Id>*)this)->thor::Animator<Animated, Id>::mDefaultAnimation’, which is of non-class type ‘thor::Animator<Animated, Id>::ScaledAnimation {aka int}’
/usr/local/include/Thor/Animation/Detail/Animator.inl:113:20: error: request for member ‘second’ in ‘((thor::Animator<Animated, Id>*)this)->thor::Animator<Animated, Id>::mDefaultAnimation’, which is of non-class type ‘thor::Animator<Animated, Id>::ScaledAnimation {aka int}’
I am on Ubuntu 12.04 and I use gcc 4.6.3 to compile. Can you help me solve this problem?

Pages: [1]
anything