Exemple #1
0
        public virtual void Render(GUIRenderLayer layer)
        {
            int lastLayer = 1;

            foreach (var l in GUIElements)
            {
                lastLayer = l.Key;
                layer.PushTranslation(0, 0, l.Key * LayerDepthShift);
                foreach (var element in l.Value)
                {
                    element.Render(layer);
                }

                layer.PopMatrix();
            }

            lastLayer *= 2;
            layer.PushTranslation(0, 0, lastLayer * LayerDepthShift);
            PopUpCTL?.Render(layer);
            layer.PopMatrix();
        }
        public void Render(GUIRenderLayer layer)
        {
            var origin = Rect.GetPixelOrigin();

            int stackSize = layer.MatrixStackSize();

            Draw(layer);

            // move to our origin, so the children can be relative.
            layer.PushTranslation(origin.X, origin.Y, 0);

            foreach (var child in Children)
            {
                layer.PushTranslation(0, 0, 0.125f);
                child.Render(layer);
            }

            layer.PopMatrix();

            while (layer.MatrixStackSize() > stackSize)             // clean out an extra matrices that drawing may have left on the stack
            {
                layer.PopMatrix();
            }
        }