Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by MobileMark

I've used Weltmeister for a while now and i'm completely in love it, but I just came across a problem. I have 3-4 entities overlapping at once and I need to distinguish which entitiy is on top, bottom, etc.

Is there already a built in key, value z-indexish like solution to this that I missed?

I did try to work around it since I noticed that when you add an new entity it tends to take top level, but when I test on mobile that technique doesn't work. Looking for any other solution.

Thanks in advance!

1 decade ago by fugufish

yes there is! just add zIndex:value_wanted to all your entity settings and you'll notice the difference.

eg, to create a fence in which the player moves 'behind' it,


	EntityFence=ig.Entity.extend({
		size:{x:32,y:20},
		offset:{x:0,y:0},
		maxVel:{x:60,y:150},
		friction:{x:100,y:0},
		health:5,
		bounciness:0,
		zIndex:1, //fence now appears in front of player

1 decade ago by dominic

You can overwrite any property of an entity from within Weltmeister; the .zIndex property is no exception. Just enter "zIndex" as the key and an integer as value.

That said, Weltmeister will currently not honor the zIndex. So while you can set the zIndex in WM, you will only see the result in your game. I will fix that!

Edit: damn you fugufish! :D

1 decade ago by MobileMark

Thanks so much guys! And it's great to know that you can rewrite all properties through key, value. I'm sure it says it somewhere in your documentation, but that's what I get for not reading thoroughly :D

1 decade ago by Hareesun

This is still an issue. :P zIndex is pointless in WM.

1 decade ago by auz1111

I set the key to zIndex and the value to -1 in Weltmeister. Seems to have worked.

1 decade ago by auz1111

hmmm.... but still can't select them. Need a way to lock layers.
Page 1 of 1
« first « previous next › last »