예제 #1
0
        public EntityTileDecoration(Areaset _areaset, string _name)
        {
            this.Areaset = _areaset;
            this.Name    = _name;

            this.Icon = _areaset.Decorations[_name];
        }
예제 #2
0
        public TileGroup(ImageSource _overlay, Areaset _areaset, TileEditor _tileeditor, Point _size)
        {
            this.Interfacial = true;

            this.Areaset    = _areaset;
            this.TileEditor = _tileeditor;
            this.Size       = _size;

            this.Graphics.Add(this.Overlay = new Image(_overlay)
            {
                Scale = 2, Z = 1
            });
        }
예제 #3
0
        public void Load(MekaItem _file)
        {
            Areaset a = new Areaset(_file, this.Parent.TileSize, this.Parent.TileCollisionResolution);

            this.TilesetSource = GameBase.LoadImageSource(_file["Tileset"].Data);
            this.Colset        = new byte[this.TileCount.X * this.Parent.TileCollisionResolution.X, this.TileCount.Y * this.Parent.TileCollisionResolution.Y][, ];

            for (int i = 0; i < a.Cols.Count; i++)
            {
                Point p = new Point(i % this.TileCount.X, Meth.Down(i / this.TileCount.X));
                this.Colset[p.X, p.Y] = a.Cols[i].Select(item => (byte)(item ? 1 : 0));

                for (int cx = 0; cx < this.Parent.TileCollisionResolution.X; cx++)
                {
                    for (int cy = 0; cy < this.Parent.TileCollisionResolution.Y; cy++)
                    {
                        this.ColPreviewSource[p.X * this.Parent.TileCollisionResolution.X + cx, p.Y *this.Parent.TileCollisionResolution.Y + cy] = (this.Colset[p.X, p.Y][cx, cy] == 1) ? Color.White : Color.Transparent;
                    }
                }
            }
        }