Erstellen Sie echte Softwareanimationen (Lingo)C#

Ein Treffpunkt für C#-Programmierer
Anonymous
 Erstellen Sie echte Softwareanimationen (Lingo)

Post by Anonymous »

Ich erstelle das Lingo-Spiel von TV (Holland). Nur die letzten Details sind die Animationen. Die Kugeln sind als Gitter, Rand, Beschriftung und 2 Polygone für oben und unten aufgebaut. Der Hintergrund und die „gelbe Überlagerung“ werden mit einem Farbverlauf gefüllt. Jetzt ist es nur noch eine einfache Versteck- und Anzeigeanimation für den Rand. Aber es ist nicht spielerisch.
Kann ich etwas Hilfe dabei haben? Ich dachte so etwas wie den Stopp zu animieren und ihn gleichzeitig zu drehen? Vielen Dank im Voraus
Aktuelle Animation

Code: Select all

            RadialGradientBrush ball = new RadialGradientBrush
{
GradientOrigin = new Point(0.6, 0.2)
};

GradientStop stop1 = new GradientStop(Colors.Blue, 0.0);
GradientStop stop2 = new GradientStop(Colors.DarkBlue, 0.8);
ball.GradientStops.Add(stop1);
ball.GradientStops.Add(stop2);
Overlay.Background = Blue_ball;

await Task.Delay(100);
SoundPlayer Ball_remove = new SoundPlayer { Stream = Properties.Resources.Ball_remove };
Ball_remove.Play();

DoubleAnimation ca = new DoubleAnimation()
{
From = 1.0,
To = 0.0,
Duration = new Duration(TimeSpan.FromMilliseconds(75)),
RepeatBehavior = new RepeatBehavior(3.0),
AutoReverse = true
};

Storyboard.SetTarget(ca, Overlay);
Storyboard.SetTargetProperty(ca, new PropertyPath("Opacity"));

Storyboard sb = new Storyboard();
sb.Children.Add(ca);
sb.Begin();
Verlaufsfüllung für den Ball

Code: Select all

                    



















Code für den Ball

Code: Select all

Grid Ball_base = new Grid()
{
Background = new SolidColorBrush(Colors.Transparent),
Width = 118,
Height = 118,
};

Border Ball_border = new Border
{
BorderThickness = new Thickness(5),
BorderBrush = new SolidColorBrush(Colors.Transparent),
Background = Blue_ball,
CornerRadius = new CornerRadius(100),
Width = 118,
Height = 118
};

Label Ball_label = new Label
{
Height = 118,
FontFamily = new FontFamily("Microsoft Sans Serif"),
Content = 99,
HorizontalAlignment = HorizontalAlignment.Stretch,
HorizontalContentAlignment = HorizontalAlignment.Center,
VerticalContentAlignment = VerticalAlignment.Center,
Margin = new Thickness(0, 0, 0, 0),
FontSize = 120,
Foreground = new SolidColorBrush(Colors.White),
Background = null,
};

Polygon Up = new Polygon
{
Fill = new SolidColorBrush(Colors.Transparent),
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Top,
Margin = new Thickness(10),
};

Polygon Down = new Polygon
{
Fill = new SolidColorBrush(Colors.Transparent),
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Bottom,
Margin = new Thickness(10),
};

Point Point1 = new Point(0, 0);
Point Point2 = new Point(30, 00);
Point Point3 = new Point(15, 15);

PointCollection Polygones = new PointCollection
{
Point1,
Point2,
Point3
};

Up.Points = Polygones;
Down.Points = Polygones;
RotateTransform myRotateTransform = new RotateTransform
{
CenterX = 15,
CenterY = 7,
};

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post