Пример #1
0
        public void Init()
        {
            int i = 0;

            foreach (Direction d in _sprite.Directions)
            {
                DirectionLayout layout = new DirectionLayout(_sprite, d, this);
                layout.OnFrameClick += layout_OnFrameClick;
                layout.Modified     += Modified;
                layout.Zoom          = _zoom;
                DirectionHolder.Controls.Add(layout);
                layout.Location = new Point(2, i++ *(layout.Height + 2) + 2);
            }
            ((DirectionLayout)DirectionHolder.Controls[0]).Select(0);
            _selectedFrame       = ((DirectionLayout)DirectionHolder.Controls[0]).SelectedFrame;
            SpriteDrawer.Content = (Bitmap)_sprite.GetImage((((DirectionLayout)DirectionHolder.Controls[0]).SelectedFrame.Index));
            SpriteDrawer.ZoomIn();
            SpriteDrawer.ZoomIn();
            _tilesetCtrl = new TilesetControl2 {
                Tileset = SphereStudio.Vanilla.Tileset.FromSpriteset(_sprite), CanInsert = false
            };
            _tilesetCtrl.ZoomIn();
            _tilesetCtrl.Anchor        = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
            _tilesetCtrl.TileSelected += _tileset_ctrl_TileSelected;
            _tilesetCtrl.TileAdded    += _tileset_ctrl_TileAdded;
            _tilesetCtrl.TileRemoved  += _tileset_ctrl_TileRemoved;
            ImageHolder.Controls.Add(_tilesetCtrl);
            _tilesetCtrl.Width      = ImageHolder.Width - 6;
            DirectionAnim.Sprite    = _sprite;
            DirectionAnim.Direction = _sprite.Directions[0];
            FrameBaseEditor.Frame   = _sprite.Directions[0].Frames[0];
        }