-
Sprite to Bitmap conversion not displaying
Hi all,
Im trying to make a simple game at the moment using AS3 and flash develop. As part of the game i have created a randomly generated fractal terrain from Points stored in an array. Based on these points and using the 'lineTo' and 'beginFill' commands, I loop through the array and draw the terrain as a Sprite object. This works fine.
However, as the terrain will need to be scrolled across the screen, and in the interest of speed, i wanted to convert the Sprite terrain object to a Bitmap object. Now I have converted images to bitmaps before without a problem, yet for the life of me, I cannot seem to display the terrain as a Bitmap. It just does not appear when added to the stage. As mentioned, if I leave it as a Sprite object it shows.
Could someone please help shed some light on this.
Code for converting Sprite to Bitmap:
Actionscript Code:
var bd:BitmapData = new BitmapData(_terrainView.width, _terrainView.height, true, 0); bd.draw(_terrainView); var bm:Bitmap = new Bitmap(bd); addChild(bm);
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|