-
Notifications
You must be signed in to change notification settings - Fork 0
/
Resource.fs
34 lines (28 loc) · 1.14 KB
/
Resource.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
namespace Brains
open System.Collections.Generic
open Microsoft.Xna.Framework.Graphics
open Microsoft.Xna.Framework.Audio
type Resource =
{
Effects : Dictionary<string, Effect>;
Sounds : Dictionary<string, SoundEffect>;
Models : Dictionary<string, Model>;
// BoneTransforms : Matrix[];
Fonts : Dictionary<string, SpriteFont>;
SpriteBatch : Dictionary<string, SpriteBatch>;
Texture2D : Dictionary<string, Texture2D>;
}
with
static member Default =
{
Effects = new Dictionary<string, Effect>();
Sounds = new Dictionary<string, SoundEffect>();
Models = new Dictionary<string, Model>();
// BoneTransforms = Array.init 1 (fun i -> Matrix());
Fonts = new Dictionary<string, SpriteFont>();
SpriteBatch = new Dictionary<string, SpriteBatch>();
Texture2D = new Dictionary<string, Texture2D>();
}
member this.Load(xna : XNAEngine) =
this.SpriteBatch.["hud"] <- new SpriteBatch(xna.gd)
this.Texture2D.["circle"] <- Texture2D.FromFile(xna.gd, "../../circle.png")