コード例 #1
0
ファイル: Menu.cs プロジェクト: knndylx/AlchemyTowerDefense
 public void LoadContent(ContentManager c, List <string> buttonStringList)
 {
     textures = new TextureDict(c, "buttons");
     foreach (var s in buttonStringList)
     {
         buttons.Add(MakeButton(s, 300, 100));
     }
     FinalizeButtons();
 }
コード例 #2
0
 public void LoadContent(ContentManager c, TextureDict mouseTextures)
 {
     toolboxTD          = new TextureDict(c, "toolbox");
     tilesTextureDict   = new TextureDict(c, "tiles");
     decoTextures       = new TextureDict(c, "decos");
     this.mouseTextures = mouseTextures;
     background         = toolboxTD.dict["toolboxbackground"];
     rect = new Rectangle(1280 - background.Width, 0, background.Width, background.Height);
     PopulateToolbox();
 }
コード例 #3
0
 public Stream GetTexture(string name)
 {
     if (TextureDict.TryGetValue(name, out var texture))
     {
         return(texture);
     }
     else
     {
         return(null);
     }
 }
コード例 #4
0
 public void SetTexture(string name, Stream texture)
 {
     if (TextureDict.ContainsKey(name))
     {
         TextureDict[name] = texture;
     }
     else
     {
         TextureDict.Add(name, texture);
     }
     UpdatingResource?.Invoke(this, new UpdateEvent(GenericMaterialVariable.ResourceType.Texture, name));
 }
コード例 #5
0
 public override void LoadContent(ContentManager c)
 {
     tileTextures         = new TextureDict(c, "tiles");
     mouseTextures        = new TextureDict(c, "icons");
     decorationTextures   = new TextureDict(c, "decos");
     brushTexture         = tileTextures.dict["blank"];
     mouseTexture         = mouseTextures.dict["cursor"];
     highlightGridTexture = mouseTextures.dict["highlight"];
     toolbox.LoadContent(c, mouseTextures);
     Map.LoadContent(c);
     base.LoadContent(c);
 }
コード例 #6
0
 public void LoadContent(ContentManager c, string fileName = null)
 {
     textureDict     = new TextureDict(c, "tiles");
     decoTextureDict = new TextureDict(c, "decos");
     Decorations     = new List <Decoration>();
     if (fileName == null)
     {
         terrainTiles = CreateBlankMap();
     }
     else
     {
         LoadFromFile("Map.txt");
     }
 }