Exemple #1
0
        public LinearPropertyControl()
        {
            // Activates double buffering
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.DoubleBuffer, true);
            selectedLinearProperty = new LinearProperty(5, "Properties", 0, 10);
            selectedLinearProperty.Values.Add(new Vector2(0.5f, 8));
            selectedLinearProperty.Values.Add(new Vector2(0.7f, 9));
            selectedLinearProperty.Values.Add(new Vector2(1f, 0));

            this.textBoxMax            = new TextBox();
            this.textBoxMax.Location   = new System.Drawing.Point(4, 23);
            this.textBoxMax.Name       = "textBoxMax";
            this.textBoxMax.Size       = new System.Drawing.Size(32, 20);
            this.textBoxMax.TabIndex   = 1;
            this.textBoxMax.Text       = selectedLinearProperty.UpperBound.ToString();
            this.textBoxMax.TextAlign  = System.Windows.Forms.HorizontalAlignment.Right;
            this.textBoxMax.Validated += new System.EventHandler(this.textBoxMax_Validated);
            this.textBoxMax.KeyDown   += new System.Windows.Forms.KeyEventHandler(this.textBox_KeyDown);
            this.Controls.Add(textBoxMax);

            this.textBoxMin            = new TextBox();
            this.textBoxMin.Location   = new System.Drawing.Point(4, 205);
            this.textBoxMin.Name       = "textBoxMin";
            this.textBoxMin.Size       = new System.Drawing.Size(32, 20);
            this.textBoxMin.TabIndex   = 2;
            this.textBoxMin.Text       = selectedLinearProperty.LowerBound.ToString();
            this.textBoxMin.TextAlign  = System.Windows.Forms.HorizontalAlignment.Right;
            this.textBoxMin.Validated += new System.EventHandler(this.textBoxMin_Validated);
            this.textBoxMin.KeyDown   += new System.Windows.Forms.KeyEventHandler(this.textBox_KeyDown);
            this.Controls.Add(textBoxMin);
        }
Exemple #2
0
        public void InitializeValues()
        {
            _useSingleParticle = false;
            overLifeSettings   = new OverLifeSettings();

            _life          = new LinearProperty(45, "Life", 0, 100);
            _quantity      = new LinearProperty(100, "Quantity", 0, 100);
            _width         = new LinearProperty(1, "Width", 0, 10);
            _height        = new LinearProperty(1, "Height", 0, 10);
            _weight        = new LinearProperty(0, "Weight", -10, 10);
            _velocity      = new LinearProperty(4, "Velocity", 0, 10);
            _spin          = new LinearProperty(0, "Spin", -10, 10);
            _motionRandom  = new LinearProperty(0, "Motion Random", 0, 100);
            _opacity       = new LinearProperty(1, "Opacity", 0, 1);
            _emissionAngle = new LinearProperty(0, "Emission Angle", 0, 360);
            _emissionRange = new LinearProperty(360, "Emission Range", 0, 360);
            _redTint       = new LinearProperty(1, "Red Tint", 0, 1);
            _greenTint     = new LinearProperty(1, "Green Tint", 0, 1);
            _blueTint      = new LinearProperty(1, "Blue Tint", 0, 1);

            _lifeVariation         = new LinearProperty(0, "Life Variation", 0, 200);
            _quantityVariation     = new LinearProperty(0, "Quantity Variation", 0, 250);
            _widthVariation        = new LinearProperty(0, "Width Variation", 0, 10);
            _heightVariation       = new LinearProperty(0, "Height Variation", 0, 10);
            _weightVariation       = new LinearProperty(0, "Weight Variation", 0, 10);
            _velocityVariation     = new LinearProperty(0, "Velocity Variation", 0, 10);
            _spinVariation         = new LinearProperty(0, "Spin Variation", 0, 10);
            _motionRandomVariation = new LinearProperty(0, "Motion Random Variation", 0, 10);
            _opacityVariation      = new LinearProperty(0, "Opacity Variation", 0, 4);
            _redTintVariation      = new LinearProperty(0, "Red Tint Variation", 0, 4);
            _greenTintVariation    = new LinearProperty(0, "Green Tint Variation", 0, 4);
            _blueTintVariation     = new LinearProperty(0, "Blue Tint Variation", 0, 4);
        }
        private void SelectNewEffect(IceEffect effect)
        {
            bool paramtersBoxEnabled = false;

            comboBoxParameters.Items.Clear();
            comboBoxParameters.SelectedItem = null;
            comboBoxParameters.SelectedText = "";
            comboBoxParameters.Text         = "";
            // if the effect is a new one
            if (effect != PostProcessAnimation.IceEffect)
            {
                PostProcessAnimation.IceEffect = effect;
                // load the default properties for this effect
                for (int i = 0; i < 8; i++)
                {
                    LinearProperty selectedLinearProperty = PostProcessAnimation.LinearProperties[i];
                    if (effect.ParametersProperties != null && i < effect.ParametersProperties.Length &&
                        effect.ParametersProperties[i] != null)
                    {
                        // use the effect's default linear property
                        effect.ParametersProperties[i].CopyValuesTo(selectedLinearProperty);
                    }
                    else
                    {
                        selectedLinearProperty = new LinearProperty(0, String.Empty, 0, 10);
                    }
                }
            }
            if (PostProcessAnimation.IceEffect.ParametersProperties != null)
            {
                for (int i = 0; i < PostProcessAnimation.IceEffect.ParametersProperties.Length; i++)
                {
                    if (PostProcessAnimation.IceEffect.ParametersProperties[i] != null)
                    {
                        comboBoxParameters.Items.Add(PostProcessAnimation.IceEffect.ParametersProperties[i].Description);
                    }
                }
                // select the first index if possible
                if (PostProcessAnimation.IceEffect.ParametersProperties.Length >= 1)
                {
                    comboBoxParameters.SelectedIndex = 0;
                    paramtersBoxEnabled = true;
                }
            }
            if (paramtersBoxEnabled == false)
            {
                comboBoxParameters.Enabled    = false;
                labelParameters.Enabled       = false;
                linearPropertyControl.Visible = false;
            }
            else
            {
                comboBoxParameters.Enabled    = true;
                labelParameters.Enabled       = true;
                linearPropertyControl.Visible = true;
            }
        }
Exemple #4
0
 public Emitter()
 {
     particleTypes            = new List <ParticleType>();
     shape                    = new EmitterShape(EmitterShapeType.Point);
     emissionAngle            = new LinearProperty(0, "Emission Angle", 0, 360);
     emissionRange            = new LinearProperty(360, "Emission Range", 0, 360);
     globalOpacityModifier    = new LinearProperty(1, "Global Opacity Modifier", 0, 1);
     _attractorEnabled        = false;
     _attractorForce          = 2f;
     _attractorPositionOffset = new Vector2(0, 0);
     _isStopped               = false;
     _isPaused                = false;
 }
Exemple #5
0
 public OverLifeSettings()
 {
     float defaultValue = 1.0f;
     widthOverLife = new LinearProperty(defaultValue, "Width Over Life", 0, 10);
     heightOverLife = new LinearProperty(defaultValue, "Height Over Life", 0, 10);
     velocityOverLife = new LinearProperty(defaultValue, "Velocity Over Life", 0, 10);
     weightOverLife = new LinearProperty(defaultValue, "Weight Over Life", 0, 10);
     spinOverLife = new LinearProperty(defaultValue, "Spin Over Life", 0, 10);
     motionRandomOverLife = new LinearProperty(defaultValue, "Motion Random Over Life", 0, 10);
     opacityOverLife = new LinearProperty(defaultValue, "Opacity Over Life", 0, 10);
     redTintOverLife = new LinearProperty(defaultValue, "Red Tint Over Life", 0, 10);
     greenTintOverLife = new LinearProperty(defaultValue, "Green Tint Over Life", 0, 10);
     blueTintOverLife = new LinearProperty(defaultValue, "Blue Tint Over Life", 0, 10);
 }
        public OverLifeSettings()
        {
            float defaultValue = 1.0f;

            widthOverLife        = new LinearProperty(defaultValue, "Width Over Life", 0, 10);
            heightOverLife       = new LinearProperty(defaultValue, "Height Over Life", 0, 10);
            velocityOverLife     = new LinearProperty(defaultValue, "Velocity Over Life", 0, 10);
            weightOverLife       = new LinearProperty(defaultValue, "Weight Over Life", 0, 10);
            spinOverLife         = new LinearProperty(defaultValue, "Spin Over Life", 0, 10);
            motionRandomOverLife = new LinearProperty(defaultValue, "Motion Random Over Life", 0, 10);
            opacityOverLife      = new LinearProperty(defaultValue, "Opacity Over Life", 0, 10);
            redTintOverLife      = new LinearProperty(defaultValue, "Red Tint Over Life", 0, 10);
            greenTintOverLife    = new LinearProperty(defaultValue, "Green Tint Over Life", 0, 10);
            blueTintOverLife     = new LinearProperty(defaultValue, "Blue Tint Over Life", 0, 10);
        }
 public PostProcessAnimation(SquidEffect iceEffect)
 {
     _iceEffect                       = iceEffect;
     _iceEffectParameters             = new SquidEffectParameters();
     _ppRequest                       = new PostProcessRequest();
     _ppRequest.SquidEffect           = _iceEffect;
     _ppRequest.SquidEffectParameters = _iceEffectParameters;
     _linearProperties                = new LinearProperty[8];
     for (int i = 0; i < _linearProperties.Length; i++)
     {
         _linearProperties[i] = new LinearProperty(1.0f, "Parameter " + i, 0, 10);
     }
     _currentLife         = 0;
     _life                = 1;
     _currentLife         = 0;
     _maxLife             = _life * 60;
     _loopMax             = 0;
     _loopCounter         = 0;
     _isPaused            = false;
     _isStopped           = false;
     this.AutoPlay        = true;
     this.HideWhenStopped = true;
 }
		public PostProcessAnimation(IceEffect iceEffect)
        {
            _iceEffect = iceEffect;
            _iceEffectParameters = new IceEffectParameters();
            _ppRequest = new PostProcessRequest();
            _ppRequest.IceEffect = _iceEffect;
            _ppRequest.IceEffectParameters = _iceEffectParameters;
            _linearProperties = new LinearProperty[8];
            for (int i = 0; i < _linearProperties.Length; i++)
            {
                _linearProperties[i] = new LinearProperty(1.0f, "Parameter " + i, 0, 10);
            }
            _currentLife = 0;
            _life = 1;
            _currentLife = 0;
            _maxLife = _life * 60;
            _loopMax = 0;
            _loopCounter = 0;
            _isPaused = false;
            _isStopped = false;
            this.AutoPlay = true;
            this.HideWhenStopped = true;
            this.OwnLayerOnly = false;
        }
Exemple #9
0
 public Emitter()
 {
     particleTypes = new List<ParticleType>();
     shape = new EmitterShape(EmitterShapeType.Point);
     emissionAngle = new LinearProperty(0, "Emission Angle", 0, 360);
     emissionRange = new LinearProperty(360, "Emission Range", 0, 360);
     globalOpacityModifier = new LinearProperty(1, "Global Opacity Modifier", 0, 1);
     _attractorEnabled = false;
     _attractorForce = 2f;
     _attractorPositionOffset = new Vector2(0, 0);
     _isStopped = false;
     _isPaused = false;
 }
Exemple #10
0
        public void InitializeValues()
        {
            _useSingleParticle = false;
            overLifeSettings = new OverLifeSettings();

            _life = new LinearProperty(45, "Life", 0, 100);
            _quantity = new LinearProperty(100, "Quantity", 0, 100);
            _width = new LinearProperty(1, "Width", 0, 10);
            _height = new LinearProperty(1, "Height", 0, 10);
            _weight = new LinearProperty(0, "Weight", -10, 10);
            _velocity = new LinearProperty(4, "Velocity", 0, 10);
            _spin = new LinearProperty(0, "Spin", -10, 10);
            _motionRandom = new LinearProperty(0, "Motion Random", 0, 100);
            _opacity = new LinearProperty(1, "Opacity", 0, 1);
            _emissionAngle = new LinearProperty(0, "Emission Angle", 0, 360);
            _emissionRange = new LinearProperty(360, "Emission Range", 0, 360);
            _redTint = new LinearProperty(1, "Red Tint", 0, 1);
            _greenTint = new LinearProperty(1, "Green Tint", 0, 1);
            _blueTint = new LinearProperty(1, "Blue Tint", 0, 1);

            _lifeVariation = new LinearProperty(0, "Life Variation", 0, 200);
            _quantityVariation = new LinearProperty(0, "Quantity Variation", 0, 250);
            _widthVariation = new LinearProperty(0, "Width Variation", 0, 10);
            _heightVariation = new LinearProperty(0, "Height Variation", 0, 10);
            _weightVariation = new LinearProperty(0, "Weight Variation", 0, 10);
            _velocityVariation = new LinearProperty(0, "Velocity Variation", 0, 10);
            _spinVariation = new LinearProperty(0, "Spin Variation", 0, 10);
            _motionRandomVariation = new LinearProperty(0, "Motion Random Variation", 0, 10);
            _opacityVariation = new LinearProperty(0, "Opacity Variation", 0, 4);
            _redTintVariation = new LinearProperty(0, "Red Tint Variation", 0, 4);
            _greenTintVariation = new LinearProperty(0, "Green Tint Variation", 0, 4);
            _blueTintVariation = new LinearProperty(0, "Blue Tint Variation", 0, 4);          
        }
Exemple #11
0
        private static SceneItem LoadPostProcessAnimation(XmlNode _node, SceneBase scene)
        {
            PostProcessAnimation pp = null;
			#if !REACH
            string effectSource = _node.Attributes["effectSource"].Value;
            string effectRef = _node.Attributes["effectRef"].Value;
            if (effectSource.ToUpper() == "EMBEDDED")
            {
                foreach (var item in DrawingManager.EmbeddedIceEffects)
                {
                    if (item.Name == effectRef)
                    {
                        pp = new PostProcessAnimation(item);
                        break;
                    }
                }
            }
            if (effectSource.ToUpper() == "GLOBAL")
            {
                foreach (var item in SceneManager.GlobalDataHolder.Effects)
                {
                    if (item.Name == effectRef)
                    {
                        pp = new PostProcessAnimation(item);
                        break;
                    }
                }
            }
            if (effectSource.ToUpper() == "LOCAL")
            {
                foreach (var item in scene.Effects)
                {
                    if (item.Name == effectRef)
                    {
                        pp = new PostProcessAnimation(item);
                        break;
                    }
                }
            }


            LoadBaseSceneItem(_node, pp);
            SetIAnimationProperties(_node, pp);
            XmlNode gridsettings = _node.SelectSingleNode("Properties");
            int i = 0;
            foreach (XmlNode item in gridsettings.ChildNodes)
            {
                LinearProperty lin = new LinearProperty();
                XmlNode _linnode = item;
                lin.Description = _linnode.SelectSingleNode("Description").InnerText;
                lin.LowerBound = int.Parse(_linnode.SelectSingleNode("LowerBound").InnerText,
                    CultureInfo.InvariantCulture);
                lin.UpperBound = int.Parse(_linnode.SelectSingleNode("UpperBound").InnerText,
                    CultureInfo.InvariantCulture);

                foreach (XmlNode item1 in _linnode.SelectSingleNode("Values").ChildNodes)
                {
                    lin.Values.Add(new Vector2(
                        float.Parse(item1.SelectSingleNode("X").InnerText, CultureInfo.InvariantCulture),
                        float.Parse(item1.SelectSingleNode("Y").InnerText, CultureInfo.InvariantCulture)));
                }
                pp.LinearProperties[i] = lin;
                i++;
            }
#endif
            return pp;
        }