Jump to content

bGUI z-index : display order problem


meteoritool
 Share

Recommended Posts

Hi,

 

I am using bGUI extension to create a nice User Interface.

It has several panels made of .png images with transparency.

 

Everything works perfect, but when bGUI panels are on-top of each others, the rendering order looks random : some images are on top of others, some are behind, without logic.

 

Those bGUIPanel acts as buttons, and using "guiposition()" z position allows to control the hierarchy of z "touchability", but the way they are displayed doesn't match "graphically".

 

Is there a way I can control the z order of images ?

 

I've tried to add 

bGUIPanel.mesh.position.z = 2;

after "bGUIPanel.guiposition()"

 

but this doesn't seem to change ...

 

Thx for your advice !

 

 

Link to comment
Share on other sites

Thx for your help Temechon !

I like what you did with bGUI a lot, it is very simple and efficient !

 

I've tried your solution : bGUIPanel.mesh.position.z = 20000000; but it makes the panel disappear ... So there's something going on with the z.index, but not quite what I expected ... I didn't explored more into it, because I randomly found another topic on this forum: http://www.html5gamedevs.com/topic/19310-mesh-display-on-top/ that solves the problem !

 

So the solution is : if you have several bGUIObjects on top of each others, in order to control the z-index, you have to add :

bGUIObject.mesh.renderingGroupId = x;

 

It adds a bit of code to every object, but it works :-) Hope it will help others too ;-)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...