PDA

View Full Version : Getting token size?



Moon Wizard
July 29th, 2008, 23:48
Is there any way to get the size of a token?

I can find out where the token is centered and what scale it is at, but I can't figure out where the boundaries of the token are. Maybe I'm just missing something...

Perhaps there anyway to get the size of the image linked to the token? (and then use the scaling, and zoom to adjust)

Thanks,
JPG

Dachannien
July 31st, 2008, 01:14
Well, token images are based on token prototypes, and it looks like the only exposed information on token prototypes seems to be a string identifier.

I suppose there's a slim chance that tokeninstances are actually descended from widgets (which would be undocumented if true), in which case you could call getSize() on them. I have my doubts that this would work, though.

joshuha
July 31st, 2008, 04:18
Well, token images are based on token prototypes, and it looks like the only exposed information on token prototypes seems to be a string identifier.

I suppose there's a slim chance that tokeninstances are actually descended from widgets (which would be undocumented if true), in which case you could call getSize() on them. I have my doubts that this would work, though.

I don't believe that is true and for now we are very limited with what we can do with tokens and the properties we can get and set.

If they truly were widgets you could add bitmaps and text to them as well but I have tried that with no luck as well.

Moon Wizard
July 31st, 2008, 18:31
I tried calling getSize() on a tokeninstance already, and it causes an error.

JPG

Dachannien
August 1st, 2008, 02:31
If they truly were widgets you could add bitmaps and text to them as well but I have tried that with no luck as well.

Well..... I've also tried adding bitmapwidgets to imagecontrols, which are widgetcontainers, and that didn't work either (no error, just nothing showed up, at least nowhere that I could find it).