GithubHelp home page GithubHelp logo

andenginetmxtiledmapextension's People

Contributors

winniehell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

andenginetmxtiledmapextension's Issues

Code require data in .tmx file to be compressed

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.

TMXLoader.loadFromAsset() tries to call TMXTiledMap.getTextureRegionFromGlobalTileID() with ridiculous negative number

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.

more than one level with the tilemap

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?

TMXLayer

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

Isometric Supported

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)

Multiple TMXLayer problem

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.