/// <summary> /// Unload contents /// </summary> public override void UnloadContent() { Trace.WriteDebugLine("[MainMenu] : UnloadContent"); if (Tileset != null) { Tileset.Dispose(); } Tileset = null; ResourceManager.UnlockSharedAsset <BitmapFont>(Font); Font = null; if (Theme != null) { Theme.Dispose(); } Theme = null; if (Batch != null) { Batch.Dispose(); } Batch = null; StringTable.Dispose(); StringTable = null; Buttons.Clear(); // Buttons = null; }
/// <summary> /// Defines the tileset to use /// </summary> /// <param name="tileset">TileSet handle</param> /// <returns>True on success</returns> /// <remarks>Dispose the current TileSet if present</remarks> static public bool LoadTileSet(TileSet tileset) { if (tileset == null) { return(false); } // Dispose current tileset if (Tileset != null) { Tileset.Dispose(); } Tileset = tileset; // Dispose current texture if (Texture != null) { Texture.Dispose(); } Texture = null; // Convert the Tileset texture to a bitmap if (Tileset.Texture == null) { Trace.WriteLine("[Mouse] LoadTileSet() : No texture bound to the tileset !"); return(false); } Texture = Tileset.Texture.ToBitmap(); return(true); }
/// <summary> /// Unload content /// </summary> public override void UnloadContent() { if (Tileset != null) { Tileset.Dispose(); } Tileset = null; }
/// <summary> /// Disposes resources /// </summary> public void Dispose() { if (Tileset != null) { Tileset.Dispose(); } Tileset = null; Decorations = null; IsDisposed = true; }
/// <summary> /// Unload content /// </summary> public override void UnloadContent() { Trace.WriteDebugLine("[AutoMap] : UnloadContent()"); //Font = null; Batch = null; if (Tileset != null) { Tileset.Dispose(); } Tileset = null; }
/// <summary> /// Loads a TileSet /// </summary> /// <param name="name">TileSet name</param> /// <returns>True on success</returns> public bool LoadTileSet(string name) { TileSetName = name; if (string.IsNullOrEmpty(name)) { return(false); } if (Tileset != null) { Tileset.Dispose(); } Tileset = ResourceManager.CreateAsset <TileSet>(TileSetName); return(Tileset != null); }
/// <summary> /// Unload contents /// </summary> public override void UnloadContent() { Trace.WriteLine("[CharGen] UnloadContent()"); if (Tileset != null) { Tileset.Dispose(); } Tileset = null; if (Heads != null) { Heads.Dispose(); } Heads = null; if (Font != null) { Font.Dispose(); } Font = null; if (NameFont != null) { NameFont.Dispose(); } NameFont = null; if (Anims != null) { Anims.Dispose(); } Anims = null; if (Batch != null) { Batch.Dispose(); } Batch = null; }
/// <summary> /// Dispose /// </summary> static internal void Dispose() { Trace.WriteDebugLine("[Mouse] Dispose"); if (Texture != null) { Texture.Dispose(); Texture = null; } if (Tileset != null) { Tileset.Dispose(); Tileset = null; } if (Form != null) { Form.MouseWheel -= new MouseEventHandler(OnMouseWheel); } Form = null; }