background

  ... announce your new project or blog about the development of your project.

background

Postby wiseguy » Sat Jan 21, 2012 4:17 am

is it possible to set the background to a PNG file found in my assests folder
sample code much apreciated
wiseguy
 
Posts: 7
Joined: Tue Jan 03, 2012 4:54 am

Re: background

Postby ramesh465 » Sat Jan 21, 2012 9:15 am

this is the sample code for set background using assets folder


BitmapTextureAtlas bgTexAtlas = new BitmapTextureAtlas(512, 512, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
activity.getEngine().getTextureManager().loadTexture(bgTexAtlas);
TextureRegion bgTexReg = BitmapTextureAtlasTextureRegionFactory.createFromAsset(bgTexAtlas, activity.getBaseContext(), "gfx/bgScreen.png", 0, 0);
Sprite bgSprite = new Sprite(0, 0, bgTexReg);
attachChild(bgSprite);
ramesh465
 
Posts: 31
Joined: Sat Dec 24, 2011 2:25 pm

Re: background

Postby wiseguy » Sat Jan 21, 2012 8:17 pm

i did that but i get an error on the bitmap texture atlas part. soory i am a comple noob does that go on the load scene or does part go under onload rescources
wiseguy
 
Posts: 7
Joined: Tue Jan 03, 2012 4:54 am


Return to Projects & Project-Development Blogs

Who is online

Users browsing this forum: diegosunshine, Drazbedel and 16 guests