示例#1
0
        private FrameRectangle GenerateFrameRectangle()
        {
            FrameRectangle rect = new FrameRectangle();

            Microsoft.Xna.Framework.Rectangle pos = new Microsoft.Xna.Framework.Rectangle((int)xPositionNumericUpDown.Value, (int)yPositionNumericUpDown.Value, (int)widthNumericUpDown.Value, (int)heightNumericUpDown.Value);
            float rotation = (float)rotationNumericUpDown.Value;
            float layer = (float)layerNumericUpDown.Value;
            Vector2 origin = new Vector2((float)xOriginNumericUpDown.Value,(float)yOriginNumericUpDown.Value);
            Color color = new Color((byte)rColorNumericUpDown.Value, (byte)gColorNumericUpDown.Value, (byte)bColorNumericUpDown.Value, (byte)aColorNumericUpDown.Value);
            rect.Load(pos, rotation, layer, color, origin);
            return rect;
        }
示例#2
0
 private void SetRectangle()
 {
     FrameRectangle rect = new FrameRectangle();
     Vector2 origin;
     origin = new Vector2((float)xOriginNumericUpDown.Value, (float)yOriginNumericUpDown.Value);
     Microsoft.Xna.Framework.Rectangle pos;
     Microsoft.Xna.Framework.Color color = new Microsoft.Xna.Framework.Color(
         (byte)rColorNumericUpDown.Value,
         (byte)gColorNumericUpDown.Value,
         (byte)bColorNumericUpDown.Value,
         (byte)aColorNumericUpDown.Value);
     pos = new Microsoft.Xna.Framework.Rectangle(
         (int)xPositionNumericUpDown.Value,
         (int)yPositionNumericUpDown.Value,
         (int)widthNumericUpDown.Value,
         (int)heightNumericUpDown.Value);
     float rotation = (float)rotationNumericUpDown.Value;
     float layer = (float)layerNumericUpDown.Value;
     rect.Load(pos, rotation, layer, color, origin);
     enemyControl.Enemy.Animations.CurrentAnimationKeyframe.GetRectangles[(string)rectangleComboBox.SelectedItem] = rect;
 }