weimingtom / andengine

Automatically exported from code.google.com/p/andengine
1 stars 0 forks source link

Update textures dinamically without invoking each time TextureRegionFactory.createFromResource(...) #22

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Tried the example UpdateTextureExample, adding a TimerHandler which call 
automatically the toggle function to change the textures (without tapping the 
screen)
2. Substitute the textures with file much greater (Example: 768x1024)

What is the expected output? What do you see instead?
The time to toggle from a picture to the other is too long

My solution:

If we in BaseSprite remove the attribute "final" for mTextureRegion, we are 
able to add a method setTextureRegion.
Using this new method in UpdateTextureExample in place of createTiledFromAsset 
we reduce the time for each update.

Regards

Original issue reported on code.google.com by fili...@greenrobot.de on 25 Feb 2011 at 3:32

Attachments: