Forums

OverviewV-Play 2 Support (Qt 5)How to set the scale for sprites in sequence › Reply To: How to set the scale for sprites in sequence

OverviewV-Play 2 Support (Qt 5)How to set the scale for sprites in sequence › Reply To: How to set the scale for sprites in sequence
#9628

Sam

Thanks for response. Depends on your answer and the result I got from, it seems your documentation is out of date, because there isn’t any refer to the scale property. Now I found two other problems, first, the animation is flicking on the screen and second, the wrong position they get. But when I use a simple image, there is no problem with that. Here is my code:

 

import VPlay 2.0
import QtQuick 2.0

GameWindow {
    id: gameWindow
    activeScene: mainScene
    width: 960
    height: 640

    Scene {
        id: mainScene
        width: 480
        height: 320

        Rectangle {
            id: rectangle
            anchors.fill: parent
            color: "black"

            Flow {
              anchors.fill: parent
              anchors.margins: 1
              spacing: 4

              Repeater {
                id: treesRepeater
                model: 0
                delegate: SpriteSequenceVPlay {
                    scale: 0.1

                    SpriteVPlay {
                        source: "../assets/img/Tree.png"
                        frameCount: 4
                        frameWidth: 1024
                        frameHeight: 512
                        frameRate: 4
                    }
                }
              }
            }

            ButtonVPlay {
              text: "Add 50 Trees"
              width: 100
              anchors.bottom: parent.bottom
              anchors.horizontalCenter: parent.horizontalCenter
              anchors.margins: 10
              onClicked: {
                treesRepeater.model += 50
              }
            }
        }
    }
}

 

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