Created
March 25, 2014 09:06
-
-
Save memononen/9757759 to your computer and use it in GitHub Desktop.
var args as rect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define mgArgs(...) mgmgArgs_(__VA_ARGS__, MG_NONE) | |
int mgArgs_(const char* text, ...); | |
int mgText_(const char* text, struct MGargs args); | |
// Can "cache" args for common operations, as well as merge them, or use inline. | |
int mgColor(float* r, float* g, float* b, float* a, struct MGargs args) | |
{ | |
struct MGargs labelArgs = mgArgs(mgFontSize(LABEL_SIZE), mgSpacing(LABEL_SPACING)); | |
struct MGargs containerArgs = mgMergeArgs(args, mgArgs(mgAlign(MG_CENTER), mgSpacing(SPACING)); | |
mgDivBegin(MG_ROW, containerArgs); | |
mgText("R", labelArgs); mgNumber(r, mgGrow(1)); | |
mgText("G", labelArgs); mgNumber(g, mgGrow(1)); | |
mgText("B", labelArgs); mgNumber(b, mgGrow(1)); | |
mgText("A", labelArgs); mgNumber(a, mgGrow(1)); | |
return mgDivEnd(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment