Пример #1
0
        public override void RecreateFromXml( LayerEditor parentLayer, XElement xml )
        {
            base.RecreateFromXml( parentLayer, xml );

            _polygon = new Vector2[ 4 ] ;

            ParentLayer = parentLayer ;

            _properties = xml.Element( @"TexturedHullProperties" ).DeserializedAs<TexturedHullProperties>( ) ;

            initialiseTexture( _properties.TexturePathRelativeToContentRoot ) ;

            WhenUpdatedByUi( ) ;
        }
Пример #2
0
 public TexturedHullEditor( )
 {
     _properties = new TexturedHullProperties( ) ;
 }
Пример #3
0
        public override void CreateInDesignMode(LayerEditor parentLayer, IEntityCreationProperties creationProperties)
        {
            _polygon = new Vector2[ 4 ] ;

            ParentLayer = parentLayer ;

            string fullPath = null;// creationProperties.Parameters[@"FullPath"];

            initialiseTexture( fullPath ) ;

            _properties = new TexturedHullProperties
                {
                    //todo: need filename
                    Position = MouseStatus.WorldPosition,
                    TexturePathRelativeToContentRoot = makeRelativePath( new PathToFolder( parentLayer.ParentLevel.ContentRootFolder), fullPath ),
                    CustomProperties = new CustomProperties( ),
                    Visible = true,
                    Scale = Vector2.One,
                    TintColor = Color.White,
                } ;

            _properties.Origin = getTextureOrigin( ) ;

            WhenUpdatedByUi( ) ;
        }