private void drawOverlay(MapEntity worldEntity, GameTime gameTime) { SpriteBatch spriteBatch = EditorEngine.Instance.World.ViewData.SpriteBatch; float opacity = worldEntity.Opacity; bool shadow = worldEntity.Shadow; worldEntity.Opacity = 0.5f; worldEntity.Shadow = false; worldEntity.blendstate = BlendState.Additive; spriteBatch.End(); worldEntity.BeginDraw(gameTime); worldEntity.Draw(gameTime); worldEntity.EndDraw(gameTime); spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.Default, RasterizerState.CullCounterClockwise); worldEntity.Opacity = opacity; worldEntity.Shadow = shadow; worldEntity.blendstate = BlendState.NonPremultiplied; }
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 AddEntity(MapEntity e) { e.Map = this; Entities.Add(e); }
public void Reset() { this.Location = Vector2.Zero; this.Scale = 1f; this.Rotation = 0f; FocusEntity = null; }
public void Execute() { this.worldEntity = EditorEngine.Instance.CurrentMap.Entities[index]; EditorEngine.Instance.CurrentMap.Entities.RemoveAt(this.index); }