Ejemplo n.º 1
0
        public void Load(string mapName)
        {
            TileSheetMeta = _dataStore.Load <TileSheetMeta>($"{MapFilePath}{mapName}.TileSheetMeta");
            MapMeta       = _dataStore.Load <MapMeta>($"{MapFilePath}{mapName}.MapMeta");

            //map.Tiles[x + 1][y - 1][0].EventCollection = _eventService.Find(eventId);

            TideReader.Load(_eventService, this, $"{MapFilePath}{mapName}.tide");

            //new TiledReader().Load(_eventService, this, $"{MapFilePath + mapName}.tmx");
        }
Ejemplo n.º 2
0
        private void LoadTileSheetMeta(int index)
        {
            m_tileSheetMeta       = new TileSheetMeta();
            m_tileSheetMeta.Tiles = new TileSheetTile[m_map.TileSheets[0].SheetWidth, m_map.TileSheets[0].SheetHeight];

            for (var x = 0; x < m_tileSheetMeta.Tiles.Columns(); x++)
            {
                for (var y = 0; y < m_tileSheetMeta.Tiles.Rows(); y++)
                {
                    m_tileSheetMeta.Tiles[x, y] = new TileSheetTile();
                }
            }
        }
Ejemplo n.º 3
0
        public TileSheetForm(IDataStore dataStore, Map map)
        {
            if (map.Layers.Count == 0)
            {
                return;
            }

            InitializeComponent();

            m_dataStore = dataStore;
            m_map       = map;

            foreach (var tileSheet in m_map.TileSheets)
            {
                tilesetsListBox.Items.Add(tileSheet);
            }

            m_bitmapImageSource      = null;
            m_imageSourceErrorMessge = null;
            m_x.MakeTransparent(Color.White);

            if (m_map.TileSheets?.Count == 0)
            {
                return;
            }

            m_tileSheetMeta = m_dataStore.Load <TileSheetMeta>($"{m_map.Id}.TileSheetMeta");

            m_tileWidth  = m_map.TileSheets[0].TileWidth;
            m_tileHeight = m_map.TileSheets[0].TileHeight;

            m_cursor = new TileCursor
            {
                Size = new Size(m_tileWidth, m_tileHeight)
            };

            if (m_tileSheetMeta == null)
            {
                LoadTileSheetMeta(0);
            }

            try
            {
                m_bitmapImageSource = new Bitmap(m_map.TileSheets[0].ImageSource);
            }
            catch (Exception exception)
            {
                m_bitmapImageSource      = null;
                m_imageSourceErrorMessge = exception.Message;
            }
        }