Closed gauravchandra19 closed 7 years ago
Hello and thank you for using smartGL !
I think that all you need is described in the wiki here: https://github.com/smart-fun/smartGL/wiki
look at the "Animated Sprite Textures" section :)
Arnaud.
Hey, as written there I created a bitmap and added its width and height and added the frames in another class as below:
Bitmap explosionSprite= BitmapFactory.decodeResource(getResources(),R.drawable.sprite_example); mAnimatedSprite=new AnimatedSprite(explosionSprite.getWidth(),explosionSprite.getHeight()); mSpriteTexture=new Texture(MainActivity.this,R.drawable.sprite_example); mSprite=new Sprite(120,120); mSprite.setTexture(mSpriteTexture); renderPassSprite.addSprite(mAnimatedSprite);
Here is the image I am using for sprite animation:
Nice! Is all working as expected?
Hey, I am new to using and learning about sprites and your library seemed pretty simple to use and I have got the basic code working that you gave on the main screen. Now I want to change frames from a sprite sheet with a character but I am not able to follow how to do that. Can you help me with simple code for sprite animation? Thanks in advance.