예제 #1
0
        /// <summary>
        /// Change the background tileset
        /// </summary>
        /// <param name="name">Name of the tileset</param>
        /// <returns>True on success</returns>
        bool ChangeBackgroundTileSet(string name)
        {
            if (BgTileSet != null)
            {
                BgTileSet.Dispose();
            }
            BgTileSet = null;

            if (string.IsNullOrEmpty(name))
            {
                return(false);
            }

            BgTileSet = ResourceManager.CreateAsset <TileSet>(name);

            DecorationSet.BackgroundTileset = name;

            return(BgTileSet != null);
        }
예제 #2
0
        /// <summary>
        /// Form closing
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DecorationForm_FormClosed(object sender, FormClosedEventArgs e)
        {
            if (DrawTimer != null)
            {
                DrawTimer.Dispose();
            }
            DrawTimer = null;

            if (Batch != null)
            {
                Batch.Dispose();
            }
            Batch = null;

            if (BgTileSet != null)
            {
                BgTileSet.Dispose();
            }
            BgTileSet = null;

            if (DecorationSet != null)
            {
                DecorationSet.Dispose();
            }
            DecorationSet = null;

            if (ItemTileset != null)
            {
                ItemTileset.Dispose();
            }
            ItemTileset = null;

            if (OpenGLBox != null)
            {
                OpenGLBox.Dispose();
            }
            OpenGLBox = null;
        }