public static void Pan(int x, int y, float speed, float accel, BlockingStyle block) { Camera2.Release(); CameraActionData.Do = true; CameraActionData.PanToX = IntToFloat(x); CameraActionData.PanToY = IntToFloat(y); CameraActionData.Accel = accel; if (CameraActionData.PanToX >= CameraData.CameraX) { CameraData.SpeedX = speed; } else { CameraData.SpeedX = -speed; } if (CameraActionData.PanToY >= CameraData.CameraY) { CameraData.SpeedY = speed; } else { CameraData.SpeedY = -speed; } if (block == eBlock) { while (CameraActionData.Do) { Wait(1); } } }
public void on_event(EventType eventVar, int data) { if (eventVar == eEventEnterRoomBeforeFadein) { CameraData.OnRoomInit(); Camera2.TargetCharacter = player; Camera2.Snap(); } }
public void CameraTargetRandomAICar(bool snap) { Camera2.TargettingAcceleration = 0.5f; Camera2.TargetCharacter = character[cAICar1.ID + Random(5)]; if (snap) { Camera2.Snap(); } }
// Methods public void CameraTargetPlayerCar(bool snap) { Camera2.TargettingAcceleration = 0.0f; Camera2.TargetCharacter = player; if (snap) { Camera2.Snap(); } }
public static void LinearZoomOnto(int x, int y, float next_zoom, float reach_at_zoom) { Camera2.Release(); float at_xf = CameraData.CameraX; float at_yf = CameraData.CameraY; float end_xf = IntToFloat(x); float end_yf = IntToFloat(y); float dist_x = end_xf - at_xf; float dist_y = end_yf - at_yf; float dist_z = reach_at_zoom - CameraData.Zoom; float step_z = next_zoom - CameraData.Zoom; float xf = at_xf + dist_x * step_z / dist_z; float yf = at_yf + dist_y * step_z / dist_z; CameraData.SetToF(xf, yf); Camera2.Zoom = next_zoom; }
// Methods public static void Pos(int x, int y) { Camera2.Release(); CameraData.SetTo(x, y); }