|
using System;
namespace CP.Apps.ScreenSaver.Effects
{
public enum MovementDirection
{
Up = 0,
Down = 1,
Left = 2,
Right = 3
}
public delegate void ComputeMovementDelegate(ref int x, ref int y, int step);
public class Movement
{
public static void GetImageSizeForMovement(ref int width, ref int height, int step, MovementDirection dir)
{
switch(dir)
{
case MovementDirection.Down:
case MovementDirection.Up:
height += step;
break;
default:
width += step;
break;
}
}
public static void GetImagePosForMovement(ref int x, ref int y, int step, MovementDirection dir)
{
switch(dir)
{
case MovementDirection.Down:
y += step;
break;
case MovementDirection.Right:
x += step;
break;
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.