public DocLayer Generate() { DocLayer layer = Create(); FillWithData(layer); return(layer); }
protected override void Update(float time) { if (Document.Instance.SelectedLayer != _layer || _layer.PropertiesDirty) { _layer = Document.Instance.SelectedLayer; UpdateProperties(); } Select.Value = Tools.Tool.Current is Tools.Select; Eraser.Value = Tools.Tool.Current is Tools.EraseTile; }
public void MoveLayerDown(DocLayer layer) { SelectLayer(layer); int index = Document.Current.Layers.IndexOf(layer); if (index < Document.Current.Layers.Count - 1) { Document.Current.Layers.MoveElementToIndex(layer, index + 1); SetDocumentModified(); } }
public void MoveLayerUp(DocLayer layer) { SelectLayer(layer); int index = Document.Current.Layers.IndexOf(layer); if (index > 0) { Document.Current.Layers.MoveElementToIndex(layer, index - 1); SetDocumentModified(); } }
protected override void FillWithData(DocLayer layer) { base.FillWithData(layer); TiledLayer tl = layer.Layer as TiledLayer; tl.Resize(Width, Height); tl.TiledWidth = TiledWidth; tl.TiledHeight = TiledHeight; tl.Tileset = Tileset; }
public void Select(DocLayer layer) { for (int idx = 0; idx < Layers.Count; ++idx) { Layers[idx].Selected.Value = false; } layer.Selected.Value = true; if (LayerSelectionChanged != null) { LayerSelectionChanged(); } }
void ReadVersion1(BinaryReader reader) { int layersNo = reader.ReadInt32(); for (int idx = 0; idx < layersNo; ++idx) { bool tiled = reader.ReadBoolean(); DocLayer layer = tiled ? (DocLayer) new DocTiledLayer("") : (DocLayer) new DocVectorLayer(""); layer.Deserialize(reader); Layers.Add(layer); } }
public void New() { new Tools.Select(); _nextIndex++; FileName = string.Format("New {0}", _nextIndex); FilePath = null; Layers.Clear(); foreach (var layer in CurrentTemplate.Instance.Layers) { DocLayer generated = layer.Generate(); Layers.Add(generated); if (layer.Selected) { Select(generated); } } _layerIndex = Layers.Count + 1; IsModified = false; }
protected virtual void FillWithData(DocLayer layer) { layer.Layer.ScrollSpeed = new Vector2((float)HorizontalSpeed / 100f, (float)VerticalSpeed / 100f); }
public void SelectLayer(DocLayer layer) { Document.Current.Select(layer); }