Forums

OverviewV-Play 1 SupportParticles z-ordering › Reply To: Particles z-ordering

OverviewV-Play 1 SupportParticles z-ordering › Reply To: Particles z-ordering
#4430

David

Hi Chrisu,

could you please try to align your particles z-value along the SpriteBatchContainer z-value and test if this works propertly?

GemParticles {
  id: gemParticles
  z: spriteBatchContainer.z-1
}

SpriteBatchContainer {
  id: spriteBatchContainer  
}

Following example displays different objects in order to test the particles z-ordering.

import QtQuick 1.1
import VPlay 1.0

//  This example test the particle Z ordering.
GameWindow {
  id: screen

  Scene {
    id: scene
    objectName: "scene"

    Rectangle {
      id: base
      z: particle.z-1
      x: scene.width/2
      y: scene.height/2-25
      width: 50
      height: 50
      color: "darkgrey"
    }

    Particle {
      id: particle
      z: container.z-1
      fileName: "FireParticle.json"
      x: scene.width/2
      y: scene.height/2

      autoStart: true
    }

    SpriteBatchContainer {
      id: container
    }

    Rectangle {
      id: overlapper
      x: scene.width/2
      y: scene.height/2
      width: 50
      height: 50
      color: "grey"
    }

    SingleSpriteFromSpriteSheet {
      id: sprite
      frameWidth: 256
      frameHeight: 256
      startFrameColumn: 0
      spriteSheetSource: "img/weaponbox.png"
      translateToCenterAnchor: false
    }
  }
}

Cheers,

David

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