Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - oxi

#1
Support / Overlay.setDepth() not working
September 10, 2012, 09:41:25 PM
My HUD consists of three parts. Every part is an Overlay-Object
A Background, called "hud_camera", a slider "hud_camera_slider" and a circle "hud_camera_circle"
I want the slider and the circle displayed ontop of the background. But the setDepth() function seems to do nothing.

Only the order of declaration changes the displayed order.
It works if I declare the Overlays in this order:
hud_camera_circle
hud_camera
hud_camera_slider

Any other order will give the wrong result.

But when I move the camera around the circle flickers. (sometimes behind background, sometimes before)

Can I use .setDepth() everywhere or just in a special place, like right after the declaration, in the onDrawFrame(), ...?
Is setDepth(1.0f) in front of setDepth(2.0f) ?
Or should I use Config.nearPlane+1 and Config.nearPlane+2 ?