Forums

OverviewV-Play 2 Support (Qt 5)framerate drop when using particles › Reply To: framerate drop when using particles

OverviewV-Play 2 Support (Qt 5)framerate drop when using particles › Reply To: framerate drop when using particles
#11362

Bas

i get good


    Item {
        id: fakeEmitter
        function burst(number) {
            while (number > 0) {
                var item = fakeParticle.createObject(pScene);
                item.duration = 500 + Math.random() * 1000;
                item.lifeSpan = 100 + Math.random() * 1000;
                item.x = ball.x + Math.random() * 40 - 80;
                item.y = ball.y + Math.random() * 40 - 80;
                item.z = Math.round( Math.random() * 200 );
                item.width = item.height = 8 + Math.round(Math.random()*24)
                item.yAnim.start();
                number--;
            }
        }
    }

    Component {
        id: fakeParticle
        Image {
            id: container
            property int duration:20
            property int lifeSpan: 10000
            property alias yAnim:yAnim
            width: 32
            height: 32
            source: Qt.resolvedUrl("../../assets/pong/bubble.png")
            PropertyAnimation {id:yAnim; target:container; property:"y"; from:container.y; to: -64; duration: container.duration; running: false;
                easing.type: Easing.InCirc;
                onStopped: container.destroy();
            }
            SequentialAnimation on opacity {
                running: yAnim.running
                NumberAnimation { from:0; to: 1; duration: 200}
                PauseAnimation { duration: Math.round(container.duration*0.6) }
                NumberAnimation { from:1; to: 0; duration: 500}
                ScriptAction { script: container.destroy(); }
            }
        }
    }

 

results with 1920 x 1080 when using a fake particle emitter

 

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