Improved drawing entity data drawing implementation

This commit is contained in:
2026-04-28 08:32:05 +02:00
parent 05b7b28f5c
commit 1239aba0b2

View File

@@ -1,5 +1,6 @@
package main
import "core:math"
import "core:fmt"
import sc "core:strconv"
import rl "vendor:raylib"
@@ -114,4 +115,10 @@ draw_entity_data :: proc(self: ^Simulator) {
}
// todo for cars
for car, index in self.cars {
id := fmt.caprintf("%d", index)
offset := math.sqrt(f32(common.CAR_HEIGHT * len(id)))
rl.DrawText(id, i32(car.absolute_pos.x + common.CAR_WIDTH / 2 - offset), i32(car.absolute_pos.y), common.CAR_HEIGHT, colour)
}
}