コード例 #1
0
        private RegionSelection.RectangleSelector CreateNewSelector()
        {
            var newSelector = new RectangleSelector(mManagers);
            newSelector.AddToManagers(mManagers);
            newSelector.Visible = false;
            newSelector.RegionChanged += new EventHandler(RegionChangedInternal);

            mRectangleSelectors.Add(newSelector);

            return newSelector;
        }
コード例 #2
0
 private void HandleRegionPushed(object sender, EventArgs e)
 {
     this.mPushedRegion = sender as RectangleSelector;
 }
コード例 #3
0
        private static void UpdateRectangleSelectorToFrame(AnimationFrameSave frame, Texture2D texture, RectangleSelector rectangleSelector)
        {
            rectangleSelector.Visible = texture != null;

            if (texture != null)
            {
                float leftPixel = frame.LeftCoordinate * texture.Width;
                float rightPixel = frame.RightCoordinate * texture.Width;
                float topPixel = frame.TopCoordinate * texture.Height;
                float bottomPixel = frame.BottomCoordinate * texture.Height;

                rectangleSelector.Left = leftPixel;
                rectangleSelector.Top = topPixel;
                rectangleSelector.Width = rightPixel - leftPixel;
                rectangleSelector.Height = bottomPixel - topPixel;
            }
        }
コード例 #4
0
        private RegionSelection.RectangleSelector CreateNewSelector()
        {
            var newSelector = new RectangleSelector(mManagers);
            newSelector.AddToManagers(mManagers);
            newSelector.Visible = false;
            newSelector.RegionChanged += new EventHandler(RegionChangedInternal);
            newSelector.EndRegionChanged += EndRegionChangedInternal;
            newSelector.SnappingGridSize = snappingGridSize;
            newSelector.RoundToUnitCoordinates = mRoundRectangleSelectorToUnit;

            mRectangleSelectors.Add(newSelector);

            return newSelector;
        }