0
votes

I am having a movieclip container that needs change in it's dimensions. However it contains a bitmap, that needs to be preserved. So that it remains intact no matter how i change the dimension of it's container. I know, that one way is to change the scale of "bitmap" accordingly. So say, container goes twice in width, then bitmap can be adjusted to scale = 0.5 ( compensating thus).

However i am doubtful, if this method would be visibly good for the bitmap, in case the dimension changes are in decimals. Like scale = 1.2345 etc

Any other good way ?

V.

2
This question has nothing to do w/ Flex, so I removed the tag. - JeffryHouser
If you can explain why you need that, we may find a work around. decimals like 1.2342342 is not a problem with your method but implementation may not look fine. - ymutlu
It's a puzzle game actually. Each puzzle piece contains a bitmap. Now the container dimension may vary as per the choice of game say 9-piece-puzzle game, 16-piece-puzzle game etc and there can be more variation in the future . - Vishwas
@Flextras-: Well, np but i was wondering if it can be a flash question then why can't it be a flex one. Afterall it's all AS3.0 . Just curious! :) - Vishwas

2 Answers

0
votes

You could try overriding the scaleX/scaleY setters and getters of your container, so that a change to them results in changing everything inside the container except your bitmap.

That would work, but is a bit strange. Are you sure that you can not organize your objects in a different manner?

If you have items in your container that should not be affected by the containers dimensions, then those items simply do not belong there. It would probably be a good idea to split up the structure.

You could have a Sprite that holds your Bitmap, and then apply your "container" as a mask to that, so that only a part as big as the "container" is visible, or something along those lines.

0
votes

Apply a matrix to the BitmapData, which will resample it.