TiledLayer capability?

  ... the case you feel the need for a new feature or want to submit one.

TiledLayer capability?

Postby LaaC » Thu Sep 01, 2011 9:33 am

I wonder if AndEngine have class like TiledLayer in J2ME. see http://www.academictutorials.com/j2me/j ... -layer.asp

I need to create controllable tiled background. So I can change the background by changing the index. It create the background randomly when the activity started.

I like how TiledLayer can be managed like this.
Create map : (We can use 1 dimension array / 2 dimension array)
int[] cells = {
3, 3, 3, 3, 3, // sky
3, 3, 3, 3, 3, // sky
1, 1, 1, 1, 1, // earth
2, 2, 2, 2, 2, // sea
2, 2, 2, 2, 2 // sea
};
Initialize object :
background = new TiledLayer(5, 5, backgroundImg, 32, 32);
Assign /change cell :
background.setCell(column, row, cells[i]);

I already read TMXTiledMapExample on AndEngineExample, but it seems to complicated and can't be easily managed...


Regards,
LaaC
LaaC
 
Posts: 5
Joined: Thu Sep 01, 2011 9:03 am

Re: TiledLayer capability?

Postby AlexNunn » Thu Sep 01, 2011 4:39 pm

TMX is your best bet. Otherwise you'll have to code it yourself, maybe using SpriteBatch or AnimatedSprites.
AlexNunn
 
Posts: 604
Joined: Thu Oct 07, 2010 6:43 pm
Location: Kentucky

Re: TiledLayer capability?

Postby LaaC » Mon Sep 05, 2011 4:47 pm

At first I want to use large vector of Sprite / Animated Sprite. But I think it will hogging large memory, because I want to make a game using a large map... maybe about 100 x 50.
I already try with TiledSprite and it lag so bad.... :(

Maybe there is any tutorial to create TMX layer by code? not by loading tmx file.... And I need to change the picture index dynamically.....

Thanks in advance
LaaC
 
Posts: 5
Joined: Thu Sep 01, 2011 9:03 am

Re: TiledLayer capability?

Postby Usman123 » Mon Mar 16, 2015 2:19 pm

TexturePacker supports RGBA5555 and this seems like a very nice compromise, dithering is a LOT less visible than with 4444 and still the resulting graphics are a lot smaller than full 8888.
Usman
Usman123
 
Posts: 1
Joined: Mon Mar 16, 2015 2:18 pm


Return to Features

Who is online

Users browsing this forum: No registered users and 6 guests