Chase and tickle the characters
The child when moving the mouse causes a random animation to be applied to the OnMouseOver'd shape.
Clicking on the shape results in laughter and it jumping away.
I already have this code complete if you would like it. This is the version I used.
Functionality coded as requested by my 2,4&5 yr old rugrat testers.
Some demons with Dual screen draw artifacts in your original code which I have also tidied by clearing and dequeing the ellispes on window.OnExit
In addition I removed your abritrary 30 for queue length and linked it to Settings.Default.ClearAfter
Fixes in the code.
2 comments
-
simonjohnroberts
commented
The previous comment fixes the isDrawing artifacts.
Chase & Tickle would be something like:
void HandleMouseover(object sender, MouseEventArgs e)
{
UserControl f = e.Source as UserControl;
if (f != null && f.Opacity > 0.1) //can it be seen?
{
Animation.ApplyRandomAnimationEffect(f, Duration.Automatic);
Point eGetPosition = e.GetPosition(this.windows[0]);Transform g = f.RenderTransform;
TranslateTransform tt = new TranslateTransform(-(eGetPosition.X/2), -(eGetPosition.Y/2));
TransformGroup tg = new TransformGroup();
tg.Children.Add(f.RenderTransform);
tg.Children.Add(tt);
f.RenderTransform = tg;
}
}What do you think?
-
simonjohnroberts
commented
void m_MouseLeave(object sender, MouseEventArgs e)
{
MainWindow main = (MainWindow)sender;while (ellipsesQueue.Count > 0)
{
Shape shapeToRemove = ellipsesQueue.Dequeue();main.mouseDragCanvas.Children.Remove(shapeToRemove);
}
}