Inheritance: ItemProperties
コード例 #1
0
 public PreShapedConvexHullEditor( )
 {
     _properties= new ConvexHullProperties(  );
 }
コード例 #2
0
        public override void RecreateFromXml( LayerEditor parentLayer, XElement xml )
        {
            base.RecreateFromXml( parentLayer, xml );
            _editorMode = ItemEditorMode.Created ;
            ParentLayer = parentLayer ;
            _properties = xml.Element( @"ConvexHullProperties" ).DeserializedAs<ConvexHullProperties>( ) ;

            WhenUpdatedByUi(  );
        }
コード例 #3
0
ファイル: ConvexHullEditor.cs プロジェクト: SteveDunn/oglr
 public ConvexHullEditor( )
 {
     _properties= new ConvexHullProperties(  );
 }
コード例 #4
0
        public override void CreateInDesignMode(LayerEditor parentLayer, IEntityCreationProperties creationProperties)
        {
            _editorMode = ItemEditorMode.Creating ;

            Vector2 mouseWorldPos = MouseStatus.WorldPosition ;

            _properties = new ConvexHullProperties
                {
                    Visible = true,
                    Position = mouseWorldPos,
                    WorldPoints = new List<Vector2>(),
                    LocalPoints = new List<Vector2>(),
                    Opacity = 1f,
                } ;

            ParentLayer = parentLayer ;

            var shapeSelectionForm = new ShapeSelectionForm(
                v =>
                    {
                        _properties.WorldPoints.Clear( ) ;
                        _properties.LocalPoints.Clear( ) ;

                        v.ForEach( vt => addWorldPoint( mouseWorldPos + vt ) ) ;

                        WhenUpdatedByUi( ) ;
                    } )
                {
                    TopLevel = true
                } ;

            shapeSelectionForm.FormClosed+=
                ( s, e ) =>
                    {
                        if(shapeSelectionForm.Action==DialogResult.OK)
                        {
                            _editorMode=ItemEditorMode.Created;

                            PreviewEndedReadyForCreation( this, EventArgs.Empty ) ;
                        }
                    } ;

            shapeSelectionForm.Show() ;

            summonMainForm(  ).SetToolStripStatusLabel1(Resource1.PreShapedHull_Entered);
        }
コード例 #5
0
ファイル: ConvexHullEditor.cs プロジェクト: SteveDunn/oglr
        public override void CreateInDesignMode(LayerEditor parentLayer, IEntityCreationProperties creationProperties)
        {
            _editorMode = ItemEditorMode.Creating ;

            Vector2 mouseWorldPos = MouseStatus.WorldPosition ;

            _properties = new ConvexHullProperties
                {
                    Visible = true,
                    Position = mouseWorldPos,
                    WorldPoints = new List<Vector2>(),
                    LocalPoints = new List<Vector2>(),
                    Opacity = 1f,
                } ;

            addWorldPoint( mouseWorldPos );

            summonMainForm(  ).SetToolStripStatusLabel1(Resource1.Path_Entered);

            ParentLayer = parentLayer ;

            WhenUpdatedByUi(  );
        }