Ejemplo n.º 1
0
        public CurvePresetLibrary()
        {
            CurvePreset[] presets = new CurvePreset[]
            {
                new CurvePreset(GetConstantKeys(1.0f)),
                new CurvePreset(GetLinearKeys()),
                new CurvePreset(GetLinearMirrorKeys()),
                new CurvePreset(GetEaseInKeys()),
                new CurvePreset(GetEaseInMirrorKeys()),
                new CurvePreset(GetEaseInOutKeys()),
                new CurvePreset(GetEaseInOutMirrorKeys()),
                new CurvePreset(GetEaseOutKeys()),
                new CurvePreset(GetEaseOutMirrorKeys()),
            };

            base.Columns = presets.Length;
            base.Rows    = 1;

            for (int i = 0; i < presets.Length; i++)
            {
                presets[i].Column = i;
                this.Controls.Add(presets[i]);
                presets[i].Click += Preset_Click;
            }
        }
Ejemplo n.º 2
0
 void Preset_Click(object sender, System.EventArgs e)
 {
     Preset = (CurvePreset)sender;
     OnPresetSelected();
 }