gamnit: fix draw order of the DPad background
authorAlexis Laferrière <alexis.laf@xymus.net>
Tue, 12 Dec 2017 04:20:56 +0000 (23:20 -0500)
committerAlexis Laferrière <alexis.laf@xymus.net>
Thu, 4 Jan 2018 21:28:27 +0000 (16:28 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/gamnit/virtual_gamepad/virtual_gamepad.nit

index fb1920d..4034c0d 100644 (file)
@@ -411,8 +411,12 @@ class DPad
                        center.offset(   0.0,-100.0+dy, 0.0))
 
                # Non-interactive joystick background
-               sprites.add new Sprite(app.gamepad_spritesheet.joystick_back,
+               var back = new Sprite(app.gamepad_spritesheet.joystick_back,
                        center.offset(0.0, 0.0+dy, -1.0)) # In the back
+               back.draw_order = -1
+               sprites.add back
+
+               # Non-interactive handle in the bottom
                if not show_down then sprites.add new Sprite(app.gamepad_spritesheet.joystick_down,
                        center.offset(0.0, -100.0+dy,  0.0))