Community Forum

MouseEvent Function

Forum Overview >> Scripting

CategoryScripting
Created17.02.2011 02:04


Dirk Buck (Unknown) 17.02.2011 02:10
Hi all together,
i've written a function for the mouseevent to get an click on the mouse position.
I have found something helpfull script snippets, but it doens't work correctly.

My problem are that i have no more mousecursor after loading the map to press the start button and if i show the cursor through the script it jumps wild around.

I thing the problem exists around the line
wrapMousePosition(posX, posY);

I have found some old post here for ls2009 but it doesnt help.
I have tried to call the wrap function in update() and draw() but the same result.

i hope there is anybody who can help me.

greets
D.Buck

function mapviewer:mouseEvent(posX, posY, isDown, isUp, button)
self.mouseX = posX;
self.mouseY = posY;
--Nur reagieren wenn Aktiv
--if self.mapvieweractive then
if self.bigmap.mapTransp == 1 and self.mapvieweractive then
if g_currentMission.fixedCamera or not g_currentMission.allowSteerableMoving then
return;

setShowMouseCursor(true);
wrapMousePosition(posX, posY);

else
setShowMouseCursor(false);
end;
end;
end;

Stefan Geiger - GIANTS Software 23.02.2011 15:37
You should use InputBinding.setShowMouseCursor(false) instead of setShowMouseCursor directly. This will work as long as the player is sitting in a vehicle. The player unfortunately still is using this function directly.

But why do you even have a button to click if there is no mouse cursor anymore?


Note: Log in to post. Create a new account here.