Esempio n. 1
0
void etcBindingInit(mrb_state *mrb)
{
	RClass *klass;

	INIT_BIND(Color);
	MRB_ATTR_RW(Color, Red,   "red"  );
	MRB_ATTR_RW(Color, Green, "green");
	MRB_ATTR_RW(Color, Blue,  "blue" );
	MRB_ATTR_RW(Color, Alpha, "alpha");

	INIT_BIND(Tone);
	MRB_ATTR_RW(Tone, Red,   "red"  );
	MRB_ATTR_RW(Tone, Green, "green");
	MRB_ATTR_RW(Tone, Blue,  "blue" );
	MRB_ATTR_RW(Tone, Gray,  "gray" );

	INIT_BIND(Rect);
	MRB_ATTR_RW(Rect, X,      "x"     );
	MRB_ATTR_RW(Rect, Y,      "y"     );
	MRB_ATTR_RW(Rect, Width,  "width" );
	MRB_ATTR_RW(Rect, Height, "height");
	mrb_define_method(mrb, klass, "empty", RectEmpty, MRB_ARGS_NONE());
}
Esempio n. 2
0
void etcBindingInit(mrb_state *mrb)
{
	RClass *klass;

	INIT_BIND(Color);
	MRB_ATTR_RW(Color, red);
	MRB_ATTR_RW(Color, green);
	MRB_ATTR_RW(Color, blue);
	MRB_ATTR_RW(Color, alpha);

	INIT_BIND(Tone);
	MRB_ATTR_RW(Tone, red);
	MRB_ATTR_RW(Tone, green);
	MRB_ATTR_RW(Tone, blue);
	MRB_ATTR_RW(Tone, gray);

	INIT_BIND(Rect);
	MRB_ATTR_RW(Rect, x);
	MRB_ATTR_RW(Rect, y);
	MRB_ATTR_RW(Rect, width);
	MRB_ATTR_RW(Rect, height);
	mrb_define_method(mrb, klass, "empty", RectEmpty, MRB_ARGS_NONE());
}