示例#1
0
 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);
         }
     }
 }
示例#2
0
 public void on_event(EventType eventVar, int data)
 {
     if (eventVar == eEventEnterRoomBeforeFadein)
     {
         CameraData.OnRoomInit();
         Camera2.TargetCharacter = player;
         Camera2.Snap();
     }
 }
示例#3
0
 public void CameraTargetRandomAICar(bool snap)
 {
     Camera2.TargettingAcceleration = 0.5f;
     Camera2.TargetCharacter        = character[cAICar1.ID + Random(5)];
     if (snap)
     {
         Camera2.Snap();
     }
 }
示例#4
0
 // Methods
 public void CameraTargetPlayerCar(bool snap)
 {
     Camera2.TargettingAcceleration = 0.0f;
     Camera2.TargetCharacter        = player;
     if (snap)
     {
         Camera2.Snap();
     }
 }
示例#5
0
        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;
        }
示例#6
0
 // Methods
 public static void Pos(int x, int y)
 {
     Camera2.Release();
     CameraData.SetTo(x, y);
 }