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 GP

Hi, i have a little problem. I have a HUD entity and when I drop items I want to put an image at the right place. BUT the image always display behind the HUD.
I put 1000 to the zIndex of the HUD because I want that other entities to be behing the HUD ( ennemies, etc ... ). So i tried to put the zIndex of the entity that draw my image, but it doesn't affect image, it's still behind.
PS : It's an image that i want to display in front of an HUD entity
      this.image = new ig.Image(@drawPath)
      this.image.draw(x,y) 

If you have some ideas to help me, it'll be great and helpful =)

1 decade ago by alexandre

Drawing of stuff goes inside the draw method. Creation of stuff does not/should not. For example, inside your game subclass:
image: new ig.Image('media/001.png'),

draw: function()
{
  this.parent();
  this.image.draw(100,100);
}

If problems persist, send actual code so we can better understand error context.

1 decade ago by GP

I was using an created function to draw what I needed, so I tried your solution and it works, so I need to works on how adapt what I want to do =)
Thanks for the idea =)
Page 1 of 1
« first « previous next › last »