0
\$\begingroup\$

I'm making a game where one takes a picture of their face to use on a character. I have them zoom in on the picture, but the bitmapdata extends out of its movieclip. How do I assign bounds to my bitmapdata?

\$\endgroup\$
  • \$\begingroup\$ I decided to try getBounds \$\endgroup\$ – user25191 Mar 30 '13 at 4:41
  • \$\begingroup\$ ...and it didn't work \$\endgroup\$ – user25191 Mar 31 '13 at 14:35
  • \$\begingroup\$ Since this task is not just relevant to games (I can imagine websites doing this) there may already be an explanation on the main StackOverflow. \$\endgroup\$ – jhocking Apr 3 '13 at 12:23
2
\$\begingroup\$

I think you need to dynamically create a shape with the x, y, width, and height of what you want to be visible, make it a mask and then add it to the display list in front of the bitmap data's movie clip. See this article on the subject.

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

Use the scrollRect property of your Bitmap. Here's the API documentation. You might also be interested in the following question/answer.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy