node implementation on spawn areas
This commit is contained in:
@@ -34,6 +34,13 @@ pub const SpawnArea = struct {
|
||||
};
|
||||
}
|
||||
|
||||
pub fn getNodeLocation(self: *const SpawnArea) rl.Vector2 {
|
||||
return rl.Vector2{
|
||||
.x = self.location.x + @as(f32, @floatFromInt(self.width)) * globals.getScale() / 2.0,
|
||||
.y = self.location.y + @as(f32, @floatFromInt(self.height)) * globals.getScale() / 2.0,
|
||||
};
|
||||
}
|
||||
|
||||
pub fn draw(self: *const SpawnArea) void {
|
||||
const rect = rl.Rectangle{
|
||||
.x = self.location.x,
|
||||
@@ -42,6 +49,5 @@ pub const SpawnArea = struct {
|
||||
.height = @as(f32, @floatFromInt(self.height)) * globals.getScale(),
|
||||
};
|
||||
rl.drawRectangleRec(rect, .dark_gray);
|
||||
// todo draw cars
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user