load JSON files directly instead of embedding in XML.
This commit is contained in:
parent
4bcb0d9b95
commit
654bb7fe97
@ -1,11 +1,19 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Content;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System.IO;
|
||||
|
||||
// All extension methods on built-in types (of C# or MonoGame) go in this file.
|
||||
// Methods are ordered alphabetically by type name.
|
||||
|
||||
namespace SemiColinGames {
|
||||
static class ExtensionMethods {
|
||||
// ContentManager
|
||||
public static string LoadString(this ContentManager content, string path) {
|
||||
string fullPath = Path.Combine(content.RootDirectory, path);
|
||||
return File.ReadAllText(fullPath);
|
||||
}
|
||||
|
||||
// Point
|
||||
public static void Deconstruct(this Point point, out int x, out int y) =>
|
||||
(x, y) = (point.X, point.Y);
|
||||
|
@ -83,7 +83,7 @@ namespace SemiColinGames {
|
||||
|
||||
public static void Load(ContentManager content) {
|
||||
Executioner = new Sprite(
|
||||
Textures.Executioner, content.Load<string>("sprites/ccg/executioner_female_json"));
|
||||
Textures.Executioner, content.LoadString("sprites/ccg/executioner_female.json"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user