public void HandleXnaInitialize(SystemManagers managers)
        {
            mManagers = managers;

            mSprite = new Sprite(null);
            mSprite.Visible = false;
            mManagers.SpriteManager.Add(mSprite);

            mOutlineRectangle = new RenderingLibrary.Math.Geometry.LineRectangle(mManagers);
            mOutlineRectangle.Visible = false;
            mManagers.ShapeManager.Add(mOutlineRectangle);
            mOutlineRectangle.Color = new Microsoft.Xna.Framework.Color(
                1.0f, 1.0f, 1.0f, .5f);

            mHighlightRectangle = new RenderingLibrary.Math.Geometry.LineRectangle(mManagers);
            mHighlightRectangle.Visible = false;
            mManagers.ShapeManager.Add(mHighlightRectangle);
            mHighlightRectangle.Color = new Microsoft.Xna.Framework.Color(
                1.0f, 1.0f, 1.0f, 1.0f);

            HandleWindowResize();
            mCursor = new InputLibrary.Cursor();
            mCursor.Initialize(mControl);
            mCameraPanningLogic = new CameraPanningLogic(mControl, managers, mCursor, mKeyboard);
            mManagers.Renderer.SamplerState = Microsoft.Xna.Framework.Graphics.SamplerState.PointClamp;
        }
        public void HandleXnaInitialize(SystemManagers managers)
        {
            mManagers = managers;

            mSprite = new Sprite(null);
            mSprite.Visible = false;
            mManagers.SpriteManager.Add(mSprite);

            mOutlineRectangle = new RenderingLibrary.Math.Geometry.LineRectangle(mManagers);
            mOutlineRectangle.Visible = false;
            mManagers.ShapeManager.Add(mOutlineRectangle);
            mOutlineRectangle.Color = new Microsoft.Xna.Framework.Color(
                1.0f, 1.0f, 1.0f, .5f);

            mHighlightRectangle = new RenderingLibrary.Math.Geometry.LineRectangle(mManagers);
            mHighlightRectangle.Visible = false;
            mManagers.ShapeManager.Add(mHighlightRectangle);
            mHighlightRectangle.Color = new Microsoft.Xna.Framework.Color(
                1.0f, 1.0f, 1.0f, 1.0f);

            HandleWindowResize();
            mCursor = new InputLibrary.Cursor();
            mCursor.Initialize(mControl);
            mCameraPanningLogic = new CameraPanningLogic(mControl, managers, mCursor, mKeyboard);
            mCameraPanningLogic.Panning += delegate
            {
                ApplicationEvents.Self.CallAfterWireframePanning();
            };

            mManagers.Renderer.Camera.CameraCenterOnScreen = CameraCenterOnScreen.TopLeft;
            mManagers.Renderer.SamplerState = Microsoft.Xna.Framework.Graphics.SamplerState.PointClamp;

            mControl.KeyDown += HandleXnaControlKeyDown;
            mControl.KeyPress += HandleXnaControlKeyPress;
        }
        public CameraPanningLogic(GraphicsDeviceControl graphicsControl, SystemManagers managers, Cursor cursor, Keyboard keyboard)
        {
            mManagers = managers;

            mKeyboard = keyboard;

            mCursor = cursor;
            mCursor.Initialize(graphicsControl);
            mCamera = managers.Renderer.Camera;
            mControl = graphicsControl;
            graphicsControl.XnaUpdate += new Action(Activity);
        }
Exemplo n.º 4
0
        public CameraPanningLogic(GraphicsDeviceControl graphicsControl, SystemManagers managers, Cursor cursor, Keyboard keyboard)
        {
            mManagers = managers;

            mKeyboard = keyboard;

            mCursor = cursor;
            mCursor.Initialize(graphicsControl);
            mCamera  = managers.Renderer.Camera;
            mControl = graphicsControl;
            graphicsControl.XnaUpdate += new Action(Activity);
        }
Exemplo n.º 5
0
        public void CustomInitialize()
        {
            if (!DesignMode)
            {
                mTimeManager = new TimeManager();


                mManagers = new SystemManagers();
                mManagers.Initialize(GraphicsDevice);
                mManagers.Name = "Image Region Selection";
                Assembly assembly = Assembly.GetAssembly(typeof(GraphicsDeviceControl));// Assembly.GetCallingAssembly();

                string targetFntFileName = FileManager.UserApplicationDataForThisApplication + "Font18Arial.fnt";
                string targetPngFileName = FileManager.UserApplicationDataForThisApplication + "Font18Arial_0.png";
                FileManager.SaveEmbeddedResource(
                    assembly,
                    "XnaAndWinforms.Content.Font18Arial.fnt",
                    targetFntFileName);

                FileManager.SaveEmbeddedResource(
                    assembly,
                    "XnaAndWinforms.Content.Font18Arial_0.png",
                    targetPngFileName);



                var contentLoader = new ContentLoader();
                contentLoader.SystemManagers = mManagers;

                LoaderManager.Self.ContentLoader = contentLoader;
                LoaderManager.Self.Initialize("Content/InvalidTexture.png", targetFntFileName, Services, mManagers);

                CreateNewSelector();

                mCursor = new InputLibrary.Cursor();
                mCursor.Initialize(this);

                mKeyboard = new InputLibrary.Keyboard();
                mKeyboard.Initialize(this);

                mCameraPanningLogic          = new CameraPanningLogic(this, mManagers, mCursor, mKeyboard);
                mCameraPanningLogic.Panning += HandlePanning;



                MouseWheel += new MouseEventHandler(HandleMouseWheel);
                ZoomNumbers = new Zooming.ZoomNumbers();
            }
        }
        public void CustomInitialize()
        {
            mTimeManager = new TimeManager();


            mManagers = new SystemManagers();
            mManagers.Initialize(GraphicsDevice);
            mManagers.Name = "Image Region Selection";
            Assembly assembly = Assembly.GetAssembly(typeof(GraphicsDeviceControl));// Assembly.GetCallingAssembly();

            string targetFntFileName = FileManager.UserApplicationDataForThisApplication + "Font18Arial.fnt";
            string targetPngFileName = FileManager.UserApplicationDataForThisApplication + "Font18Arial_0.png";
            FileManager.SaveEmbeddedResource(
                assembly,
                "XnaAndWinforms.Content.Font18Arial.fnt",
                targetFntFileName);

            FileManager.SaveEmbeddedResource(
                assembly,
                "XnaAndWinforms.Content.Font18Arial_0.png",
                targetPngFileName);



            var contentLoader = new ContentLoader();
            contentLoader.SystemManagers = mManagers;

            LoaderManager.Self.ContentLoader = contentLoader;
            LoaderManager.Self.Initialize("Content/InvalidTexture.png", targetFntFileName, Services, mManagers);

            CreateNewSelector();

            mCursor = new InputLibrary.Cursor();
            mCursor.Initialize(this);

            mKeyboard = new InputLibrary.Keyboard();
            mKeyboard.Initialize(this);

            mCameraPanningLogic = new CameraPanningLogic(this, mManagers, mCursor, mKeyboard);
            mCameraPanningLogic.Panning += HandlePanning;



            MouseWheel += new MouseEventHandler(MouseWheelRegion);
            ZoomNumbers = new Zooming.ZoomNumbers();
        }
Exemplo n.º 7
0
        void HandleXnaInitialize()
        {
            mManagers = new SystemManagers();
            mManagers.Initialize(mControl.GraphicsDevice);

            mManagers.Renderer.SamplerState = SamplerState.PointClamp;

            mManagers.Name = "Preview Window Managers";
            ShapeManager shapeManager = mManagers.ShapeManager;

            mSprite = new RenderingLibrary.Graphics.Sprite(null);


            mRectangle = new LineRectangle(mManagers);
            mManagers.ShapeManager.Add(mRectangle);
            // Move it in front of the Sprite
            mRectangle.Z = 1;

            mManagers.SpriteManager.Add(mSprite);

            mControl.Resize += new EventHandler(HandleResize);
            mControl.XnaUpdate += new Action(HandleXnaUpdate);
            MoveCameraToProperLocation();

            // We'll use Cursor.Self which is initialized and updated elsewhere
            // Actually looks like that's not the case.  We'll make a new one.
            mCursor = new Cursor();
            mCursor.Initialize(mControl);

            mKeyboard = new Keyboard();
            mKeyboard.Initialize(mControl);

            mLeftRuler = new Ruler(mControl, mManagers, mCursor);
            mLeftRuler.RulerSide = RulerSide.Left;

            mTopRuler = new Ruler(mControl, mManagers, mCursor);
            mTopRuler.RulerSide = RulerSide.Top;

            mManagers.Renderer.Camera.CameraCenterOnScreen = CameraCenterOnScreen.TopLeft;
            mManagers.Renderer.Camera.X = -50;
            mManagers.Renderer.Camera.Y = -50;

            cameraController = new CameraController(Camera, mManagers, mCursor, mControl, mTopRuler, mLeftRuler);

        }