2013-09-25 1 views
0

스프라이트를 배경으로 사용하려하지만 이미지가 전체 카메라 영역을 차지하지 않습니다.스프라이트를 배경 이미지로 설정하는 방법은 무엇입니까?

현재, 그것은이 (피복 일부만)과 같다 enter image description here

이 난 OnCreateResources에 이미지를로드하는 방법이다 : OnCreateScene에서

 backgroundTextureAtlas = new BitmapTextureAtlas(getTextureManager(),800, 480, TextureOptions.BILINEAR_PREMULTIPLYALPHA); 
    mBackgroundTextureRegion = BitmapTextureAtlasTextureRegionFactory.createFromAsset(backgroundTextureAtlas,this.getAssets(),"background.png",0,0); 
    backgroundTextureAtlas.load(); 

로 스프라이트 만들기

mBackgroundSprite = new Sprite(0, 0, mBackgroundTextureRegion, getVertexBufferObjectManager()); 

전체 영역을 채우기 위해 이미지 크기를 조정하는 방법은 무엇입니까? 이 도움이

mBackgroundSprite = new Sprite(0.0f, 0.0f, mCamera.getWidth(),mCamera.getHeight(), mBackgroundTextureRegion); 

희망이 카메라와 동일한 높이와 폭 만들기 -

답변

0

은 높이와 너비를 지정할 수 있습니다 스프라이트에 대한 오버로드 된 생성자가 있어야합니다.

+0

감사합니다 :) 그것은 효과가있었습니다. –