Hey is there a "raylib ish" approach to draw centered & scaled texture?
Using this code:
void DrawTextureCenteredEx(Texture texture, Vector2 position, float angle, float scale)
{
float w=(float)texture.width;
float h=(float)texture.height;
Rectangle src = {0,0,w,h};
Rectangle dst = {position.x, position.y, w*scale, h*scale};
DrawTexturePro(texture, src, dst, (Vector2){w/2, h/2}, angle, WHITE);
}
the texture is rotating on is own center but in orbit to the destination. I tried to rectify using trigonometry but I guess is there a better way.
the weird thing is that origin offset (displayed) is not a multiple of scale
Negative scale also makes the rotation backward
(green discs are just a reference)
there is the result