Forums

OverviewV-Play 1 SupportChange Sprite's "loop" property at runtime? › Reply To: Change Sprite's "loop" property at runtime?

OverviewV-Play 1 SupportChange Sprite's "loop" property at runtime? › Reply To: Change Sprite's "loop" property at runtime?
#6076

Christian
V-Play Team

Yep, it’s working!

Thanks for the help, this is going to be awesome 😉

PS: Here’s my solution:

Part of the sprite sequence:

        RollingSprite {
            id: rolling
            name: "rolling"
            nextAnimName: canStandUp() ? rolling2.name : running.name

        }

          RollingSprite {
            id: rolling2
            name: "rolling2"
            nextAnimName: canStandUp() ? rolling.name : running.name
        }

RollingSprite.qml

Sprite {
    id: rolling
    property string nextAnimName

    frameNames: ["rolling02.png","rolling03.png","rolling04.png","rolling05.png","rolling06.png","rolling07.png","rolling08.png","rolling09.png","rolling10.png","rolling11.png","rolling12.png","rolling13.png","rolling14.png","rolling15.png","rolling16.png","rolling17.png"]
    frameRate: 20
    mirrorX: !player.walkDirection
    loop: false

    onAnimationFinished: {
        sequence.jumpTo(nextAnimName)
    }

}

 

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support