cykod / Quintus

HTML5 Game Engine
http://html5quintus.com
GNU General Public License v2.0
1.41k stars 401 forks source link

Can't make the z index order work #190

Open ricardo opened 7 years ago

ricardo commented 7 years ago

I'm trying to change the stacking order of my sprites by setting the z property in the init function. But no matter what value I put in, it always stacks the elements in the order I add them to the stage.

Q.Sprite.extend('Test',{
    init: function(props) {
        this._super(props, {
            w: 20,
            h: 20
        });
    }
});

stage.insert(new Q.Test({ z: 2, color: 'blue' }));
stage.insert(new Q.Test({ z: 1, color: 'red' }));