Unofficial Torque 2D F.A.Q.
by Matthew Langley · in Torque Game Builder · 03/03/2005 (10:11 am) · 45 replies
Just compiled some questions from the boards here into a F.A.Q. page...
Unofficial Torque 2D F.A.Q.
note: the FAQ is now onsite so ignore any past comments to the previous setup :)
Unofficial Torque 2D F.A.Q.
note: the FAQ is now onsite so ignore any past comments to the previous setup :)
About the author
I Manage Tool Development for Torque at InstantAction
#42
I submitted my tool as a resorce, can you update yours to point to the resorce instead of right off my site?
04/03/2005 (10:11 am)
@MattI submitted my tool as a resorce, can you update yours to point to the resorce instead of right off my site?
#43
04/05/2005 (8:14 am)
Btw just so you know I updated the links :) great tool, I'd recommend anyone using it... I used it in my GID to load about 20-30 sprites up into datablocks in about 2 minutes lol... great stuff!
#44
Im planning a new update, based on my own problems with it. I havnt gotten much feedback from anyone else.
The major thing im updating is the image preview graphics, right now its just a gui control 200 by 200 big, when large and unsquare pics are selected it resizes it to 200 X 200 (squiches it together) making it hard to see the image. Im turning it into a T2D sprite and going to scale the pic down ( 128 by 128 max), that way your 64 x 256 image will show up as a 32 x 128 image , not a distroted square.
Then ill be able to extract the image size and display that. Plus a "Auto Calculate" button for the cell mode. You just imput the number of sprites in it and it fills in the cellwidth and height fields for you.
04/05/2005 (3:31 pm)
:)Im planning a new update, based on my own problems with it. I havnt gotten much feedback from anyone else.
The major thing im updating is the image preview graphics, right now its just a gui control 200 by 200 big, when large and unsquare pics are selected it resizes it to 200 X 200 (squiches it together) making it hard to see the image. Im turning it into a T2D sprite and going to scale the pic down ( 128 by 128 max), that way your 64 x 256 image will show up as a 32 x 128 image , not a distroted square.
Then ill be able to extract the image size and display that. Plus a "Auto Calculate" button for the cell mode. You just imput the number of sprites in it and it fills in the cellwidth and height fields for you.
#45
The only problem with this is getting the .getImageMapBitmapSize function working. I posted a fix in this thread www.garagegames.com/mg/forums/result.thread.php?qt=27916
04/05/2005 (4:03 pm)
Here's some code I was using:function initScene()
{
// Setup the Scenegraph
new fxSceneGraph2D(dbEditorSceneGraph2D);
dbEditorScene.setSceneGraph( dbEditorSceneGraph2D );
// Set Camera Position.
dbEditorScene.setCurrentCameraPosition( "0 0 320 200" );
%background = new fxStaticSprite2D(dbPreviewBkgrnd) { scenegraph = dbEditorSceneGraph2D; };
dbEditorScene.setCurrentCameraPosition( "0 0 320 200" );
%background.setPosition( "0 0" );
%background.setSize( "320 200" );
%background.setGroup( 3 );
%background.setLayer( 11 );
%background.setImageMap( backgroundImage );
}
function dbFileList::onSelect(%this)
{
// When you click on an item in the tree
// load the new directory into the window
%sel = %this.getSelectedId();
%file = dbFileArray.idx[%sel];
dbPreviewBkgrnd.setImageMap( backgroundImage );
dbPreviewImage.delete();
%dbstr = "datablock fxImageMapDatablock2D(dbPreviewImage)\n";
%dbstr = %dbstr @ "{\n";
%dbstr = %dbstr @ " mode = \"FULL\";\n";
%dbstr = %dbstr @ " textureName = \"" @ filePath(%file) @ "/" @ fileBase(%file) @ "\";\n";
%dbstr = %dbstr @ "};\n";
eval(%dbstr);
dbPreviewBkgrnd.setImageMap( dbPreviewImage );
dbPreviewBkgrnd.setPosition( "0 0" );
dbPreviewBkgrnd.setSize( dbPreviewImage.getImageMapBitmapSize() );
dbInfo.textureName = filePath(%file) @ "/" @ fileBase(%file);
dbFname.text = filePath(%file) @ "/" @ fileBase(%file);
}
datablock fxImageMapDatablock2D(backgroundImage)
{
mode = "FULL";
textureName = "~/ui/images/backgroundT2D";
};
datablock fxImageMapDatablock2D(dbPreviewImage)
{
mode = "FULL";
textureName = "~/ui/images/backgroundT2D";
};The only problem with this is getting the .getImageMapBitmapSize function working. I posted a fix in this thread www.garagegames.com/mg/forums/result.thread.php?qt=27916
Torque 3D Owner Matthew Langley
Torque