public Animatable(Animatable parent) { ended = false; OnEnd = null; this.b = parent.b; this.c = parent.c; this.e = parent.e; this.startTick = parent.startTick; this.duration = parent.duration; this.type = parent.type; this.keep = false; if (Program.SyncUpdate) { Program.OnUpdateAnimation += update; } }
public Coin(IPoint pos, int points, Color color) { if (points == 0 || !Program.SyncUpdate) { return; } this.font = new Font(Program.FONT, 16 * Program.Scale, FontStyle.Bold); this.text = "+" + points; SizeF sz = (SizeF)Program.window?.CreateGraphics().MeasureString(text, font); this.offset = -sz.Width / 2f; this.pos = new PointF((float)pos.X - sz.Width / 2, (float)pos.Y - sz.Height / 2); this.shadow = new PointF((float)pos.X - sz.Width / 2 + 1f, (float)pos.Y - sz.Height / 2 + 1f); this.m = new Animatable(-.72f, 0, 100, AnimationTypes.SIN); this.c = new SolidBrush(color); Program.OnUpdateAnimation += update = new Action(Update); Program.window.DrawAnimation += draw = new PaintEvent(Draw); m.OnEnd += new Action(Remove); }
public AnimatableColor(Color b, Color e, int duration, AnimationTypes type) { this.b = b; this.e = e; this.p = new Animatable(0, 1, duration, type); }
public AnimatableColor(Color b, Color e, int duration) { this.b = b; this.e = e; this.p = new Animatable(0, 1, duration); }
public Coin(Animatable x, float offset, float y, int points, Color color) : this(new IPoint((float)x + offset, y), points, color) { this.x = new Animatable(x); this.offset += offset; }