View Full Version : MapButton, get map as BitmapTexture
xissburg 04-16-2010, 12:23 AM In my script there's a mapButton into which it can only be inserted bitmaps. Since MapButtons doesn't have filters like the pickButton, I verify whether classOf map == BitmapTexture in the picked event. But then I need to cast the map given as parameter (which is a TextureMap) to a BitmapTexture which is a subclass of TextureMap, because I need to work with bitmap specific stuff, for example, get its dimensions. But I get an error when I try this m_Map = map as BitmapTexture, it says "Type error: Type conversion needs a class argument, got BitmapTexture". But HEY, BitmapTexture is a class, I cant understand it damn...please help :argh:
Thanks in adv
|
|
Could you please clarify? Not sure I understand your logic.
If you are already verifying that the chosen map variable is a bitmaptexture, then there is no need to convert it, it already IS a bitmaptexture.
you can access the information of its actual bitmap file using map.bitmap.width etc.
xissburg
04-17-2010, 03:04 PM
OOH! I was trying map.width instead of map.bitmap.width...so I thought I didnt have a BitmapTexture object but a TextureMap instead but I was not accessing the member correctly =/. Thank you
CGTalk Moderation
04-17-2010, 03:04 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2013, Jelsoft Enterprises Ltd.