public int GetFrameCount(FrameType type, PMDToolkit.Maps.Direction8 dir) { Dictionary<PMDToolkit.Maps.Direction8, int> dirs = null; if (frameCount.TryGetValue(type, out dirs)) { int value = 0; if (dirs.TryGetValue(dir, out value)) { return value; } } return 0; }
public TileSheet GetSheet(FrameType type, PMDToolkit.Maps.Direction8 dir) { if (IsFrameTypeDirectionless(type)) { dir = PMDToolkit.Maps.Direction8.Down; } if (animations.ContainsKey(type)) { if (animations[type].ContainsKey(dir)) { return animations[type][dir]; } } return TextureManager.ErrorTexture; }
public void AddSheet(FrameType type, PMDToolkit.Maps.Direction8 dir, TileSheet surface) { if (!animations.ContainsKey(type)) { animations.Add(type, new Dictionary<PMDToolkit.Maps.Direction8, TileSheet>()); } if (animations[type].ContainsKey(dir) == false) { animations[type].Add(dir, surface); } else { animations[type][dir] = surface; } }
public Rectangle GetFrameBounds(FrameType frameType, PMDToolkit.Maps.Direction8 direction, int frameNum) { Rectangle rec = new Rectangle(); rec.X = frameNum * frameData.FrameWidth; rec.Y = 0; rec.Width = frameData.FrameWidth; rec.Height = frameData.FrameHeight; return rec; }
public void SetFrameCount(FrameType type, PMDToolkit.Maps.Direction8 dir, int count) { if (frameCount.ContainsKey(type) == false) { frameCount.Add(type, new Dictionary<PMDToolkit.Maps.Direction8, int>()); } if (frameCount[type].ContainsKey(dir) == false) { frameCount[type].Add(dir, count); } else { frameCount[type][dir] = count; } }