Question about CompositeSprite(Isometric mode)..(Sloved)
by KevinYuen · in Torque 2D Beginner · 03/03/2013 (5:56 pm) · 5 replies
Tile size: 128X64
Script Code:
%composite = new CompositeSprite();
%composite.setDefaultSpriteStride( 4, 2 );
%composite.setDefaultSpriteSize( 8, 4 );
%composite.SetBatchLayout( "iso" );
%composite.SetBatchSortMode( "-y" );
%composite.SetBatchIsolated( CompositeSpriteToy.RenderIsolated );
for ( %y = -10; %y <= 10; %y++ )
{
for ( %x = -10; %x <= 10; %x++ )
{
%composite.addSprite( %x SPC %y );
%composite.setSpriteImage( "CompositeSpriteToy:tilecells", getRandom(0,4) );
}
}
Result: gaps between the blocks.
like this:

My english is not good, forgive me. =(
Script Code:
%composite = new CompositeSprite();
%composite.setDefaultSpriteStride( 4, 2 );
%composite.setDefaultSpriteSize( 8, 4 );
%composite.SetBatchLayout( "iso" );
%composite.SetBatchSortMode( "-y" );
%composite.SetBatchIsolated( CompositeSpriteToy.RenderIsolated );
for ( %y = -10; %y <= 10; %y++ )
{
for ( %x = -10; %x <= 10; %x++ )
{
%composite.addSprite( %x SPC %y );
%composite.setSpriteImage( "CompositeSpriteToy:tilecells", getRandom(0,4) );
}
}
Result: gaps between the blocks.
like this:

My english is not good, forgive me. =(
#2
i just modify CompositeSpriteToy, this is toy's zip.
03/04/2013 (1:10 am)
http://pan.baidu.com/share/link?shareid=343510&uk=607085369i just modify CompositeSpriteToy, this is toy's zip.
#3
You can turn this off either globally or on a per-asset basis as described in the documentation here.
To stop it I went to your "sand_tiles" asset and added the filter mode like this:
As described in the doco though, you could also do this globally i.e. set the default like this somewhere at start-up:
Hope this helps.
03/04/2013 (3:15 am)
I just looked at this for you and the reason why you're seeing the background is because your isometric tile asset is using the standard "bilinear" texture filtering which is causing texel bleeding.You can turn this off either globally or on a per-asset basis as described in the documentation here.
To stop it I went to your "sand_tiles" asset and added the filter mode like this:
<ImageAsset
AssetName="sand_tiles.asset"
FilterMode="Nearest"
ImageFile="sand_tiles.asset.png">
<ImageAsset.Cells>
<Cell Offset="2 2" Width="128" Height="64"/>
<Cell Offset="262 134" Width="128" Height="64"/>
<Cell Offset="132 134" Width="128" Height="64"/>
<Cell Offset="2 266" Width="128" Height="64"/>
<Cell Offset="2 200" Width="128" Height="64"/>
<Cell Offset="2 134" Width="128" Height="64"/>
<Cell Offset="262 68" Width="128" Height="64"/>
<Cell Offset="132 68" Width="128" Height="64"/>
<Cell Offset="2 68" Width="128" Height="64"/>
<Cell Offset="262 2" Width="128" Height="64"/>
<Cell Offset="132 2" Width="128" Height="64"/>
</ImageAsset.Cells>
</ImageAsset>As described in the doco though, you could also do this globally i.e. set the default like this somewhere at start-up:
$pref::T2D::imageAssetGlobalFilterMode = "Nearest";
Hope this helps.
#4
I will try to translate your document, so that our country's friends study T2D together~
03/04/2013 (3:29 am)
thank for your help~ Melv =)I will try to translate your document, so that our country's friends study T2D together~
#5
03/04/2013 (3:32 am)
You are most welcome.
Associate Melv May