view background BitmapTexture

Software: Away3D 4.x

careca, Newbie
Posted: 26 June 2012 08:27 PM   Total Posts: 14

How to change the position of the x and y of the background?

   

careca, Newbie
Posted: 26 June 2012 08:32 PM   Total Posts: 14   [ # 1 ]

I have an image with 1280 * 720 and want to use as background. But it always gives me invalid size.
This is my code:

var backgroundBitmapdata: BitmapData = new BitmapData (2048, 2048, true, 00999999)
backgroundBitmapdata.draw (background)
_view.background = new BitmapTexture (backgroundBitmapdata)

I want the background to occupy the whole stage.
Any tips?

   

careca, Newbie
Posted: 26 June 2012 08:46 PM   Total Posts: 14   [ # 2 ]

any help?

   

Avatar
Austen, Newbie
Posted: 26 June 2012 10:16 PM   Total Posts: 21   [ # 3 ]

well what did you try?
did you try putting a 2048 image to use with your 2048 bitmap data?

   

careca, Newbie
Posted: 26 June 2012 11:12 PM   Total Posts: 14   [ # 4 ]

my application is 1280 * 720.
I wanted to use a background of this size. In previous versions of away Imake:
var backgroundBitmapdata: BitmapData = new BitmapData (1920, 1080, false)
backgroundBitmapdata.draw (background)
view.backgroundImage = backgroundBitmapdata

But now it is not possible to do this

   

Avatar
theMightyAtom, Sr. Member
Posted: 27 June 2012 08:02 AM   Total Posts: 669   [ # 5 ]

You want to make a bitmapData that is 2048 x 2048.
To quickly test, you could resize the image in photoshop.
To use a smaller image, you can resize it in AS3.

Load your image, scale it, and draw it into your BitmapData(2048,2048).
Then you have a valid background image.
Give it a try, and if you get stuck, post your code here.

Good Luck!

   

Richard Olsson, Administrator
Posted: 27 June 2012 08:03 AM   Total Posts: 1192   [ # 6 ]

Just resize your background to 2048x2048 (or 1024x1024) and draw it into a bitmap data of that size. Then use that bitmap data for the background texture.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X