示例#1
0
        public virtual void Render(Render.ImmediateMode2d context)
        {
            if (Visible)
            {
                if (GetSetting("hidden-container", null) == null)
                {
                    if (GetSetting("transparent", null) == null)
                    {
                        context.Texture = context.White;
                        context.Color = (GetSetting("bg-color", Vector3.One) as Vector3?).Value;
                        context.Quad(rect);
                    }

                    var label = GetSetting("label", null);
                    var font = GetSetting("font", null);
                    if (label != null && font != null)
                    {
                        context.Color = (GetSetting("text-color", Vector3.Zero) as Vector3?).Value;
                        BitmapFont.RenderText(label.ToString(), rect.X, rect.Y, rect.Width + rect.X,
                            context, font as BitmapFont);
                    }
                }

                foreach (var child in children)
                    child.Render(context);
            }
        }