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 ShawnSwander

I have a hud comprised of two layers a bottom layer with zIndex:796 and a top layer with zIndex 798

I also have a health bar (zIndex 797) that operates by partially hiding behind the top layer effectively I can show health by the ypos of the health bar.

ig.game.sortEntitiesDeferred();

My issue is that sometimes as I move my player around the draw order gets messed up and the health bar flashes above and below the top layer I've tried using and not using the method in my ig.game.update() and in the draw() but I haven't had any luck. Any idea what might cause this? I have some other flickering issues at times but jI'm not sure why. I think another entity has to be below the hud for this issue to occur.
Here is a good frame
/><br />
<br />
<br />
Here is a bad frame<br />
<img src=

1 decade ago by KenD

What is your game's sortBy set to? If you're using ig.Game.SORT.POS_Y, that might explain why the bar would get sorted in front, if it's y position changed.

You might want to either use the default sort (ig.Game.SORT.Z_INDEX) or possibly write your own sorting algorithm that always places the HUD entities last, in the proper order.

1 decade ago by ShawnSwander

I use Zindex to sort were are just talking about a flashed bad frame happens every so often. In fact, you can see the yposition in the two images is the same it took me several screenshots to get the bad frame.
Page 1 of 1
« first « previous next › last »