Sha256: 97f7249aefcb38696092d93d2199aea6f0cba1c82801e9a152ac8b658df8a3bd
Contents?: true
Size: 980 Bytes
Versions: 4
Compression:
Stored size: 980 Bytes
Contents
#include "nkrb.h" VALUE nkrb_ui_label(VALUE self, VALUE rcontext, VALUE text, VALUE rcolor, VALUE rwrap, VALUE ralign) { struct nk_context *context = nkrb_context_get(rcontext); int align = FIX2INT(ralign); if (RTEST(rwrap)) { if (NIL_P(rcolor)) { nk_text_wrap(context, StringValuePtr(text), (int) RSTRING_LEN(text)); } else { struct nk_color color; ASSIGN_STYLE_AS_COLOR(color, nkrb_style_item(rcolor)); nk_text_wrap_colored(context, StringValuePtr(text), (int) RSTRING_LEN(text), color); } } else { if (NIL_P(rcolor)) { nk_text(context, StringValuePtr(text), (int) RSTRING_LEN(text), align); } else { struct nk_color color; ASSIGN_STYLE_AS_COLOR(color, nkrb_style_item(rcolor)); nk_text_colored(context, StringValuePtr(text), (int) RSTRING_LEN(text), align, color); } } return Qnil; } void nkrb_ui_label_init(void) { rb_define_method(mNuklearUIContainer, "ui_label", nkrb_ui_label, 5); }
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
nuklear-0.1.3 | ext/nuklear/nkrb_ui_label.c |
nuklear-0.1.2 | ext/nuklear/nkrb_ui_label.c |
nuklear-0.1.1 | ext/nuklear/nkrb_ui_label.c |
nuklear-0.1.0 | ext/nuklear/nkrb_ui_label.c |