コード例 #1
0
        /// <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;
        }
コード例 #2
0
ファイル: Mouse.cs プロジェクト: WeirdBeardDev/arcengine
        /// <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);
        }
コード例 #3
0
 /// <summary>
 /// Unload content
 /// </summary>
 public override void UnloadContent()
 {
     if (Tileset != null)
     {
         Tileset.Dispose();
     }
     Tileset = null;
 }
コード例 #4
0
        /// <summary>
        /// Disposes resources
        /// </summary>
        public void Dispose()
        {
            if (Tileset != null)
            {
                Tileset.Dispose();
            }
            Tileset = null;

            Decorations = null;
            IsDisposed  = true;
        }
コード例 #5
0
        /// <summary>
        /// Unload content
        /// </summary>
        public override void UnloadContent()
        {
            Trace.WriteDebugLine("[AutoMap] : UnloadContent()");

            //Font = null;
            Batch = null;

            if (Tileset != null)
            {
                Tileset.Dispose();
            }
            Tileset = null;
        }
コード例 #6
0
        /// <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);
        }
コード例 #7
0
        /// <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;
        }
コード例 #8
0
ファイル: Mouse.cs プロジェクト: WeirdBeardDev/arcengine
        /// <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;
        }