Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions internal/font/fontutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ var (
japaneseFontTitleFace *text.GoTextFace // タイトル用太字(64px相当)
japaneseFontMediumFace *text.GoTextFace // 見出し用(48px相当)
japaneseFontListFace *text.GoTextFace // リスト用(40px相当)
japaneseFontTinyFace *text.GoTextFace // 極小サイズ(10px相当)
)

// InitFonts は日本語フォントを初期化します
Expand Down Expand Up @@ -70,6 +71,12 @@ func InitFonts() {
Source: fontSource,
Size: 20, // Ebitenでの適切なサイズに調整
}

// 極小サイズのフォント(クレジット表記用)
japaneseFontTinyFace = &text.GoTextFace{
Source: fontSource,
Size: 10, // 非常に小さいサイズ
}
}

// DrawJapaneseText は日本語テキストを描画します
Expand Down Expand Up @@ -109,6 +116,8 @@ func DrawJapaneseTextWithSize(screen *ebiten.Image, txt string, x, y float64, fo
font = japaneseFontLargeFace
case "button":
font = japaneseFontButtonFace
case "tiny":
font = japaneseFontTinyFace
default:
font = japaneseFontFace
}
Expand Down Expand Up @@ -154,6 +163,8 @@ func MeasureJapaneseTextWithSize(txt string, fontSize string) (width, height flo
font = japaneseFontLargeFace
case "button":
font = japaneseFontButtonFace
case "tiny":
font = japaneseFontTinyFace
default:
font = japaneseFontFace
}
Expand Down Expand Up @@ -182,6 +193,8 @@ func GetFontMetrics(fontSize string) (ascent, descent float64) {
font = japaneseFontLargeFace
case "button":
font = japaneseFontButtonFace
case "tiny":
font = japaneseFontTinyFace
default:
font = japaneseFontFace
}
Expand Down
4 changes: 2 additions & 2 deletions view/screens/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ func drawFailureScreen(screen *ebiten.Image, game *service.Game) {
// ダークグレー背景
screen.Fill(color.RGBA{50, 50, 50, 255})

// タイトル「ざんねん!タイムアップ!」(背景色付き)
// タイトル「ゲームオーバー!」(背景色付き)
backgroundColor := color.RGBA{0, 0, 0, 180}
font.DrawCenteredJapaneseTextWithBackground(screen, "ざんねん!タイムアップ!", service.ScreenWidth/2, failTitleY, true, color.White, backgroundColor)
font.DrawCenteredJapaneseTextWithBackground(screen, "ゲームオーバー!", service.ScreenWidth/2, failTitleY, true, color.White, backgroundColor)

// 中央に大きなWANTED Gopher画像
if service.WantedGopherImage != nil && service.WantedGopherImage.Image != nil {
Expand Down
17 changes: 17 additions & 0 deletions view/screens/title.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,23 @@ func DrawTitleScreen(screen *ebiten.Image, game *service.Game) {
font.DrawJapaneseTextWithSize(screen, rule, listMarginLeft, float64(howToY), "list", color.White)
howToY += 28 // 行間を調整
}

// クレジット表記(右下に小さく表示)
credits := []string{
"Created by SODA / SNKRDUNK",
"Made with Ebitengine, gopherize.me",
"The Go gopher was designed by Renée French",
}

creditColor := color.RGBA{150, 150, 150, 255} // 薄いグレー
creditY := float64(service.ScreenHeight - 60) // 下から60px

for i, credit := range credits {
// 各クレジットのテキスト幅を測定して右寄せ
width, _ := font.MeasureJapaneseTextWithSize(credit, "tiny")
creditX := float64(service.ScreenWidth) - width - 10 // 右から10px
font.DrawJapaneseTextWithSize(screen, credit, creditX, creditY+float64(i*12), "tiny", creditColor)
}
}

// IsPlayButtonClicked は指定座標がPlayボタン内かどうかを判定します
Expand Down
Loading