Shapes or bitmaps?

This topic contains 3 replies, has 4 voices, and was last updated by  Mark Sibly 1 year, 7 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #11217

    Anatol
    Participant

    Hi! Just a quick question, in terms of performance (especially Android and iOS), would I rather use shapes (DrawRect etc.) where I can or bitmaps? In my Javascript game dev work bitmaps tend to perform much better, but for Monkey2 and mobile targets I don’t know. Or if bitmaps are better, is there a way to cache the shapes in runtime as bitmaps?

    Thanks!

    #11219

    Pakz
    Participant

    I have no idea about performance. But it is possible to draw shapes in images that you can create. As far as I know every shape command can be used inside images. You can then use drawimage to draw these images.

    #11241

    Jesse
    Participant

    Being that the language is so new and not thoroughly tested, Can you just create some test to determine what is faster?

    I suspect that DrawRect is faster than Drawing a bitmap since each pixel is not scanned for color content.

    I usually don’t test to see which is faster but just test if what I am doing is fast enough for my purpose. if it is, I stick with it else I find an alternative if possible.

    On my game that I am making “Mission patrol” I use DrawPoly and is fast enough to draw all of the backgrounds of the game so I never bother to test if drawing images is faster.

    #11281

    Mark Sibly
    Keymaster

    If you’re just drawing rectangular shapes, there’s likely to be little to no difference speedwise. Unless your trying to draw a gazillion things, I’d stick with images just ‘coz they’re simpler and more flexible, ie: you can draw anything you want!

    Have a look at the rendertoimage banana for a simple example of how to pre-render shapes to an image.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.