Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
progressbar-implementation performance differences? — Gideros Forum

progressbar-implementation performance differences?

HolonistHolonist Member
edited December 2014 in General questions
Hi,

I like to use progress bars for a lot of stuff (hp bars, skill cooldown bars)
Inspired by a solution from someone in this forum, I wrote my own class for a progressBar.

I have experimented with
a) drawing a rectangle (using Shape()) everytime the progress changes or
b) scaling the rectangle everytime the progress changes.

Assuming a scenario, where I have a lot of bars and each one has to be checked every frame.
Which of the two implementations will be more performant? Or are both so quick that it won't matter?

Thanks in advance!

Comments

  • keszeghkeszegh Member
    Accepted Answer
    i think scaling should be faster. with redrawing you allocate memory in each step, which seems to be a waste (it will be freed up later, but memory allocation and garbagecollection is relatively slow compared to other things).
    but you may want to test this.
    also, i think even if you even have like 10-20 bars it should not matter much which solution you choose. but to be safe, choose scaling.
  • totebototebo Member
    Accepted Answer
    Another option is to use RenderTarget. I do this on my progress bars by having a background that doesn't change, then "crop" the foreground bar with RenderTarget. Quite neat, but not sure how it performs with many of them.

    Niclas
    My Gideros games: www.totebo.com
Sign In or Register to comment.