Esempio n. 1
0
        public static void nk_tooltip(this NuklearContext ctx, string text)
        {
            nk_style style;
            var      padding = new Vector2();
            float    text_width;
            float    text_height;

            if (ctx == null || ctx.current == null || ctx.current.Layout == null || text == null)
            {
                return;
            }
            style       = ctx.style;
            padding     = style.window.padding;
            text_width  = style.font.width(text);
            text_width += 4 * padding.X;
            text_height = style.font.Size + 2 * padding.Y;
            if (nk_tooltip_begin(ctx, text_width))
            {
                ctx.LayoutRowDynamic(text_height, 1);
                ctx.nk_text_(text, nk_text_align.NK_TEXT_LEFT);
                nk_tooltip_end(ctx);
            }
        }
Esempio n. 2
0
 public static void Label(this NuklearContext ctx, string str, nk_text_align alignment)
 {
     ctx.nk_text_(str, alignment);
 }