javascript - Quintus - dynamic sprite stacking order -
i'm using html5 quintus js game library. according http://www.html5quintus.com/guide/sprites.md#.va7fbpmznn4 p.z can used change sprite's stacking order. doesn't seem me. have insert multiple sprites in same scene. sprite setup this:
q.sprite.extend("test", { init: function(p) { this._super(p,{ asset: "smallship_1x2.png", x: 150, y: 300, z : 0, dragging : false, offset : { x:0, y:0 } }); this.on("drag"); }, drag: function(touch) { this.p.dragging = true; this.p.x = touch.origx + touch.dx; this.p.y = touch.origy + touch.dy; this.p.z = 10; } });
i added few of test sprites in same stage, when drag sprite, want have higher stacking order (so sprite appear on top of others in case drag across other sprites), seems setting p.z doesn't anything. i've tried initializing sprite higher number on z property doesn't anything, stacking order seems solely based on order insert them stage. (the last insert has highest stacking order).
does know how dynamically change stacking order of sprites?
any appreciated!!
Comments
Post a Comment