How do you set depth height limit?

7 posts (showing 1-7)
Arnas

Market Level 0Community Level 2
144 posts

I'm using AS2

I have created damage numbers that pop up and they are fully functional. The only problem is that they are layered above everything else, even the interface.

I'm using getNextHighestDepth which is obviously not the way to go. I don't know what kind of code I should use for sorting their exact depths.

My goal is to get all damage popup numbers to appear above everything else - but behind the interface.

What do I do?

posted 2015-12-10T14:19:34-08:00
djstatika

Market Level 10Community Level 7
1254 posts

I think you are crazy for trying to do everything in AS2 when you are just starting out. But:

Make an empty movieclips for each "layer" so have one for all your game items, then one on top of that for you damage popups and then have your user inteface on top of that. then the things within the damage popup container will never be above the UI

posted 2015-12-10T18:50:16-08:00
Arnas

Market Level 0Community Level 2
144 posts

On Dec 10, 2015, djstatika said:

I think you are crazy for trying to do everything in AS2 when you are just starting out. But:

Make an empty movieclips for each "layer" so have one for all your game items, then one on top of that for you damage popups and then have your user inteface on top of that. then the things within the damage popup container will never be above the UI

Sounds like something that is too late to do. I'm already too deep into the game development that it might take weeks to change everything. Thanks for your help. Unfortunately my program doesn't support AS3

Thanks once again :)

posted 2015-12-11T17:55:23-08:00
GroZZleR

Market Level 7Community Level 10
1594 posts

Count the amount of interface elements you have and subtract that from the getNextHighestDepth() call?  Hacky and could be ugly to debug in the future but it should work.

posted 2015-12-11T20:46:34-08:00
Arnas

Market Level 0Community Level 2
144 posts

On Dec 11, 2015, GroZZleR said:

Count the amount of interface elements you have and subtract that from the getNextHighestDepth() call?  Hacky and could be ugly to debug in the future but it should work.

The problem is when I set the depth without swapping it, the original object just disappears into nothing. It's like the text overwrites the object that belongs in that depth value.

I'm not sure if I understand how this works yet.

Is there a way that I could make the text get created between two objects and instead of erasing the spot, I could move everything above, up 1 value instead? Not sure if I explained it well.

posted 2015-12-12T18:43:45-08:00
Papee

Market Level 2Community Level 1
12 posts

swap the interface depth to 10k+

float text can only stay at depths 9000 to 9999

each time a float text is instanciated, floatTextCount++;

if  floatTextCount > 9999, floatTextCount = 9000

everything else stays below 9000

posted 2015-12-13T08:38:30-08:00
Arnas

Market Level 0Community Level 2
144 posts

I figured it out. Thanks for the help people!

posted 2015-12-13T19:02:28-08:00