Example #1
0
        private void numericUpDown_ValueChanged(object sender, EventArgs e)
        {
            this.cur = (float)this.numericUpDown.Value;

            this.trackBar.Value = (int)(this.trackBar.Maximum * (this.cur - this._data.min) / (this._data.max - this._data.min));
            ParticleDesign.setDirty();
        }
Example #2
0
        public void setColor(byte R, byte G, byte B)
        {
            this.R = R;
            this.G = G;
            this.B = B;

            this.btnShow.BackColor = Color.FromArgb(R, G, B);
            this.btnColor.Text     = "{r=" + R + ",g=" + G + ",b=" + B + "}";
            ParticleDesign.setDirty();
        }
Example #3
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (particleDesignDialog.Visible == false)
     {
         particleDesignDialog         = new ParticleDesign();
         particleDesignDialog.Visible = true;
     }
     else
     {
         particleDesignDialog.Show();
         particleDesignDialog.Activate();
     }
 }
Example #4
0
        private void trackBar_Scroll(object sender, EventArgs e)
        {
            float percent = (float)this.trackBar.Value / this.trackBar.Maximum;

            this.numericUpDown.Value = (decimal)(percent * (_data.max - _data.min) + _data.min);
            if (_data.isInt)
            {
                this.numericUpDown.Value = Math.Floor(this.numericUpDown.Value);
            }

            this.cur = (float)this.numericUpDown.Value;
            ParticleDesign.setDirty();
        }
Example #5
0
 public void setA(byte _a)
 {
     alpha.Value = _a; ParticleDesign.setDirty();
 }
Example #6
0
 public void setB(byte _b)
 {
     b.Value = _b; ParticleDesign.setDirty();
 }
Example #7
0
 public void setG(byte _g)
 {
     g.Value = _g; ParticleDesign.setDirty();
 }
Example #8
0
 public void setR(byte _r)
 {
     r.Value = _r; ParticleDesign.setDirty();
 }
Example #9
0
        public ParticleDesign()
        {
            InitializeComponent();

            timer.Interval = 100;
            timer.Tick    += timer_Tick;
            timer.Start();

            instance = this;

            openPlistFileDialog.Filter = "粒子Plist文件(*.plist)|*.plist";
            savePlistFileDialog.Filter = "粒子Plist文件(*.plist)|*.plist";
            openPngFileDialog.Filter   = "纹理文件(*.png)|*.png";

            // 粒子设置
            maxParticles.data     = new ParticleOptionData("最大粒子数", 0, 2000, true, "同时存在的最多粒子数量");
            lifeSpan.data         = new ParticleOptionData("生命期(秒)", 0, 10, false, "单个粒子最大存在时间(秒)");
            lifeSpanVar.data      = new ParticleOptionData("生命期变化(秒)", 0, 10, false, "单个粒子最大存在时间随机部分(秒)");
            startSize.data        = new ParticleOptionData("初始大小", 0, 512, true, "粒子出生时大小,单位像素");
            startSizeVar.data     = new ParticleOptionData("初始大小变化", 0, 512, true, "粒子出生时大小随机部分,单位像素");
            finishSize.data       = new ParticleOptionData("结束大小", 0, 512, true, "粒子结束时大小,单位像素");
            finishSizeVar.data    = new ParticleOptionData("结束大小变化", 0, 512, true, "粒子结束时大小变量,单位像素");
            emitAngle.data        = new ParticleOptionData("发射角度", 0, 360, false, "粒子发射的角度");
            emitAngleVar.data     = new ParticleOptionData("发射角度变化", 0, 360, true, "粒子发射的角度变量");
            rotationStart.data    = new ParticleOptionData("旋转起始角度", -3600, 3600, true, "粒子自身旋转起始角度", 0.5f);
            rotationStartVar.data = new ParticleOptionData("旋转起始角度变化", -3600, 3600, true, "粒子自身旋转起始角度变量部分", 0.5f);
            rotationEnd.data      = new ParticleOptionData("旋转终止角度", -3600, 3600, true, "粒子自身旋转终止角度", 0.5f);
            rotationEndVar.data   = new ParticleOptionData("旋转终止角度变化", -3600, 3600, true, "旋转终止角度变量", 0.5f);

            bgColorOption.setColor(0, 0, 0);

            startColor.setName("起始颜色");
            startColorVar.setName("起始颜色变化");
            endColor.setName("结束颜色");
            endColorVar.setName("结束颜色变化");

            emDuration.data = new ParticleOptionData("生命期秒(-1:无限)", -1, 10, false, "发射器生命期,指的是粒子的总生命期", 0f);
            emPosX.data     = new ParticleOptionData("X坐标位置", -1024, 1024, false, "发射器的X坐标", 0.5f);
            emPosXVar.data  = new ParticleOptionData("X坐标变化", -1024, 1024, false, "发射器的X坐标变化", 0.5f);
            emPosY.data     = new ParticleOptionData("Y坐标位置", -1024, 1024, false, "发射器的Y坐标", 0.5f);
            emPosYVar.data  = new ParticleOptionData("Y坐标变化", -1024, 1024, false, "发射器的Y坐标变化", 0.5f);

            emGravitySpeed.data           = new ParticleOptionData("速度", 0, 1024, false, "粒子发射出去的速度,[重力模式]", 0.0f);
            emGravitySpeedVar.data        = new ParticleOptionData("速度变化值", 0, 1024, false, "粒子发射出去的速度变化值,[重力模式]", 0.0f);
            emGravityX.data               = new ParticleOptionData("重力X分量", -3000, 3000, false, "重力在X轴上的分量,[重力模式]", 0.5f);
            emGravityY.data               = new ParticleOptionData("重力Y分量", -3000, 3000, false, "重力在Y轴上的分量,[重力模式]", 0.5f);
            emGravityRadialAccel.data     = new ParticleOptionData("径向加速度", -1024, 1024, false, "等我研究下的 ...[重力模式]", 0.5f);
            emGravityRadialAccelVar.data  = new ParticleOptionData("径向加速度变化值", -1024, 1024, false, "等我研究下的 ...[重力模式]", 0.5f);
            emGravityTangentAccel.data    = new ParticleOptionData("切线加速度", -1024, 1024, false, "等我研究下的 ...[重力模式]", 0.5f);
            emGravityTangentAccelVar.data = new ParticleOptionData("切线加速度变化值", -1024, 1024, false, "等我研究下的 ...[重力模式]", 0.5f);

            emRadialMaxRadius.data       = new ParticleOptionData("最大半径", 0, 1024, false, "粒子出生位置的最大半径[径向模式]", 0.0f);
            emRadialMaxRadiusVar.data    = new ParticleOptionData("最大半径变化", 0, 1024, false, "粒子出生位置的最大半径变化[径向模式]", 0.0f);
            emRadialMinRadius.data       = new ParticleOptionData("最小半径", 0, 1024, false, "粒子出生位置的最小半径[径向模式]", 0.0f);
            emRadialDegPerSecond.data    = new ParticleOptionData("角速度", 0, 360, false, "角速度,0~360[径向模式]", 0.0f);
            emRadialDegPerSecondVar.data = new ParticleOptionData("角速度变化", 0, 360, false, "角速度,0~360[径向模式]", 0.0f);

            radioEmitterGravity.Select();

            updateTitle(false);
        }
Example #10
0
 public void setA(byte v)
 {
     this.alpha.Value = v;
     ParticleDesign.setDirty();
 }