Update test game to showcase camera system.

This commit is contained in:
2023-09-25 18:54:17 +02:00
parent 8aab1132b6
commit 092d01dcae
4 changed files with 55 additions and 13 deletions

30
TestGame/World.cs Normal file
View File

@@ -0,0 +1,30 @@
using System.Numerics;
using DaggerFramework;
using DaggerFramework.Rendering;
using DaggerFramework.SceneGraph;
public class World : Drawable2d
{
protected override void OnStart()
{
base.OnStart();
_randomPositions = new Vector2[_rectangleAmount];
for (int i = 0; i < _rectangleAmount - 1; i++)
{
_randomPositions[i] = MathUtils.RandomVector2(Position, Vector2.One * 2048f);
}
}
public override void OnDraw(Renderer renderer)
{
for (int i = 0; i < _rectangleAmount; i++)
{
renderer.SetTransform(_randomPositions[i], PivotOffset, 0);
renderer.DrawRectangle(Vector2.One * 16f, _rectangleColor);
}
}
private Color _rectangleColor = new Color(0.25f, 0.25f, 0.25f, 1.0f);
private int _rectangleAmount = 6000;
private Vector2[] _randomPositions;
}