feat(fonts): add more icons
This commit is contained in:
Binary file not shown.
@@ -17,7 +17,6 @@ const { assets } = useAssets();
|
|||||||
|
|
||||||
const BUTTON_WIDTH = assets.images.common.button.rect.width;
|
const BUTTON_WIDTH = assets.images.common.button.rect.width;
|
||||||
const BUTTON_HEIGHT = assets.images.common.button.rect.height;
|
const BUTTON_HEIGHT = assets.images.common.button.rect.height;
|
||||||
const LETTER_WIDTH = assets.images.common.B.rect.width;
|
|
||||||
|
|
||||||
const B_BUTTON: Rect = [31, 172, BUTTON_WIDTH, BUTTON_HEIGHT];
|
const B_BUTTON: Rect = [31, 172, BUTTON_WIDTH, BUTTON_HEIGHT];
|
||||||
const A_BUTTON: Rect = [144, 172, BUTTON_WIDTH, BUTTON_HEIGHT];
|
const A_BUTTON: Rect = [144, 172, BUTTON_WIDTH, BUTTON_HEIGHT];
|
||||||
@@ -29,24 +28,15 @@ onRender((ctx) => {
|
|||||||
|
|
||||||
ctx.translate(0, props.yOffset);
|
ctx.translate(0, props.yOffset);
|
||||||
|
|
||||||
const drawButton = (
|
const drawButton = (icon: string, text: string, x: number) => {
|
||||||
image: AtlasImage,
|
|
||||||
text: string,
|
|
||||||
x: number,
|
|
||||||
offset: number,
|
|
||||||
) => {
|
|
||||||
assets.images.common.button.draw(ctx, x, 172);
|
assets.images.common.button.draw(ctx, x, 172);
|
||||||
|
|
||||||
const { actualBoundingBoxRight: textWidth } = ctx.measureText(text);
|
const label = `${icon} ${text}`;
|
||||||
const width = LETTER_WIDTH + 4 + textWidth;
|
fillTextHCentered(ctx, label, x, 185, BUTTON_WIDTH);
|
||||||
const left = Math.ceil(x + BUTTON_WIDTH / 2 - width / 2 - offset / 2);
|
|
||||||
|
|
||||||
image.draw(ctx, left, 176);
|
|
||||||
ctx.fillText(text, left + LETTER_WIDTH + 4, 185);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
drawButton(assets.images.common.B, props.bLabel, 31, 5);
|
drawButton(ICONS.B, props.bLabel, 31);
|
||||||
drawButton(assets.images.common.A, props.aLabel, 144, 0);
|
drawButton(ICONS.A, props.aLabel, 144);
|
||||||
}, 60);
|
}, 60);
|
||||||
|
|
||||||
onClick((x, y) => {
|
onClick((x, y) => {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { SettingsBottomScreenNumberInput as NumberInput } from "#components";
|
import { SettingsBottomScreenNumberInput as NumberInput } from "#components";
|
||||||
|
import { ICONS } from "~/utils/icons";
|
||||||
|
|
||||||
const APP_COLOR_TO_FONT_COLOR: Record<string, string> = {
|
const APP_COLOR_TO_FONT_COLOR: Record<string, string> = {
|
||||||
"#61829a": "#fbfbfb", // cyan
|
"#61829a": "#fbfbfb", // cyan
|
||||||
@@ -82,28 +83,17 @@ onRender((ctx) => {
|
|||||||
achievementAssets.viewAllButton.draw(ctx, 127, 2);
|
achievementAssets.viewAllButton.draw(ctx, 127, 2);
|
||||||
achievementAssets.smallTrophy.draw(ctx, 131, 6);
|
achievementAssets.smallTrophy.draw(ctx, 131, 6);
|
||||||
|
|
||||||
const GAP = 4;
|
|
||||||
|
|
||||||
ctx.font = "10px NDS10";
|
ctx.font = "10px NDS10";
|
||||||
ctx.textBaseline = "top";
|
ctx.textBaseline = "top";
|
||||||
ctx.fillStyle = "#010101";
|
ctx.fillStyle = "#010101";
|
||||||
const viewAllText = $t("settings.clock.achievements.viewAll");
|
|
||||||
const { actualBoundingBoxRight: textWidth } = ctx.measureText(viewAllText);
|
|
||||||
|
|
||||||
const totalWidth = achievementAssets.X.rect.width + GAP + textWidth;
|
const label = `${ICONS.X} ${$t("settings.clock.achievements.viewAll")}`;
|
||||||
const left = Math.ceil(
|
|
||||||
145 +
|
|
||||||
(achievementAssets.viewAllButton.rect.width - 18) / 2 -
|
|
||||||
totalWidth / 2,
|
|
||||||
);
|
|
||||||
|
|
||||||
achievementAssets.X.draw(ctx, left, 7);
|
|
||||||
fillTextHCentered(
|
fillTextHCentered(
|
||||||
ctx,
|
ctx,
|
||||||
viewAllText,
|
label,
|
||||||
left + achievementAssets.X.rect.width + GAP,
|
145,
|
||||||
7,
|
7,
|
||||||
textWidth,
|
achievementAssets.viewAllButton.rect.width - 18,
|
||||||
);
|
);
|
||||||
}, 1000);
|
}, 1000);
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -4,5 +4,8 @@ export const ICONS = {
|
|||||||
X: "Χ",
|
X: "Χ",
|
||||||
Y: "Υ",
|
Y: "Υ",
|
||||||
HEART: "Γ",
|
HEART: "Γ",
|
||||||
SAD: "Δ",
|
HAPPY: "Δ",
|
||||||
|
ANGRY: "Ε",
|
||||||
|
SAD: "Ζ",
|
||||||
|
NEUTRAL: "Η",
|
||||||
} as const;
|
} as const;
|
||||||
|
|||||||
@@ -6,7 +6,10 @@ const i18nIcons = {
|
|||||||
icon_x: ICONS.X,
|
icon_x: ICONS.X,
|
||||||
icon_y: ICONS.Y,
|
icon_y: ICONS.Y,
|
||||||
icon_heart: ICONS.HEART,
|
icon_heart: ICONS.HEART,
|
||||||
|
icon_happy: ICONS.HAPPY,
|
||||||
|
icon_angry: ICONS.ANGRY,
|
||||||
icon_sad: ICONS.SAD,
|
icon_sad: ICONS.SAD,
|
||||||
|
icon_neutral: ICONS.NEUTRAL,
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export default defineI18nConfig(() => ({
|
export default defineI18nConfig(() => ({
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 58 B |
Binary file not shown.
|
Before Width: | Height: | Size: 60 B |
Binary file not shown.
|
Before Width: | Height: | Size: 68 B |
Reference in New Issue
Block a user