Inheritance: System.Windows.Forms.UserControl
示例#1
0
        public void HandleMouseWheel(Cursor cursor, int change, PreviewControls previewControls)
        {
            
            float worldX = cursor.GetWorldX(Managers);
            float worldY = cursor.GetWorldY(Managers);

            float oldCameraX = Camera.X;
            float oldCameraY = Camera.Y;


            float oldZoom = ZoomValue / 100.0f;

            if (change > 0)
            {
                previewControls.ZoomIn();
            }
            else
            {
                previewControls.ZoomOut();
            }

            ImageRegionSelectionControl.AdjustCameraPositionAfterZoom(worldX, worldY,
                oldCameraX, oldCameraY, oldZoom, ZoomValue, Camera);


        }
示例#2
0
        public void Initialize(GraphicsDeviceControl graphicsDeviceControl, PreviewControls previewControls)
        {

            mPreviewControls = previewControls;
            mPreviewControls.OnionSkinVisibleChange += new EventHandler(HandleOnionSkinChange);
            mPreviewControls.SpriteAlignmentChange += new EventHandler(HandleSpriteAlignmentChange);
            mControl = graphicsDeviceControl;
            mControl.XnaDraw += new Action(HandleXnaDraw);
            mControl.MouseWheel += new System.Windows.Forms.MouseEventHandler(HandleMouseWheel);
            HandleXnaInitialize();


        }