Improved drawing entity data drawing implementation
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user