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); }
static VALUE Drawable_get_top(VALUE vSelf) { // Get C++ object pointer from vSelf Drawable *pSelf; Data_Get_Struct(vSelf, Drawable, pSelf); return rb_float_new(pSelf->GetTop()); }