Game Development Community

BUG: t2dTileLayer setGridActive not displaying last lines

by Pedro Vicente · in iTorque 2D · 08/21/2011 (7:18 pm) · 1 replies

Build: iTorque 1.4.1

Platform: All.

Issue: These are probably 2 bugs related to t2dTileLayer setGridActive;

Download project: here


1) t2dTileLayer setGridActive does not display sides and bottom lines (top line is displayed).

2) When adding another tile layer, if the grid lines are not set the layer on the lower level has some blurry tiles.

See images and code.

// .....................................................................................
function SceneGraphLevel_01::OnAdd(%this)
{
   CreateBackground( %this );
   CreateButton( %this, "ButtonHome", "ButtonHomeImageMap", 0,  170, 128, 128);
   %this.CreateModelTileLayer();
   %this.CreateGridTileLayer();
   makeTextObject( %this, "I am in Level 1");
}

// .....................................................................................
function SceneGraphLevel_01::onLevelEnded(%this)
{
   %this.clearScene();
}

// .......................................................................................
function SceneGraphLevel_01::CreateModelTileLayer(%this)
{
   %this.tileCountX = 7;
   %this.tileCountY = 5;
   %this.tileSizeX = %this.tileSizeY = 40;
   %this.WallTileLayer = new t2dTileLayer();
   %this.WallTileLayer.createLayer(  %this.tileCountX, %this.tileCountY, %this.tileSizeX, %this.tileSizeY ); 
   %this.WallTileLayer.setSize(  %this.tileCountX * %this.tileSizeX, %this.tileCountY * %this.tileSizeY );  
   %this.WallTileLayer.setGridActive( 0 ); 
   %this.WallTileLayer.setPosition( 0, 0 );  
   %this.WallTileLayer.setLayer( 18 ); 
   %this.getGlobalTileMap().addTileLayer( %this.WallTileLayer ); 
}

function SceneGraphLevel_01::CreateGridTileLayer(%this)
{
    %this.GridTileLayer = new t2dTileLayer();
    %this.GridTileLayer.createLayer(  %this.tileCountX, %this.tileCountY, %this.tileSizeX, %this.tileSizeY ); 
    %this.GridTileLayer.setSize(  %this.tileCountX * %this.tileSizeX, %this.tileCountY * %this.tileSizeY );  
    %this.GridTileLayer.setGridActive( 0 ); 
    %this.GridTileLayer.setPosition( 0, 0 );  
    %this.GridTileLayer.setLayer( 19 ); 
    %this.getGlobalTileMap().addTileLayer( %this.GridTileLayer ); 
    
    for ( %x = 0; %x < %this.tileCountX; %x++)
    {
       for( %y = 0; %y < %this.tileCountY; %y++)
       {
          
          %this.GridTileLayer.setStaticTile( %x, %y, Tile_04_ImageMap, 0 );
          
       }
    }
}


www.space-research.org/games/garage_games/127455.png
When adding another tile layer, if the grid lines are not set the layer on the lower level has some blurry tiles

Setting the grid active

www.space-research.org/games/garage_games/127455_2.png
Setting the grid NOT active

www.space-research.org/games/garage_games/127455_3.png

#1
08/21/2011 (8:50 pm)
That's very interesting. I wonder what kind of blending is going on. Worth looking into on a weekend.