Skip to content

Commit

Permalink
Changes to Interactive Effects
Browse files Browse the repository at this point in the history
Added Arrow Flow and Key Wave (filled) interactive effects
Changed to AnimationMixes for interactive effects, easier to add new
effects + later users can define their own effects.
  • Loading branch information
antonpup committed Jun 23, 2016
1 parent 50c789b commit d7b5f36
Show file tree
Hide file tree
Showing 13 changed files with 173 additions and 115 deletions.
10 changes: 5 additions & 5 deletions Project-Aurora/EffectsEngine/Animations/AnimationCircle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ public AnimationCircle(float x, float y, float radius, Color color, int width =

public override void Draw(Graphics g)
{
Pen pen = new Pen(_color);
pen.Width = _width;
pen.Alignment = System.Drawing.Drawing2D.PenAlignment.Center;
_pen = new Pen(_color);
_pen.Width = _width;
_pen.Alignment = System.Drawing.Drawing2D.PenAlignment.Center;

g.DrawEllipse(pen, _dimension);
g.DrawEllipse(_pen, _dimension);

pen.Dispose();
_pen.Dispose();
}

public override AnimationFrame BlendWith(AnimationFrame otherAnim, double amount)
Expand Down
10 changes: 5 additions & 5 deletions Project-Aurora/EffectsEngine/Animations/AnimationEllipse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ public AnimationEllipse(float x, float y, float x_axis, float y_axis, Color colo

public override void Draw(Graphics g)
{
Pen pen = new Pen(_color);
pen.Width = _width;
pen.Alignment = System.Drawing.Drawing2D.PenAlignment.Center;
_pen = new Pen(_color);
_pen.Width = _width;
_pen.Alignment = System.Drawing.Drawing2D.PenAlignment.Center;

g.DrawEllipse(pen, _dimension);
g.DrawEllipse(_pen, _dimension);

pen.Dispose();
_pen.Dispose();
}

public override AnimationFrame BlendWith(AnimationFrame otherAnim, double amount)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ public AnimationFilledCircle(float x, float y, float radius, Color color, int wi

public override void Draw(Graphics g)
{
Brush brush = new SolidBrush(_color);
_brush = new SolidBrush(_color);

g.FillEllipse(brush, _dimension);
g.FillEllipse(_brush, _dimension);

brush.Dispose();
_brush.Dispose();
}

public override AnimationFrame BlendWith(AnimationFrame otherAnim, double amount)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ public AnimationFilledRectangle(float x, float y, float rect_width, float rect_h

public override void Draw(Graphics g)
{
Brush brush = new SolidBrush(_color);
_brush = new SolidBrush(_color);

g.FillRectangle(brush, _dimension_int);
g.FillRectangle(_brush, _dimension_int);

brush.Dispose();
_brush.Dispose();
}

public override AnimationFrame BlendWith(AnimationFrame otherAnim, double amount)
Expand Down
9 changes: 3 additions & 6 deletions Project-Aurora/EffectsEngine/Animations/AnimationFrame.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;

namespace Aurora.EffectsEngine.Animations
{
Expand All @@ -12,6 +7,8 @@ public class AnimationFrame
internal Color _color;
internal RectangleF _dimension;
internal int _width;
internal Pen _pen;
internal Brush _brush;

public AnimationFrame()
{
Expand Down
14 changes: 5 additions & 9 deletions Project-Aurora/EffectsEngine/Animations/AnimationLine.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Aurora.EffectsEngine.Animations
{
Expand Down Expand Up @@ -73,13 +69,13 @@ public override void Draw(Graphics g)
if (_start_point.Equals(_end_point))
return;

Pen pen = new Pen(new LinearGradientBrush(_start_point, _end_point, _color, _end_color));
pen.Width = _width;
pen.Alignment = System.Drawing.Drawing2D.PenAlignment.Center;
_pen = new Pen(new LinearGradientBrush(_start_point, _end_point, _color, _end_color));
_pen.Width = _width;
_pen.Alignment = System.Drawing.Drawing2D.PenAlignment.Center;

g.DrawLine(pen, _start_point, _end_point);
g.DrawLine(_pen, _start_point, _end_point);

pen.Dispose();
_pen.Dispose();
}

public override AnimationFrame BlendWith(AnimationFrame otherAnim, double amount)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Aurora.EffectsEngine.Animations
{
Expand Down
6 changes: 1 addition & 5 deletions Project-Aurora/EffectsEngine/Animations/AnimationMix.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Aurora.EffectsEngine.Animations
{
Expand Down
10 changes: 5 additions & 5 deletions Project-Aurora/EffectsEngine/Animations/AnimationRectangle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ public AnimationRectangle(float x, float y, float rect_width, float rect_height,

public override void Draw(Graphics g)
{
Pen pen = new Pen(_color);
pen.Width = _width;
pen.Alignment = System.Drawing.Drawing2D.PenAlignment.Center;
_pen = new Pen(_color);
_pen.Width = _width;
_pen.Alignment = System.Drawing.Drawing2D.PenAlignment.Center;

g.DrawRectangle(pen, _dimension_int);
g.DrawRectangle(_pen, _dimension_int);

pen.Dispose();
_pen.Dispose();
}

public override AnimationFrame BlendWith(AnimationFrame otherAnim, double amount)
Expand Down
6 changes: 1 addition & 5 deletions Project-Aurora/EffectsEngine/Animations/AnimationTrack.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;

namespace Aurora.EffectsEngine.Animations
{
Expand Down
5 changes: 5 additions & 0 deletions Project-Aurora/EffectsEngine/Functions/EffectPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ public EffectPoint(EffectPoint otherPoint)
Y = otherPoint.Y;
}

public System.Drawing.PointF ToPointF()
{
return new System.Drawing.PointF(X, Y);
}

public override bool Equals(System.Object obj)
{
if (obj == null)
Expand Down
8 changes: 6 additions & 2 deletions Project-Aurora/Profiles/Desktop/DesktopSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ public enum InteractiveEffects
{
[Description("None")]
None = 0,
[Description("Key Wave Effect")]
[Description("Key Wave")]
Wave = 1,
[Description("Key Wave (Filled)")]
Wave_Filled = 3,
[Description("Key Fade")]
KeyPress = 2
KeyPress = 2,
[Description("Arrow Flow")]
ArrowFlow = 4,
}

public class DesktopSettings : ProfileSettings
Expand Down
Loading

0 comments on commit d7b5f36

Please sign in to comment.