Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
sprite:getWidth() reported incorrectly - Gideros Forum

sprite:getWidth() reported incorrectly

BlueByLiquidBlueByLiquid Member
edited March 2013 in General questions
I have a sprite which is reporting a width greater than its contents. I have checked every sign item inside and it still reports the incorrect width which is much too large
Tagged:

Comments

  • talistalis Guru
    edited March 2013
    can you please write us a sample code?

    It can be the same problem described in this thread by @GregBUG i guess.
    I know you are not using particle engine but using sprite.
    the strange things is that if you resize emitter sprite (i tried to resize emitter to 60x60px)
    parent sprite became 130x130px (not graphically resized anyway only getWidth() and getHeight() return wrong size) so half size of particle is added to parent sprite....
    http://giderosmobile.com/forum/discussion/2774/tnt-particle-engine-emitter-adds-10x10-to-parent-sprite.-unexpected-behavior#Item_6
  • I seem to have tracked the problem down to the width being set manually in @ar2rsawseen 's GridView class's addChild function. It seems to be setting the width to a much larger value. So I guess this is not a bug. my appologies.
  • ar2rsawseenar2rsawseen Maintainer
    edited March 2013
    @BlueByLiquid not only the dimension matter, but also position.
    If you have one pixel big object, but you place it at 100, 100 coordinate, the parent will have 100, 100 dimensions

    Oh yes I'v used that trick to maintain the balance of View object :)
Sign In or Register to comment.