Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanlangston committed Jan 4, 2024
1 parent b63735e commit 292a4f1
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
Binary file added src/Fonts/HyperspaceBold.ttf
Binary file not shown.
4 changes: 3 additions & 1 deletion src/Views/AsteroidsView.zig
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,12 @@ fn DrawWithCamera() Shared.View.Views {

const locale = Shared.Locale.GetLocale();

const font = Shared.Font.Get(.HyperspaceBold);
var scoreBuffer: [64]u8 = undefined;
Shared.Helpers.DrawTextRightAligned(
Shared.Helpers.DrawTextWithFontRightAligned(
std.fmt.bufPrintZ(&scoreBuffer, "{s}{}", .{ locale.?.Score, vm.score }) catch locale.?.ScoreNotFound,
Shared.Color.Blue.Light,
font,
onePixelScaled * 10,
screenWidth - (5 * onePixelScaled),
5,
Expand Down
2 changes: 1 addition & 1 deletion src/Views/GameOverView.zig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub fn DrawFunction() Shared.View.Views {

const screenWidth: f32 = @floatFromInt(raylib.getScreenWidth());
const screenHeight: f32 = @floatFromInt(raylib.getScreenHeight());
const font = Shared.Font.Get(.Unknown);
const font = Shared.Font.Get(.HyperspaceBold);
const fontSize = @divFloor(screenWidth, 30);
const startY = @divFloor(screenHeight, 4);
const startX = @divFloor(screenWidth, 4);
Expand Down
9 changes: 4 additions & 5 deletions src/Views/MenuView.zig
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub fn DrawFunction() Shared.View.Views {
vm.Update();

const locale = Shared.Locale.GetLocale().?;
const font = Shared.Font.Get(.Unknown);
const font = Shared.Font.Get(.HyperspaceBold);

const title = locale.Title;
const screenWidth: f32 = @floatFromInt(raylib.getScreenWidth());
Expand All @@ -60,23 +60,22 @@ pub fn DrawFunction() Shared.View.Views {
const accentColor = Shared.Color.Blue.Dark;

// Title
const titleFont = Shared.Font.Get(.Unknown);
const TitleTextSize = raylib.measureTextEx(
titleFont,
font,
title,
fontSize * 2.5,
@floatFromInt(font.glyphPadding),
);
const titleFontsizeF: f32 = TitleTextSize.y;
raylib.drawTextEx(
titleFont,
font,
title,
raylib.Vector2.init(
((screenWidth - TitleTextSize.x) / 2),
startY - (titleFontsizeF / 2),
),
titleFontsizeF,
@floatFromInt(titleFont.glyphPadding),
@floatFromInt(font.glyphPadding),
Shared.Color.Brown.Base,
);

Expand Down
2 changes: 1 addition & 1 deletion src/Views/PausedView.zig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub fn DrawFunction() Shared.View.Views {

const screenWidth: f32 = @floatFromInt(raylib.getScreenWidth());
const screenHeight: f32 = @floatFromInt(raylib.getScreenHeight());
const font = Shared.Font.Get(.Unknown);
const font = Shared.Font.Get(.HyperspaceBold);
const fontSize = @divFloor(screenWidth, 30);
const startY = @divFloor(screenHeight, 4);
const startX = @divFloor(screenWidth, 4);
Expand Down

0 comments on commit 292a4f1

Please sign in to comment.