This might seem like an odd question, but is there a way to draw shapes other than rectangles, circles and ellipses in Flashpunk? (eg. polygons and the like), similar to OpenGL drawing?
Thanks in advance.
This might seem like an odd question, but is there a way to draw shapes other than rectangles, circles and ellipses in Flashpunk? (eg. polygons and the like), similar to OpenGL drawing?
Thanks in advance.
not possible in flashpunk but i’m sure you can find a class or create a class to do this, because flashpunk using pixeldraw to draw lines or shapes… so you can write or import a new class to draw everything…
And a note, i heard people not using draw functions for ingame objects, that is not suggested, but i don’t know why…
it is possible. you could just create some DisplayObjects in your entities and overload render() method to draw them on FP.buffer which is just a BitmapData. but i’m not sure that efficiency of this will be sufficient/
Here’s one possible approach:
If you’re going to be updating the graphic often, this approach is probably too expensive, but it should work fine in cases where the graphic is only updated every now and then.
Thanks, Jacob. I was just reading about using AS3’s drawing utilities, and I think they would do the job well. Maybe I’ll even write helper classes to facilitate something along the lines of drawPolygon(points:Array).