private void CallFormResize(bool rescale) { using (SizeForm frm = new SizeForm()) { frm.WidthSize = _sprite.SpriteWidth; frm.HeightSize = _sprite.SpriteHeight; frm.UseScale = rescale; if (frm.ShowDialog() == DialogResult.OK) { _tilesetCtrl.ResizeTileset((short)frm.WidthSize, (short)frm.HeightSize, rescale); for (short i = 0; i < _sprite.Images.Count; ++i) { _sprite.Images[i].Dispose(); _sprite.Images[i] = _tilesetCtrl.Tileset.Tiles[i].Graphic; } _sprite.SpriteWidth = (short)frm.WidthSize; _sprite.SpriteHeight = (short)frm.HeightSize; } SpriteDrawer.Content = (Bitmap)_sprite.GetImage(_selectedFrame.Index); UpdateControls(); IsDirty = true; } // these method were made public to resize the contained image: FrameBaseEditor.UpdateCenterFrame(); DirectionAnim.UpdateAnimPanel(); }
public void TileDeath() { ScaleAnimation = ScaleAnim.Scale_Down; Direction = DirectionAnim.Down; KeepOriginalPosition = false; KeepOriginalScale = false; AnimationSpeedInS = 0.5f; KillTile = true; ActivateAnimation(); }
private void layout_OnFrameClick(object sender, EventArgs e) { if (_selectedFrame != null) { _selectedFrame.Selected = false; } _selectedDirection = (DirectionLayout)sender; _selectedFrame = _selectedDirection.SelectedFrame; SpriteDrawer.Content = (Bitmap)_sprite.GetImage(_selectedFrame.Index); FrameBaseEditor.Frame = _selectedFrame.Frame; DirectionAnim.Direction = _selectedDirection.Direction; DirectionAnim.Invalidate(true); }