Files
HanjaKanaMun/src/themes/themes.odin
T
SansanandClaude Opus 5.5 5806f0498c Restructure into themed screens with flag card backs, real font, flip animation and sound
- Replace the bogus DroidSansJapanese.ttf (an HTML page) with M PLUS Rounded 1c,
  loaded with LoadFontEx and explicit kana codepoints
- Theme struct per language with flag-based card backs (Hinomaru, Taegukgi, Trairong)
- Card art rendered to textures so the flip squashes the whole card
- Synthesized flip/match/mismatch/win/click sounds (new audio package)
- Shared ui package for text and buttons; Screen enum replaces i32 ids
- Kana <-> romaji pairs drawn from all 46 basic hiragana

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 20:47:04 +02:00

93 lines
2.4 KiB
Odin

package themes
import raylib "vendor:raylib"
SCREEN_WIDTH :: 1280
SCREEN_HEIGHT :: 720
Screen :: enum {
MAIN_MENU,
JAPANESE_MENU,
JAPANESE_MEMORY,
KOREAN_MENU,
THAI_MENU,
}
// Which national flag the card backs are modelled on
Flag :: enum {
JAPAN, // Nisshōki / Hinomaru
KOREA, // Taegukgi
THAILAND, // Thong Trairong
}
Theme :: struct {
name: cstring,
flag: Flag,
primary: raylib.Color, // main brand color (buttons, titles)
secondary: raylib.Color, // second flag color
accent: raylib.Color, // highlights, matched outlines
background: raylib.Color,
card_face: raylib.Color,
ink: raylib.Color, // body text
}
// Flag colors
HINOMARU_RED :: raylib.Color{188, 0, 45, 255}
TAEGUK_RED :: raylib.Color{205, 46, 58, 255}
TAEGUK_BLUE :: raylib.Color{0, 71, 160, 255}
THAI_RED :: raylib.Color{165, 25, 49, 255}
THAI_BLUE :: raylib.Color{45, 42, 74, 255}
WHITE :: raylib.Color{255, 255, 255, 255}
BLACK :: raylib.Color{0, 0, 0, 255}
SUMI_INK :: raylib.Color{35, 31, 32, 255}
DARK_GRAY :: raylib.Color{80, 76, 72, 255}
LIGHT_GRAY :: raylib.Color{200, 200, 200, 255}
MENU_BACKGROUND :: raylib.Color{248, 246, 242, 255}
JAPAN :: Theme{
name = "Japanese",
flag = .JAPAN,
primary = HINOMARU_RED,
secondary = WHITE,
accent = raylib.Color{212, 160, 23, 255}, // kin (gold)
background = raylib.Color{250, 246, 238, 255}, // washi paper
card_face = raylib.Color{255, 252, 245, 255},
ink = SUMI_INK,
}
KOREA :: Theme{
name = "Korean",
flag = .KOREA,
primary = TAEGUK_BLUE,
secondary = TAEGUK_RED,
accent = raylib.Color{30, 30, 30, 255}, // trigram black
background = raylib.Color{244, 246, 251, 255},
card_face = raylib.Color{255, 255, 255, 255},
ink = raylib.Color{22, 24, 35, 255},
}
THAI :: Theme{
name = "Thai",
flag = .THAILAND,
primary = THAI_RED,
secondary = THAI_BLUE,
accent = raylib.Color{218, 165, 32, 255}, // temple gold
background = raylib.Color{251, 246, 240, 255},
card_face = raylib.Color{255, 253, 248, 255},
ink = raylib.Color{30, 28, 45, 255},
}
BUTTON_WIDTH :: 240
BUTTON_HEIGHT :: 60
TITLE_FONT_SIZE :: 72
SUBTITLE_FONT_SIZE :: 26
BUTTON_FONT_SIZE :: 26
CARD_WIDTH :: 96
CARD_HEIGHT :: 128
CARD_SPACING :: 14
GRID_TOP :: 136
GRID_ROWS :: 4
GRID_COLS :: 6