Game Development Community

FxSceneObject2D::setPosition() documentation problem

by Alex Rice · in Torque Game Builder · 08/18/2005 (4:43 am) · 4 replies

Something confusing about the docs for T2D

ConsoleMethod(fxSceneObject2D, setPosition, void, 3, 3, "(x / y) - Sets the objects position.")

What does that usage message really mean?

$obj.setPosition( %x SPC %y);
$obj.setPosition( %x @ "/" @ %y);
$obj.setPosition( %x / %y);
$obj.setPosition( %x, %y);
...
something else?

Also if there is a 3,3 in the ConsoleMethod that means that 3 parameters are required. Subtract 1 for %this leaving 2 parameters. So I am guessing $obj.setPosition( %x, %y); is the correct way to call, but I get a wrong number of arguments error.

#1
08/18/2005 (5:31 am)
Try this:
$obj.setPosition("-40 0");

If you pass in variables you'll want:
$obj.setPosition(%x SPC %y);

Ofcourse, it does rely on the %x and %y variables having some meaningful value.
#2
08/18/2005 (5:35 am)
Ah OK thanks Philip. When I tried $obj.setPosition( %x SPC %y); I guess the values were not meaningful, then the "X/Y" in the docs threw me off.
#3
08/19/2005 (3:29 am)
Alex,

The NOTES section on the first page in the docs explain the notation used within the document. The new doco includes more info per-function and includes an example usage on every call.

This should help.

- Melv.
#4
08/19/2005 (7:01 pm)
@Melv, Ah OK I see it now thanks
Quote:/ indicates parameters are grouped in a string, space-seperated.