- Joined
- Jul 1, 2008
- Messages
- 1,314
Hey guys,
i wanted to create a function, that locks the game camera for player x to the middle of his current camera bounds (the place where he is looking at).
So i created a dummy at map initialisation at Location (0,0)
The Problem is, the functions doesnt set the unit x and y to the new values, it always locks the game cam at (0,0)
So my question is, how can i get the current camera field of player x?
Thanks
i wanted to create a function, that locks the game camera for player x to the middle of his current camera bounds (the place where he is looking at).
So i created a dummy at map initialisation at Location (0,0)
The Problem is, the functions doesnt set the unit x and y to the new values, it always locks the game cam at (0,0)
JASS:
function AdjustCameraForPlayer takes player p returns nothing
local rect r
local integer id = GetPlayerId(p)
if GetLocalPlayer() == p then
set r = Rect(GetCameraBoundMinX(),GetCameraBoundMinY(),GetCameraBoundMaxX(),GetCameraBoundMaxY())
call SetUnitX(udg_Spielheld[id+5],GetRectCenterX(r))
call SetUnitY(udg_Spielheld[id+5],GetRectCenterY(r))
call SetCameraTargetController(udg_Spielheld[id+5],0.00,0.00,false)
endif
endfunction
So my question is, how can i get the current camera field of player x?
Thanks