[INFORMATION](4/11/2024)
Cubism Editor 5.1 alpha2 is now available!
We have incorporated some of your comments and suggestions. Thank you for your comments and requests!
We will continue to welcome your feedback on alpha2.
Download/
Manual and Update History
how i get drawing rectangle size after setMatrix function called
//....
live2DModel2->setMatrix(matrix);
//live2DModel2->GetVertixPostion ?? or live2DModel2->GetRectSize();
0 ·
Comments
thanks for using Live2D! Do you want to get the axis aligned margins of the whole model?
The current SDK currently doesn't provide an easy way to do this...
My first comments to this question show a way to do it - although not good, currently probably the best you can do. The functions called are basically the same in the c++ based SDKs but feel free to ask questions.
float right=0;
float top=live2DModel->getCanvasHeight();
float bottom=0;
for(int i=0; i
{
PartsData* part = (*parts)[i];
int pointCount = 0;
float* points = live2DModel->getTransformedPoints(live2DModel->getPartsDataIndex(part->getPartsDataID()),&pointCount);
for (int i = 0; i < pointCount; i++)
{
float x = points[DEF::VERTEX_OFFSET+i*DEF::VERTEX_STEP];
float y = points[DEF::VERTEX_OFFSET+i*DEF::VERTEX_STEP+1];
if(x < left)left=x; // Min x
if(x > right)right=x; // Max x
if(y < top)top=y; // Min y
if(y > bottom)bottom=y; // Max y
}
}
This Size is bigger than window size..
So it must offer, pixel compact scalability and hitting test for pixel coordinate