예제 #1
0
 private void SpriteEditor_Load(object sender, EventArgs e)
 {
     spriteEditorControl.ParentEditor = this;
     ZoomBox = new ZoomBox();
     ZoomBox.SetToolStripButtomZoomIn(toolStripButtonZoomIn);
     ZoomBox.SetToolStripButtomZoomOut(toolStripButtonZoomOut);
     ZoomBox.SetToolStripButtomZoomNormal(toolStripButtonZoomNormal);
     if (spriteEditorControl.Sprite.SourceRectangle != null)
     {
         toolStripButtonUseFullTexture.Enabled = true;
     }
     if (this.Sprite.Material != null)
     {
         labelTextureName.Text = spriteEditorControl.Sprite.Material.ToString();
     }
     LoadMaterialAreas();
     // hack around designer bug that resize the control
     labelTextureName.Size = new Size(labelTextureName.Size.Width, 22);
     // load all the Blending Type values in the combo box
     for (int i = 0; i < (int)DrawingBlendingType.EnumSize; i++)
     {
         comboBoxBlendingType.Items.Add(((DrawingBlendingType)i).ToString());
     }
     comboBoxBlendingType.SelectedIndex = (int)spriteEditorControl.Sprite.BlendingType;
     pictureBoxTint.BackColor           = MilkshakeForm.GetGDIColor(spriteEditorControl.Sprite.Tint);
     _ignoreNumericUpDownEvent          = true;
     numericUpDownTintRed.Value         = spriteEditorControl.Sprite.Tint.R;
     numericUpDownTintGreen.Value       = spriteEditorControl.Sprite.Tint.G;
     numericUpDownTintBlue.Value        = spriteEditorControl.Sprite.Tint.B;
     textBoxColorHTML.Text     = GetHTMLFromColor(Sprite.Tint);
     _ignoreNumericUpDownEvent = false;
     _ignoreNumericUpDownEvent = true;
     _ignoreNumericUpDownEvent = false;
     UpdateSourceRectangleControls();
 }
예제 #2
0
 private void TileGridEditor_Load(object sender, EventArgs e)
 {
     tileGridEditorControl.ParentEditor = this;
     ZoomBox = new ZoomBox();
     ZoomBox.SetToolStripButtomZoomIn(toolStripButtonZoomIn);
     ZoomBox.SetToolStripButtomZoomOut(toolStripButtonZoomOut);
     ZoomBox.SetToolStripButtomZoomNormal(toolStripButtonZoomNormal);
     labelTextureName.Text = TileGrid.Material.ToString();
     // load all the Blending Type values in the combo box
     for (int i = 0; i < (int)DrawingBlendingType.EnumSize; i++)
     {
         comboBoxBlendingType.Items.Add(((DrawingBlendingType)i).ToString());
     }
     comboBoxBlendingType.SelectedIndex = (int)TileGrid.BlendingType;
     pictureBoxTint.BackColor           = MilkshakeForm.GetGDIColor(TileGrid.Tint);
     _ignoreNumericUpDownEvent          = true;
     numericUpDownTintRed.Value         = TileGrid.Tint.R;
     numericUpDownTintGreen.Value       = TileGrid.Tint.G;
     numericUpDownTintBlue.Value        = TileGrid.Tint.B;
     _ignoreNumericUpDownEvent          = false;
     trackBarOpacity.Value         = (int)TileGrid.Tint.A;
     labelOpacity.Text             = trackBarOpacity.Value.ToString();
     checkBoxUseSafeBorder.Checked = TileGrid.UseTilingSafeBorders;
     textBoxTileWidth.Text         = TileGrid.TileSize.X.ToString(CultureInfo.InvariantCulture);
     textBoxTileHeight.Text        = TileGrid.TileSize.Y.ToString(CultureInfo.InvariantCulture);
     textBoxSizeCols.Text          = TileGrid.TileCols.ToString(CultureInfo.InvariantCulture);
     textBoxSizeRows.Text          = TileGrid.TileRows.ToString(CultureInfo.InvariantCulture);
     ApplyPaintModeSetting();
     AdjustTableLayersColumnSize();
     RefreshLayerTable();
 }
예제 #3
0
 private void AnimatedSpriteEditor_Load(object sender, EventArgs e)
 {
     this.ZoomBox = new ZoomBox();
     this.ZoomBox.SetToolStripButtomZoomIn(toolStripButtonZoomIn);
     this.ZoomBox.SetToolStripButtomZoomOut(toolStripButtonZoomOut);
     this.ZoomBox.SetToolStripButtomZoomNormal(toolStripButtonZoomNormal);
     this.ZoomBox.Camera.Pivot           = new Vector2(0.5f);
     this.ZoomBox.Camera.IsPivotRelative = true;
     if (this.AnimatedSprite.Material != null)
     {
         labelTextureName.Text = this.AnimatedSprite.Material.ToString();
     }
     // hack around designer bug that resize the control
     labelTextureName.Size = new Size(labelTextureName.Size.Width, 22);
     // load all the Blending Type values in the combo box
     for (int i = 0; i < (int)DrawingBlendingType.EnumSize; i++)
     {
         comboBoxBlendingType.Items.Add(((DrawingBlendingType)i).ToString());
     }
     comboBoxBlendingType.SelectedIndex = (int)this.AnimatedSprite.BlendingType;
     pictureBoxTint.BackColor           = MilkshakeForm.GetGDIColor(this.AnimatedSprite.Tint);
     _ignoreNumericUpDownEvent          = true;
     numericUpDownTintRed.Value         = this.AnimatedSprite.Tint.R;
     numericUpDownTintGreen.Value       = this.AnimatedSprite.Tint.G;
     numericUpDownTintBlue.Value        = this.AnimatedSprite.Tint.B;
     textBoxColorHTML.Text             = SpriteEditor.GetHTMLFromColor(this.AnimatedSprite.Tint);
     _ignoreNumericUpDownEvent         = false;
     sceneItemPreviewControl.SceneItem = this.AnimatedSprite;
     sceneItemPreviewControl.Camera    = this.ZoomBox.Camera;
     RefreshAreaComboList();
     LoadAnimationsList();
 }
예제 #4
0
        private void OpenTintSelectionDialog()
        {
            ColorDialog colorDialog = new ColorDialog();

            colorDialog.AllowFullOpen = true;
            colorDialog.FullOpen      = true;
            colorDialog.Color         = MilkshakeForm.GetGDIColor(TileGrid.Tint);
            if (colorDialog.ShowDialog() == DialogResult.OK)
            {
                pictureBoxTint.BackColor = colorDialog.Color;
                TileGrid.Tint            = new Microsoft.Xna.Framework.Graphics.Color(colorDialog.Color.R,
                                                                                      colorDialog.Color.G, colorDialog.Color.B, TileGrid.Tint.A);
                _ignoreNumericUpDownEvent    = true;
                numericUpDownTintRed.Value   = (decimal)colorDialog.Color.R;
                numericUpDownTintGreen.Value = (decimal)colorDialog.Color.G;
                numericUpDownTintBlue.Value  = (decimal)colorDialog.Color.B;
                _ignoreNumericUpDownEvent    = false;
            }
        }
예제 #5
0
        private void OpenTintSelectionDialog()
        {
            ColorDialog colorDialog = new ColorDialog();

            colorDialog.AllowFullOpen = true;
            colorDialog.FullOpen      = true;
            colorDialog.Color         = MilkshakeForm.GetGDIColor(spriteEditorControl.Sprite.Tint);
            if (colorDialog.ShowDialog() == DialogResult.OK)
            {
                pictureBoxTint.BackColor        = colorDialog.Color;
                spriteEditorControl.Sprite.Tint = new XnaColor(colorDialog.Color.R,
                                                               colorDialog.Color.G, colorDialog.Color.B, spriteEditorControl.Sprite.Tint.A);
                _ignoreNumericUpDownEvent    = true;
                numericUpDownTintRed.Value   = (decimal)colorDialog.Color.R;
                numericUpDownTintGreen.Value = (decimal)colorDialog.Color.G;
                numericUpDownTintBlue.Value  = (decimal)colorDialog.Color.B;
                _ignoreNumericUpDownEvent    = false;
                ApplyUpDownColors();
            }
        }