Game Development Community

Gui problem

by Howard Dortch · in Torque Game Engine · 12/23/2006 (11:40 am) · 4 replies

I have a bitmap gui element 8 x 8 in size and I want to position it in a area 200 x 200 on the display and move it around as a result of a call from the server.

new GuiBitmapCtrl(samDot) {
Profile = "GuiDefaultProfile";
HorizSizing = "top";
VertSizing = "left";
position = "146 96";
Extent = "8 8";
MinExtent = "2 2";
Visible = "1";
bitmap = "./white";
wrap = "0";
};

all is well, the white block appears as expected.

Now in the game I want to move the dot around so I send a message to the client to move the dot.

function clientCmdMoveDot(%bx,%by)
{
samDot.position = %bx SPC %by;

echo("DOT IS "@samDot.getPosition());
}

echo prints this : DOT IS 25 20
but the dot is at 25 96

The dot will move left to right as expected but the Y value will stay 96 as declared in the gui.

Is there any reason I can't change the Y position of this dot?

#1
12/25/2006 (9:19 am)
Bump, anyone see a problem in this code?
#2
12/27/2006 (7:48 pm)
Bump again, anyone home?
#3
12/28/2006 (1:23 am)
Howard I don't know whay that doesn't work but have you tried this?


function clientCmdMoveDot(%bx,%by)
{
samDot.position.x = %bx;
samDot.position.y = %by;

echo("DOT IS "@samDot.getPosition());
}
#4
12/28/2006 (6:40 am)
Try getTransform(), and setTransform()