Skip to content

Instantly share code, notes, and snippets.

@posaunehm
Created December 9, 2012 14:44
Show Gist options
  • Select an option

  • Save posaunehm/4245359 to your computer and use it in GitHub Desktop.

Select an option

Save posaunehm/4245359 to your computer and use it in GitHub Desktop.
irof-san implemented WPF.
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing"
x:Class="IroPf.MainWindow"
x:Name="Window"
Title="MainWindow"
Width="640" Height="480">
<Window.Resources>
<Storyboard x:Key="speaking" AutoReverse="True" RepeatBehavior="Forever">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(ed:Arc.StartAngle)" Storyboard.TargetName="face">
<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="-80"/>
<EasingDoubleKeyFrame KeyTime="0:0:1" Value="-65"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(ed:Arc.EndAngle)" Storyboard.TargetName="face">
<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="260"/>
<EasingDoubleKeyFrame KeyTime="0:0:1" Value="245"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="saying" AutoReverse="True" RepeatBehavior="Forever">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="point2">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.25" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="1"/>
<EasingDoubleKeyFrame KeyTime="0:0:1.3" Value="1"/>
<EasingDoubleKeyFrame KeyTime="0:0:1.5" Value="1"/>
<EasingDoubleKeyFrame KeyTime="0:0:1.75" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="point3">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.25" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.75" Value="1"/>
<EasingDoubleKeyFrame KeyTime="0:0:1.3" Value="1"/>
<EasingDoubleKeyFrame KeyTime="0:0:1.5" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="point4">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.25" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.75" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:1" Value="1"/>
<EasingDoubleKeyFrame KeyTime="0:0:1.3" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="point1">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.25" Value="1"/>
<EasingDoubleKeyFrame KeyTime="0:0:1.3" Value="1"/>
<EasingDoubleKeyFrame KeyTime="0:0:1.5" Value="1"/>
<EasingDoubleKeyFrame KeyTime="0:0:1.75" Value="1"/>
<EasingDoubleKeyFrame KeyTime="0:0:2" Value="0"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="lighting" AutoReverse="True" RepeatBehavior="Forever">
<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="eye">
<EasingColorKeyFrame KeyTime="0:0:0.5" Value="#FFED2E2E"/>
<EasingColorKeyFrame KeyTime="0:0:1" Value="#FFF4F4F5"/>
</ColorAnimationUsingKeyFrames>
</Storyboard>
</Window.Resources>
<Window.Triggers>
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
<BeginStoryboard x:Name="speaking_BeginStoryboard" Storyboard="{StaticResource speaking}"/>
<BeginStoryboard x:Name="saying_BeginStoryboard" Storyboard="{StaticResource saying}"/>
<BeginStoryboard x:Name="lighting_BeginStoryboard" Storyboard="{StaticResource lighting}"/>
</EventTrigger>
</Window.Triggers>
<Grid x:Name="LayoutRoot" ClipToBounds="True">
<Grid HorizontalAlignment="Right" Margin="0,171,-43,-80" Width="350" RenderTransformOrigin="0.5,0.5">
<Grid.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="11.31"/>
<TranslateTransform/>
</TransformGroup>
</Grid.RenderTransform>
<ed:Arc x:Name="face" ArcThickness="1" ArcThicknessUnit="Percent" EndAngle="245" Fill="#FFF4F4F5" Stretch="None" Stroke="Black" StartAngle="-65" StrokeThickness="4" Height="350" VerticalAlignment="Bottom">
<ed:GeometryEffect.GeometryEffect>
<ed:SketchGeometryEffect/>
</ed:GeometryEffect.GeometryEffect>
</ed:Arc>
<ed:Arc x:Name="eye" ArcThickness="1" ArcThicknessUnit="Percent" EndAngle="360" Fill="#FFF4F4F5" Margin="154,80,146,0" Stretch="None" Stroke="Black" StrokeThickness="4" Height="50" VerticalAlignment="Top">
<ed:GeometryEffect.GeometryEffect>
<ed:SketchGeometryEffect/>
</ed:GeometryEffect.GeometryEffect>
</ed:Arc>
</Grid>
<ed:Callout AnchorPoint="0.763,1.208" CalloutStyle="Oval" Fill="#FFF4F4F5" FontSize="14.667" Margin="8,8,262,0" Stroke="Black" StrokeThickness="4" Height="196" VerticalAlignment="Top">
<ed:GeometryEffect.GeometryEffect>
<ed:SketchGeometryEffect/>
</ed:GeometryEffect.GeometryEffect>
<StackPanel Height="25" Orientation="Horizontal">
<ed:Arc x:Name="point1" ArcThickness="1" ArcThicknessUnit="Percent" EndAngle="360" Fill="Black" HorizontalAlignment="Left" Stretch="None" Stroke="Black" Width="25" StrokeThickness="4" Height="25">
<ed:GeometryEffect.GeometryEffect>
<ed:SketchGeometryEffect/>
</ed:GeometryEffect.GeometryEffect>
</ed:Arc>
<ed:Arc x:Name="point2" ArcThickness="1" ArcThicknessUnit="Percent" EndAngle="360" Fill="Black" HorizontalAlignment="Left" Stretch="None" Stroke="Black" Width="25" StrokeThickness="4" Height="25" Margin="30,0,0,0">
<ed:GeometryEffect.GeometryEffect>
<ed:SketchGeometryEffect/>
</ed:GeometryEffect.GeometryEffect>
</ed:Arc>
<ed:Arc x:Name="point3" ArcThickness="1" ArcThicknessUnit="Percent" EndAngle="360" Fill="Black" HorizontalAlignment="Right" Stretch="None" Stroke="Black" Width="25" StrokeThickness="4" Height="25" Margin="30,0,0,0">
<ed:GeometryEffect.GeometryEffect>
<ed:SketchGeometryEffect/>
</ed:GeometryEffect.GeometryEffect>
</ed:Arc>
<ed:Arc x:Name="point4" ArcThickness="1" ArcThicknessUnit="Percent" EndAngle="360" Fill="Black" HorizontalAlignment="Right" Stretch="None" Stroke="Black" Width="25" StrokeThickness="4" Height="25" Margin="30,0,0,0">
<ed:GeometryEffect.GeometryEffect>
<ed:SketchGeometryEffect/>
</ed:GeometryEffect.GeometryEffect>
</ed:Arc>
</StackPanel>
</ed:Callout>
</Grid>
</Window>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment