C++ Function Implementation
by Todd Johnson · in Torque Game Engine · 12/06/2004 (2:24 pm) · 3 replies
Ok, I just want to be able to see the object name over an item (not jus a player). But I have to have something enabled in order to see these names. This is what I got so far...
GuiShapeNameHud
ShapeBase
In the game I can do Player.setScanMode(1) and turn on my scan mode. From here I should see names on items right? Well I don't and if I do echo(Player.getScanMode); I can see that it was set to true. Of course I can remove control->getScanMode() from the top if (then I see the item names) but I need to be able to turn this on or off. I guess my problem is that control->getScanMode() is always returning false. Anyone know why? Thanks.
GuiShapeNameHud
if(control->getScanMode() || shape->getType() & PlayerObjectType)
{
// Render the shape's name
drawName(Point2I((S32)projPnt.x, (S32)projPnt.y),shape->getShapeName(),opacity);
}ShapeBase
...mScanItems = false;
void ShapeBase::setScanMode(bool blnScan)
{
mScanItems = blnScan;
}
bool ShapeBase::getScanMode()
{
return mScanItems;
}
ConsoleMethod(ShapeBase,setScanMode,void,3, 3,"(boolean)Turns on/off the ability to see module contents")
{
object->setScanMode(dAtof(argv[2]));
}
ConsoleMethod(ShapeBase,getScanMode,bool,2, 2,"Checks your scanning ability")
{
return object->getScanMode();
}In the game I can do Player.setScanMode(1) and turn on my scan mode. From here I should see names on items right? Well I don't and if I do echo(Player.getScanMode); I can see that it was set to true. Of course I can remove control->getScanMode() from the top if (then I see the item names) but I need to be able to turn this on or off. I guess my problem is that control->getScanMode() is always returning false. Anyone know why? Thanks.
Associate Kyle Carter