fixing transformations

This commit is contained in:
2025-01-07 19:57:03 +01:00
parent b432e3e2e1
commit deb6c20361
2 changed files with 14 additions and 6 deletions

View File

@@ -143,7 +143,7 @@ namespace mlx
m_pixelput_called = false;
}
Sprite& new_sprite = p_scene->CreateSprite(texture);
new_sprite.SetCenter(Vec2f{ texture->GetWidth() / 2.0f, texture->GetHeight() / 2.0f });
new_sprite.SetCenter(Vec2f{ texture->GetWidth() * 0.5f, texture->GetHeight() * 0.5f });
new_sprite.SetPosition(Vec2f{ static_cast<float>(x), static_cast<float>(y) });
new_sprite.SetScale(Vec2f{ scale_x, scale_y });
new_sprite.SetRotation(angle);