Пример #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 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;
        }
Пример #3
0
 // Methods
 public static void Pos(int x, int y)
 {
     Camera2.Release();
     CameraData.SetTo(x, y);
 }