private static void LoadPlayerAnimation() { var frames = new ZFrame[3]; for (int i = 0; i < frames.Length; i++) { string path = string.Concat("Textures/Player/", i); //2040016.img ZFrame frame = new ZFrame(); frame.Delay = 500; frame.Texture.Origin = new Vector2(20, 66); frame.Texture.Texture = MainGame.Instance.Content.Load<Texture2D>(path); frames[i] = frame; } PlayerAnimation = new ZAnimation(frames); }
private static void LoadPortalAnimation() { var parent = MapNx.ResolvePath("MapHelper.img/portal/game/pv"); ZFrame[] frames = new ZFrame[parent.ChildCount]; for (int i = 0; i < frames.Length; i++) { var node = parent.ElementAt(i); var bitmap = node.ValueOrDie<Bitmap>(); var origin = node["origin"].ValueOrDie<System.Drawing.Point>(); var frame = new ZFrame(); frame.Delay = 100; frame.Texture.Texture = Factory.FromBitmap(bitmap); frame.Texture.Origin = new Vector2(origin.X, origin.Y); frames[i] = frame; } PortalAnimation = new ZAnimation(frames); }
public ZAnimation(ZFrame[] frames) { Frames = frames; }