コード例 #1
0
ファイル: Viewer.cs プロジェクト: GodLesZ/svn-dump
        /// <summary>
        /// adds a camera and viewport.
        /// </summary>
        /// <param name="camera"></param>
        /// <param name="viewportRectangle"></param>
        public void Add(CameraBase camera, Rectangle? viewportRectangle)
        {
            this.camera.Add(camera);

            Viewport newViewport = FrameworkCore.Game.GraphicsDevice.Viewport;
            if (viewportRectangle == null)
            {
                newViewport.X = 0;
                newViewport.Y = 0;
                newViewport.Width = FrameworkCore.Game.GraphicsDevice.Viewport.Width;
                newViewport.Height = FrameworkCore.Game.GraphicsDevice.Viewport.Height;
            }
            else
            {
                newViewport.X = viewportRectangle.Value.X;
                newViewport.Y = viewportRectangle.Value.Y;
                newViewport.Width = viewportRectangle.Value.Width;
                newViewport.Height = viewportRectangle.Value.Height;
            }

            this.viewport.Add(newViewport);

            count++;
        }
コード例 #2
0
ファイル: Viewer.cs プロジェクト: GodLesZ/svn-dump
 public ViewCamera(CameraBase camera, Rectangle? viewportRectangle)
 {
     Add(camera, viewportRectangle);
 }