protected override void OnMouseDown(MouseEventArgs e) { this.selectedEntity = this.getEntity(e.X, e.Y + this.scrolling.Value); if (selectedEntity != null) { onTemplateSelected.SafeInvoke(this, EventArgs.Empty); } base.OnMouseDown(e); }
public AddEntityAction(EntityTemplate model, Vector2 position) : this() { this.model = model; this.position = position; Map map = EditorEngine.Instance.CurrentMap; this.worldEntity = model.CreateEntity(map.Factory); this.worldEntity.Position = position * new Vector2(16, 16); }
public IEncodable Decode(General.Encoding.BinaryInput stream) { position = stream.ReadVector2(); modelName = stream.ReadString(); entityIndex = stream.ReadInt32(); if (!string.IsNullOrEmpty(modelName)) { World world = EditorEngine.Instance.World; model = EditorEngine.Instance.GetModelByName(modelName); } EntityIO io = new EntityIO(stream, EditorEngine.Instance.CurrentMap.Factory, true); this.worldEntity = io.Read(); return this; }
public void addObject(EntityTemplate template) { World.EntityContainer.Add(template); }
public ControlEntityEditor() { selection = new Selection(); Template = new EntityTemplate(); }
public void Remove(EntityTemplate template) { Templates.Remove(template); }
public void Add(EntityTemplate template) { this.Templates.Add(template); }