/// <summary> /// Initializes a new instance of the <see cref="TextureControllerForShapesEditing"/> class. /// </summary> /// <param name="textureScreen"><see cref="TextureScreen"/> for which is the controller used.</param> public TextureControllerForShapesEditing(TextureScreen textureScreen) : base(textureScreen) { this.textureScreen = textureScreen; InitializeComponent(); }
/// <summary> /// Initializes a new instance of the <see cref="TextureForm"/> class. /// </summary> /// <param name="texture">The texture to edit.</param> public TextureForm(Texture texture) { InitializeComponent(); Icon = Properties.Resources._2DPGC_Logo; // messages manager messagesManager = new DefaultMessagesManager(statusLabel); Messages.MessagesManager = messagesManager; // texture this.texture = texture; // init controls settings nameTextBox.Text = texture.Name; // texture screen textureScreen = new TextureScreen(); textureScreen.Texture = texture; textureScreen.Dock = DockStyle.Fill; tableLayoutPanel.Controls.Add(textureScreen, 0, 0); textureScreen.Zoom = 100; textureScreen.Position = new PointF(-textureScreen.Width / 2f, -textureScreen.Height / 2f); // shapes controller shapesController = new TextureControllerForShapesEditing(textureScreen); shapesController.Location = new Point(3, 81); textureSettingsPanel.Controls.Add(shapesController); // title (window text) UpdateTitle(); // init shapes from texture foreach (Shape shape in texture.Shapes) { ShapeState newItem = textureScreen.AddShape(shape); shapesController.ShapesList.Items.Add(newItem); } shapesController.ShapesList.SelectedIndex = shapesController.ShapesList.Items.Count - 1; }
/// <summary> /// Initializes a new instance of the <see cref="ChangeOriginState"/> class. /// </summary> /// <param name="previousState">Previous state of the <see cref="ShapesEditingState"/>.</param> /// <param name="textureScreen"><see cref="TextureScreen"/> where the state is used.</param> public ChangeOriginState(ShapesEditingState previousState, TextureScreen textureScreen) { this.previousState = previousState; Parent = textureScreen; this.textureScreen = textureScreen; }