Beispiel #1
0
        protected virtual void DrawChildren(DrawContext drawContext, float actualOpacity)
        {
            if (children.Count == 0)
            {
                return;
            }

#if DEBUG
            Box2?clipRegionDebug = null;
#endif
            using (ClipChildren ? DrawState.Clip(Bounds, Manager.Camera) : null)
            {
                foreach (var child in children)
                {
                    if (child.displayed)
                    {
                        child.Draw(drawContext, actualOpacity);
                    }
                }

#if DEBUG
                if (ClipChildren)
                {
                    clipRegionDebug = DrawState.GetClipRegion(Manager.Camera);
                }
#endif
            }
#if DEBUG
            if (clipRegionDebug.HasValue)
            {
                Manager.Skin.GetDrawable("debug_clipregion")?.Draw(drawContext, manager.Camera, clipRegionDebug.Value, 1);
            }
#endif
        }
Beispiel #2
0
 public void Draw(DrawContext drawContext, Camera camera, Box2 bounds, float opacity = 1)
 {
     storyboard.DisplayTime = Time;
     if (Clip)
     {
         using (DrawState.Clip(bounds, camera))
             storyboard.Draw(drawContext, camera, bounds, opacity);
     }
     else
     {
         storyboard.Draw(drawContext, camera, bounds, opacity);
         DrawState.Prepare(drawContext.Get <LineRenderer>(), camera, linesRenderStates)
         .DrawSquare(new Vector3(bounds.Left, bounds.Top, 0), new Vector3(bounds.Right, bounds.Bottom, 0), Color4.Black);
     }
 }