return ~~font.common.baseline * size;
}
- render :: (use f: ^Font, text: str, x: f32, y: f32, font_size: f32, color := gfx.Color4.{1,1,1}) {
+ render :: (use f: ^Font, text: str, x, y: f32, font_size: f32, color := gfx.Color4.{1,1,1}) {
gfx.set_texture(^texture);
switch rendering_kind {
gfx.rect(.{ x0, y0 }, .{ width, height }, color);
},
- (x: f32, y: f32, w: f32, h: f32, color := gfx.Color4.{1,1,1}) {
+ (x, y, w, h: f32, color := gfx.Color4.{1,1,1}) {
gfx.set_texture();
gfx.rect(.{ x, y }, .{ w, h }, color);
}
bottom_left :: (use r: Rectangle) -> (x: f32, y: f32) do return math.min(x0, x1), math.max(y0, y1);
bottom_right :: (use r: Rectangle) -> (x: f32, y: f32) do return math.max(x0, x1), math.max(y0, y1);
- contains :: (use r: Rectangle, x: f32, y: f32) -> bool {
+ contains :: (use r: Rectangle, x, y: f32) -> bool {
return math.min(x0, x1) <= x && x <= math.max(x0, x1) &&
math.min(y0, y1) <= y && y <= math.max(y0, y1);
}