Feedback

X

Monogame Sprite Sheet (2K)

_animator.Update(gt); // Handle input, switch to "walk" clip when moving

_texture = texture; _regions = new Dictionary<string, Rectangle>(); int columns = texture.Width / frameWidth; int rows = texture.Height / frameHeight; // Auto-generate named regions: "0_0", "0_1", etc. for (int y = 0; y < rows; y++) for (int x = 0; x < columns; x++) string name = $"x_y"; Rectangle region = new Rectangle( x * frameWidth, y * frameHeight, frameWidth, frameHeight); _regions[name] = region; monogame sprite sheet

_regions[name] = region;