2014-11-09 3 views
0

를 회전하지 않습니다libgdx - 스프라이트이는 create() 메소드입니다

batch = new SpriteBatch(); 
texture = new Texture(Gdx.files.internal("spaceships/tfighter0.png")); 
sprite = new Sprite(texture); 
sprite.setOrigin(sprite.getWidth()/2, sprite.getHeight()/2); 
sprite.rotate(180f); 

그리고 렌더링() 방법 :

Gdx.gl.glClearColor(0, 0, 0, 0); 
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); 
batch.begin(); 
batch.draw(sprite ,200,200); 
batch.end(); 

가 스프라이트가 지금 회전하지 않나요? 그것은 rotate 메소드에 어느 정도 삽입했는지에 관계없이 png와 동일하게 보입니다.

sprite.draw(batch) 

대신

batch.draw(sprite,x,y) 

사용

답변

1

당신은 당신의 자신의 awnsers을 받아 들일 수

+0

작동 – SteveL