예제 #1
0
        private void DoCameraChanged(Camera c)
        {
            var deadZone = Preferences.DeadZoneV2;

            CameraView.X = (int) (c.Rectangle.X + deadZone.X);
            CameraView.Y = (int) (c.Rectangle.Y + deadZone.Y);
            CameraView.Width = (int) (c.Rectangle.Width - (deadZone.X * 2));
            CameraView.Height = (int) (c.Rectangle.Height - (deadZone.Y * 2));

            CameraOuterView.X = CameraView.X - 200;
            CameraOuterView.Y = CameraView.Y - 200;
            CameraOuterView.Width = CameraView.Width + 400;
            CameraOuterView.Height = CameraView.Height + 400;
        }
예제 #2
0
        public Camera(Camera other)
        {
            if (other != null)
            {
                Position = other.position;
                Rotation = other.Rotation;
                Origin = other.Origin;
                Zoom = other.zoom;
                Name = "Unknown";
            }

            else
            {
                Initialize();
            }
        }
예제 #3
0
 public Scene(int width, int height)
 {
     Buffer = Visuals.ScenesController.Buffer;
     EnableVisuals = false;
     EnableInputs = false;
     EnableUpdate = false;
     ToDraw = new List<IScenable>();
     ToDrawWithoutCameraForeground = new List<IScenable>();
     ToDrawWithoutCameraBackground = new List<IScenable>();
     Batch = new SpriteBatch(Preferences.GraphicsDeviceManager.GraphicsDevice);
     LastBlend = BlendType.Alpha;
     UpdatedThisTick = false;
     Camera = new Camera(new Vector2(width, height));
     Camera.Origin = new Vector2(width / 2.0f, height / 2.0f);
     Name = name;
     Animations = new AnimationsController(this);
     PhysicalEffects = new EffectsController<IPhysical>();
     VisualEffects = new EffectsController<IVisual>();
     Particles = new ParticlesController(this);
     EphemereGames.Core.Input.Inputs.AddListener(this);
     IdentityMatrix = Matrix.CreateTranslation(width / 2, height / 2, 0);
     DrawMode = DrawMode.Default;
 }