mc_Scene() { obj = Qnil; touch_listener = NULL; #if CC_TARGET_OS_IPHONE || CC_TARGET_OS_APPLETV update_sel = rb_selector("update:"); #else update_sel = rb_selector("update"); #endif }
static css_dim_t node_measure(void *context, float width, float height) { RubyFrame frame; VALUE node = ((struct ruby_css_node *)context)->obj; static SEL measure_sel = 0; if (measure_sel == 0) { #if CC_TARGET_OS_IPHONE || CC_TARGET_OS_APPLETV measure_sel = rb_selector("measure:"); #else measure_sel = rb_selector("measure"); #endif } VALUE args[] = { DBL2NUM(width), DBL2NUM(height) }; VALUE ary = rb_send(node, measure_sel, 2, args); css_dim_t dim; dim.dimensions[0] = NUM2DBL(RARRAY_AT(ary, 0)); dim.dimensions[1] = NUM2DBL(RARRAY_AT(ary, 1)); return dim; }
mc_Application() { obj = Qnil; start_sel = rb_selector("start"); }