Game Development Community

Object view issues

by Mario N. Bonassin · in Torque Game Engine · 10/18/2005 (7:09 pm) · 0 replies

I'm using this tutorial as a guide

http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=3659

but I can't seem to get the object to show up in any other form then in this window.

My main menu has a button "Garage" that has the command "Canvas.setContent(Garage);" When this new Gui pops up I want to have the gui I designed with the guiOjectView of my parts on it as well. But I can't get anything to show up. I tried to use peices of the example cs and gui but that didn't work either.

I created a garage.cs with the following in it

function garage::onAdd(%this)
{

}

//------------------------------------------------------------------------------
function garage::onWake(%this)
{
// Set main object
ShowPart.setObject("part", "starter.racing/data/shapes/parts/seg1_part.dts", "", 0);

// Load dsq's
//view.loadDSQ("part","fps/data/shapes/player/player_root.dsq");
//view.loadDSQ("part","fps/data/shapes/player/player_forward.dsq");
//view.loadDSQ("part","fps/data/shapes/player/player_back.dsq");
//view.loadDSQ("part","fps/data/shapes/player/player_jump.dsq");

// Set animation
//view.setSequence("part", "Root", 1);
}

//------------------------------------------------------------------------------
function garage::onSleep(%this)
{
ShowPart.setEmpty();
}

and this is my gui element

new GuiObjectView(ShowPart) {
profile = "GuiDefaultProfile";
horizSizing = "relative";
vertSizing = "relative";
position = "338 169";
extent = "359 335";
minExtent = "8 2";
visible = "1";
cameraZRot = "0";
forceFOV = "0";
lightDirection = "-0.57735 -0.57735 -0.57735";
lightColor = "0.600000 0.580000 0.500000 1.000000";
ambientColor = "0.300000 0.300000 0.300000 1.000000";
helpTag = "0";
};


I assumed that when the new canvas was created that onWake would be called and thus the object would appear. this isn't happening. I'm still learning script so I may be doing something wrong.

any suggestions?