Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
is it needed to add a getSize api for the Sprite class — Gideros Forum

is it needed to add a getSize api for the Sprite class

XmanXman Member
edited January 2017 in General questions
in most situations, we probably get the width and height at the same time, it will be a little more easier and efficient to get both since a little calculation is needed to get these two values.

Comments

  • hgy29hgy29 Maintainer
    In fact you can already:
    local x,y,w,h=sprite:getBounds(sprite)
  • I knew getBounds can do the same result as when I discussed whether sprite:getWidth() is needed to add the withoutTransform argument that I will probably never use.

    a get size api maybe more straightforward.

  • XmanXman Member
    edited January 2017
    And call the localBounds directly maybe a little more efficient without to find the target sprite.
  • hgy29hgy29 Maintainer
    Agreed, this would be more straightforward.
  • XmanXman Member
    edited January 2017
    Added!
    Call sprite:getSize() is more straightforward than call sprite:getBounds(targetSprite) to get the transformed values.

    Likes: SinisterSoft

    +1 -1 (+1 / -0 )Share on Facebook
Sign In or Register to comment.