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 dmen

In a project I draw a dashed line on the canvas using something like:

var ctx = ig.system.context;

ctx.strokeStyle = '#0066ff';
ctx.beginPath();

Then a moveTo, and a series of lineTo's... all is working great. I do this in the draw() method. The problem is the line draws on top of all other impact entities. Can I fix this?

1 decade ago by vincentpiel

Have the dash line into an entity having the right 'z', and have the entities sorted on z.
Or override the draw() of your game (not calling parent), to have the order of your choice.

1 decade ago by dmen

Not sure how I could make it an entity? What I did was call the draw method of the entities I need over the line, after the standard draw call. Seems to work, and I only need two entities above the line...
Page 1 of 1
« first « previous next › last »