Mainstate view ratio corrected, camera2D takes float dimensions now.

added additional debug logging.
This commit is contained in:
2020-07-06 12:23:56 -05:00
parent 319ade258e
commit 80adda7afb
3 changed files with 7 additions and 3 deletions

View File

@@ -52,7 +52,9 @@ namespace SlatedGameToolkit.Tools.Utilities.Playground
public unsafe void Initialize(StateManager manager)
{
window = new WindowContext("SlatedGameToolkit Playground");
camera = new Camera2D(2, 2);
Vector2 drawableDimensions = window.GetDrawableDimensions();
float ratio = drawableDimensions.Y / drawableDimensions.X;
camera = new Camera2D(2f, ratio * 2f);
renderer = new MeshBatch(camera);
logoTexture = TextureLoader.Load2DTexture("Resources/Playground/yhdnbgnc.png");
@@ -71,7 +73,7 @@ namespace SlatedGameToolkit.Tools.Utilities.Playground
untextured = new RectangleMesh(null, Color.Red);
untextured.Width = 0.15f;
untextured.Height = 0.1f;
untextured.Height = 0.15f;
untextured.X = 0.25f;
untextured.Y = - 0.15f;