nicolasgramlich / andenginetmxtiledmapextension Goto Github PK
View Code? Open in Web Editor NEWAndEngine - TMX Tiled Map Extension
Home Page: http://www.andengine.org
AndEngine - TMX Tiled Map Extension
Home Page: http://www.andengine.org
delme :)
So it's about color again =D
On line 276 of TMXLayer.java, the Color.WHITE_PACKED doesn't exists on android or andgine color classes.
I was struggling with a preDraw null pointer exception problem after attaching a TMXLayer
to the scene. After debugging I finally came to the conclusion that the texture for the tiles where never loaded. Turns out I had selected to store .tmx data uncompressed when using
Tiled Map Editor. The current code require that TMX data is stored compressed (zlib).
TMXParser.java
final boolean binarySaved = this.mDataCompression != null && this.mDataEncoding != null;
If mDataCompression is null then the texture is never loaded.
I have a shadow layer on my TMX map and setting the color and/or alpha doesn't do anything.
I've been struggling for days with getting a simple map to load; the desert.tmx map loads properly, but all maps that I try to make through Tiled map editor (also using gzip encoding) fail with the same message:
02-01 10:58:17.645: E/AndEngine(5121): GameScreenV2.onCreateScene failed. @(Thread: 'GLThread 430')
02-01 10:58:17.645: E/AndEngine(5121): java.lang.IllegalArgumentException: No TMXTileProperties found for pGlobalTileID=-2147483642
The GLThread number varies from run to run, but the pGlobalTileID is ALWAYS -2147483642.
I'm trying to figure out if you can use a tilemap with more than one level, because through this class does not work .. if you know another way you can sure to mention it? or should I use another class?
Tiled disappear when rotate the TMXTiledMap
for example:
mTMXTiledMap.registerEntityModifier(new RotationModifier(1, 0, 180));
or:
mTMXTiledMap.setRotation(180);
TMXLayer.java giving me errors I am using GLES-2 i think some classes are missing in the files please tell me what to do
See the forum post here:
http://www.andengine.org/forums/post29765.html
Has to do with the TMXLayer spritebatch not getting updated with the new TextureRegion.
Before anyone requests isometric support, I've implemented, well more bodged it in.
https://github.com/Niffy/AndEngineTMXTiledMapExtension/tree/isometric
There's my fork and branch.
Example - > https://github.com/Niffy/TMXIsometricExample
Don't forget to look at http://www.andengine.org/forums/features/tmx-isometric-t7716.html
So isometric tile placement, tile offsets for isometric placement, you can parse polygons and polylines, but no implementation of collisions or drawing. Drawing should be easy, collisions is probably possible with physics. 4 drawing options(for culling) So checkout the example repo.
Currently working on object tiles (objects using a tileset)
Hi,
I am writing a game that uses TMX maps and tilesets. There is a tileset for the land (desert, water, hill, etc) and there is another tileset for the environment(trees, bushes, buildings, etc). The map has two layers. When I implemented this part and tried out, I got this exception:
10-07 23:00:55.598: E/AndroidRuntime(26679): java.lang.NullPointerException
10-07 23:00:55.598: E/AndroidRuntime(26679): at org.andengine.extension.tmx.TMXLayer.addTileByGlobalTileID(TMXLayer.java:277)
10-07 23:00:55.598: E/AndroidRuntime(26679): at org.andengine.extension.tmx.TMXLayer.initializeTMXTilesFromDataString(TMXLayer.java:247)
10-07 23:00:55.598: E/AndroidRuntime(26679): at org.andengine.extension.tmx.TMXParser.endElement(TMXParser.java:197)
10-07 23:00:55.598: E/AndroidRuntime(26679): at org.apache.harmony.xml.ExpatParser.endElement(ExpatParser.java:156)
if the pGlobalTileID is 0 this exception is always thrown.
With a small reordering, this exception can be avoided:
private void addTileByGlobalTileID(final int pGlobalTileID,
final ITMXTilePropertiesListener pTMXTilePropertyListener) {
final TMXTiledMap tmxTiledMap = mTMXTiledMap;
final int tilesHorizontal = mTileColumns;
final int column = mTilesAdded % tilesHorizontal;
final int row = mTilesAdded / tilesHorizontal;
final TMXTile[][] tmxTiles = mTMXTiles;
final ITextureRegion tmxTileTextureRegion;
if (pGlobalTileID != 0) {
tmxTileTextureRegion = tmxTiledMap
.getTextureRegionFromGlobalTileID(pGlobalTileID);
final int tileHeight = mTMXTiledMap.getTileHeight();
final int tileWidth = mTMXTiledMap.getTileWidth();
if (mTexture == null) {
mTexture = tmxTileTextureRegion.getTexture();
super.initBlendFunction(mTexture);
} else {
if (mTexture != tmxTileTextureRegion.getTexture()) {
throw new AndEngineRuntimeException(
"All TMXTiles in a TMXLayer need to be in the same TMXTileSet.");
}
}
final TMXTile tmxTile = new TMXTile(pGlobalTileID, column, row,
tileWidth, tileHeight, tmxTileTextureRegion);
tmxTiles[row][column] = tmxTile;
setIndex(getSpriteBatchIndex(column, row));
this.drawWithoutChecks(tmxTileTextureRegion, tmxTile.getTileX(),
tmxTile.getTileY(), tileWidth, tileHeight,
Color.WHITE_ABGR_PACKED_FLOAT);
submit(); // TODO Doesn't need to be called here, but should rather
// be called in a "init" step, when parsing the XML is
// complete.
/* Notify the ITMXTilePropertiesListener if it exists. */
if (pTMXTilePropertyListener != null) {
final TMXProperties<TMXTileProperty> tmxTileProperties = tmxTiledMap
.getTMXTileProperties(pGlobalTileID);
if (tmxTileProperties != null) {
pTMXTilePropertyListener.onTMXTileWithPropertiesCreated(
tmxTiledMap, this, tmxTile, tmxTileProperties);
}
}
} else {
tmxTileTextureRegion = null;
}
mTilesAdded++;
}
what is your opinion?
Br
Szabolcs
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.