Depth sort mode for texturemap?

All things HTML5 or text based engines, or really any web based engines.
Post Reply
zaquanishak
Posts: 53
Joined: Mon Aug 26, 2013 1:54 am

Depth sort mode for texturemap?

Post by zaquanishak »

Hi,
From your documentation i see that u use IgeTileMap2d as example for depth sort mode. Currenly im using the texture map for my map and i would like to use the depth sort mode function. Is it possible im using that fucntion in texture map? I try it but fail with no luck on the sorting with my character.
This is how i write my texture map and define the depth sort mode to 0.

Code: Select all

loadTileMap1: function () {
        this.textureMap1 = new IgeTextureMap()
            .depth(1)
            .tileWidth(40)
            .tileHeight(40)
            .drawMouse(true)
            .depthSortMode(0)
            .autoSection(10)
            .drawBounds(false)
            .isometricMounts(true)
            .addComponent(IgeEntityManager)
            .mount(ige.client.mainScene);

        var texIndex = this.textureMap1.addTexture(this.gameTexture[1]);

        this.textureMap1.loadMap(map1);
        //console.log(this.textureMap1.map.mapDataString());

    },
This is where i load the entity and mount it to the foregroud map.

Code: Select all

loadEntity: function () {
        this.entity = new IgeEntity()
            .id('tree')
            .texture(this.gameTexture[2])
            .width(150)
            .height(150)
            .cell(17)
            .isometric(true)
            .drawBounds(false)
            .mount(ige.client.foregroundMap);
    }
This is my foreground map mount to the foregroundScene later mount to the mainScene.

Code: Select all

 this.foregroundMap = new IgeTileMap2d()
            .id('foregroundMap')
            .isometricMounts(true)
            .tileWidth(40)
            .tileHeight(40)
            .drawGrid(10)
            .drawMouse(true)
            .depthSortMode(0)
            .drawBounds(false)
            .drawBoundsData(false)
            .hoverColor('#BFE01B')
            .mount(this.foregroundScene);
Untitled.png
zachz
Programmer
compass-interactive
zaquanishak
Posts: 53
Joined: Mon Aug 26, 2013 1:54 am

Re: Depth sort mode for texturemap?

Post by zaquanishak »

Plus, do i need to create container for every entity i place in the isometric? If i dont use container the 3d bounds will not be on the right position. is this correct?

Regards,
Zachz
zachz
Programmer
compass-interactive
User avatar
coolbloke1324
Posts: 181
Joined: Mon Jan 23, 2012 5:20 pm

Re: Depth sort mode for texturemap?

Post by coolbloke1324 »

Hey ya,

Does your character also have a 3d bounds? Is your tree's bounds setup correctly in size to cover the whole tree?

It's probably best not to mount entities to a texture map and instead, create a tile map that you mount them to. Texture maps have one purpose - to output many individual tiles at high speed.
CEO & Lead Developer
Irrelon Software Limited
http://www.isogenicengine.com
Post Reply

Return to “HTML5/Web Engines”