public override void Draw(RenderContext gameTime) { UIRoots.Clear(); foreach (var spriteStateKeyPair in ComponentDatas) { var uiComponent = spriteStateKeyPair.Key; var renderUIElement = spriteStateKeyPair.Value; renderUIElement.Enabled = uiComponent.Enabled; if (renderUIElement.Enabled) { // TODO GRAPHICS REFACTOR: Proper bounding box. //renderSprite.BoundingBox = new BoundingBoxExt(new Vector3(float.NegativeInfinity), new Vector3(float.PositiveInfinity)); // Copy values from ECS to render object renderUIElement.WorldMatrix = uiComponent.Entity.Transform.WorldMatrix; renderUIElement.RenderGroup = uiComponent.RenderGroup; renderUIElement.Page = uiComponent.Page; renderUIElement.IsFullScreen = uiComponent.IsFullScreen; renderUIElement.Resolution = uiComponent.Resolution; renderUIElement.Size = uiComponent.Size; renderUIElement.ResolutionStretch = uiComponent.ResolutionStretch; renderUIElement.IsBillboard = uiComponent.IsBillboard; renderUIElement.SnapText = uiComponent.SnapText; renderUIElement.IsFixedSize = uiComponent.IsFixedSize; UIRoots.Add(renderUIElement); } } }
public override void Draw(RenderContext gameTime) { UIRoots.Clear(); foreach (var spriteStateKeyPair in ComponentDatas) { var renderUIElement = spriteStateKeyPair.Value; renderUIElement.Enabled = renderUIElement.UIComponent.Enabled; if (renderUIElement.Enabled) { // TODO GRAPHICS REFACTOR: Proper bounding box. //renderSprite.BoundingBox = new BoundingBoxExt(new Vector3(float.NegativeInfinity), new Vector3(float.PositiveInfinity)); renderUIElement.RenderGroup = renderUIElement.UIComponent.Entity.Group; UIRoots.Add(renderUIElement); } } }