Game Development Community

Help with code

by Harrison Brock · in Torque Game Builder · 09/15/2006 (7:48 am) · 1 replies

Here what I have:

%card =new t2dStaticSprite(){
class = "PlayingCard;
imageMap = %imageMap;
position = "0 0";
};

Know I have a MouseEvent like this:

function PlayingCard::onMouseDown(%this,%modifier,%worldPosition,%mouseClicks)
{
%this.rotateTo(145,100);
}

But nothing happens. I would like to load all my cards by script.

#1
11/16/2006 (12:30 am)
You need to do enable objectMouseEvent for the sprite and scenewindow.

%card =new t2dStaticSprite(){
class = "PlayingCard;
imageMap = %imageMap;
position = "0 0";
useMouseEvent = "true";
};

sceneWindow2D.setUseObjectMouseEvents(true);