Forums

OverviewV-Play 1 SupportChange Z-Position of QML Items at run time › Re: Change Z-Position of QML Items at run time

OverviewV-Play 1 SupportChange Z-Position of QML Items at run time › Re: Change Z-Position of QML Items at run time
#4050

Christian
V-Play Team

Ah I see..

So you really need to change your z order dynamically in that case. You could use the vertexZ property.
It is not documented though, because it usually introduces other issues like alpha blending not working correctly, but you could try if it works in your case.

Add it to any Item/Entity/etc. by adding a float property called vertexZ. It is a float value and you can also see its usage in the Squaby demo by searching the source code for vertexZ.

Here is an example of adding vertexZ to an Item:


Item {
  property real vertexZ: 1.5
}

What this property does, is that it modifies the z value of the OpenGL drawing directly. It works best in ranges between -50 and 50, so you might divide your z calculation by 10 to get it working.

Please let me know if that solved your problem.

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