Triangle!

hey guys!

i have problem creating triangle but i have example for box

this one:

X & initX for the xmouse
Y & initY for the ymouse


moveTo(initX, initY);
                lineTo(X, initY);
                lineTo(X, Y);
                lineTo(initX, Y);
                lineTo(initX, initY);

any idea guys?