I'm just wondering what's the best approach to divide everything up in seperate classes.
Is it OK to give the Activity as a parameter?
I'm loading the BitmapTextures in the onCreateResources() like so:
MainActivity.java
Using java Syntax Highlighting
- @Override
- public void onCreateResources() {
- this.mPlayerTexture = new BitmapTextureAtlas(this.getTextureManager(), 64, 64, TextureOptions.BILINEAR);
- this.mPlayerTextureRegion =
- BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.mPlayerTexture, this, "hero_small.png", 0, 0, 1,
- 1);
- this.mPlayerTexture.load();
- }
Parsed in 0.032 seconds, using GeSHi 1.0.8.4
now I'd like to do the following:
Player.java
Using java Syntax Highlighting
- public void initPlayer(MainActivity activity, Context context) {
- this.mPlayerTexture = new BitmapTextureAtlas(activity.getTextureManager(), 64, 64, TextureOptions.BILINEAR);
- this.mPlayerTextureRegion =
- BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.mPlayerTexture, activity, "hero_small.png", 0, 0, 1,
- 1);
- this.mPlayerTexture.load();
- }
Parsed in 0.031 seconds, using GeSHi 1.0.8.4
I'm just wondering if it's a good approach to do it like this or just load all the resources in the MainActivity and not use an Activity as a parameter?


