How to get bitmap .z to work?

Cinnamon

Veteran
Veteran
Joined
Jun 20, 2014
Messages
605
Reaction score
209
First Language
English
Primarily Uses
I'm kinda new to JS, not really sure why the z-axis is not working.

I have these functions:

Scene_Title.prototype.create_circle_object = function() {this.circle_object = new Sprite(ImageManager.loadTitle1(circle_sym));this.circle_object.x = circle_sym_x;this.circle_object.y = circle_sym_y;this.circle_object.anchor.x = circle_sym_anchor_x;this.circle_object.anchor.y = circle_sym_anchor_y;this.circle_object.opacity = circle_sym_opacity;this.circle_object.z = 999;this.addChildAt(this.circle_object, 3);}And this:

Code:
Scene_Title.prototype.create_magic_circle = function() {	this._sprite_mgc = new Sprite(ImageManager.loadTitle2("Magic_Circle"));	this._sprite_mgc.x = 50;	this._sprite_mgc.y = 50;        this._sprite_mgc.z = -500;	this._sprite_mgc.anchor.x = 0.5;	this._sprite_mgc.anchor.y = 0.5;	this._sprite_mgc.opacity = 0;	this._sprite_mgc.blendMode = 1;	this.addChild(this._sprite_mgc);}
And yet, the "Magic Circle" with z -500 ALWAYS appears over the "Circle Object" with z 999.

 

What could be happening?

 

I haven't encountered viewports in JS, otherwise that's my first thought to blame... I tried switching the update order and creation order but nothing.
 
Last edited by a moderator:

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
There is no real z-axis in MV, sprites will appear in the order they appear in their parent's children array (which usually is the order you added them, unless you were sorting the array or use addChildAt() to add new children before older ones). Every Sprite can act as a viewport by adding children to it.
 

Cinnamon

Veteran
Veteran
Joined
Jun 20, 2014
Messages
605
Reaction score
209
First Language
English
Primarily Uses
There is no real z-axis in MV, sprites will appear in the order they appear in their parent's children array (which usually is the order you added them, unless you were sorting the array or use addChildAt() to add new children before older ones). Every Sprite can act as a viewport by adding children to it.
Perfect, thank you! That helped me solve it. :)
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.
time for a new avatar :)

Forum statistics

Threads
106,018
Messages
1,018,357
Members
137,803
Latest member
andrewcole
Top