Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Access to the members of a TextureRegion structure — Gideros Forum

Access to the members of a TextureRegion structure

techdojotechdojo Guru
edited March 2012 in General questions
Is it possible to get access to the members (elements?) of the object / structure returned by TexturePack:getTextureRegion(texturename).

In particular I'm after the width and height of the region

I'm writing a bitmap font routine and I used the texture packer tool to create a page from all the individual characters but I want to get access to the size of an individual character so I can build up the proportional width tables etc.

I've tried iterating over the table that's returned using pairs() but it just say's the only entry in the table is __userdata and at that point I got stuck? the only other way I can think to access this info is by actually creating an instance of a bitmap from the region - interrogating it's width and then throwing it away but this seems like a lot of overkill and wasteful of time.

Anyone got any suggestions?

Thanks (in advance)

Jon...
WhiteTree Games - Home, home on the web, where the bits and bytes they do play!
#MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill

Comments

Sign In or Register to comment.