static VALUE Drawable_get_scale(VALUE vSelf) { // Get C++ object pointer from vSelf Drawable *pSelf; Data_Get_Struct(vSelf, Drawable, pSelf); float x = pSelf->GetScaleX(); float y = pSelf->GetScaleY(); VALUE vArr = rb_ary_new(); rb_ary_push(vArr, rb_float_new(x)); rb_ary_push(vArr, rb_float_new(y)); return vArr; }
static VALUE Drawable_to_s(VALUE vSelf) { // Get C++ object pointer from vSelf Drawable *pSelf; Data_Get_Struct(vSelf, Drawable, pSelf); char szBuffer[256]; sprintf(szBuffer, "Left=%f, Top=%f, Scale=[%f,%f], Rotation=%f", pSelf->GetLeft(), pSelf->GetTop(), pSelf->GetScaleX(), pSelf->GetScaleX(), pSelf->GetRotation()); return rb_str_new2(szBuffer); }