org.andengine.entity.sprite.AnimatedSprite Java Examples

The following examples show how to use org.andengine.entity.sprite.AnimatedSprite. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AndEngineActivity.java    From 30-android-libraries-in-30-days with Apache License 2.0 6 votes vote down vote up
@Override
protected Scene onCreateScene() {
    Scene scene = new Scene();
    scene.getBackground().setColor(0.2f, 0.5f, 0.7f);

    Sprite sprite = new Sprite(mCamera.getWidth() / 2, mCamera.getHeight() / 2,
            mTextureRegion, getVertexBufferObjectManager());
    scene.attachChild(sprite);

    mAnimatedSprite = new AnimatedSprite(200, 200, mTiledTextureRegion, this.getVertexBufferObjectManager());
    long[] frameDuration = {500, 500, 500, 500};
    mAnimatedSprite.animate(frameDuration);
    scene.attachChild(mAnimatedSprite);

    return scene;
}
 
Example #2
Source File: Bird.java    From OpenFlappyBird with Do What The F*ck You Want To Public License 5 votes vote down vote up
public Bird(float birdXOffset, float birdYOffset, VertexBufferObjectManager mVertexBufferObjectManager, Scene mScene) {

		this.mBirdXOffset = birdXOffset;
		this.mBirdYOffset = birdYOffset;		
		
		mSprite = new AnimatedSprite(mBirdXOffset, mBirdYOffset, 55.8f, 40, mBirdTextureRegion, mVertexBufferObjectManager);
		mSprite.animate(25);
		mSprite.setZIndex(2);
		mScene.attachChild(mSprite);
		
	}
 
Example #3
Source File: Bird.java    From OpenFlappyBird with Do What The F*ck You Want To Public License 4 votes vote down vote up
public AnimatedSprite getSprite() {
	return mSprite;
}