From 5fa2c000144809a3dd93d449aeaf45d40c02e2a0 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Wed, 15 Nov 2023 12:35:34 +0900 Subject: [PATCH] examples/texti18n: adjust positions and texts --- examples/texti18n/main.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/examples/texti18n/main.go b/examples/texti18n/main.go index a241eb617..96061fdd8 100644 --- a/examples/texti18n/main.go +++ b/examples/texti18n/main.go @@ -94,7 +94,7 @@ func (g *Game) Draw(screen *ebiten.Image) { const arabicText = "لمّا كان الاعتراف بالكرامة المتأصلة في جميع" op := &text.DrawOptions{} - op.GeoM.Translate(screenWidth-20, 100) + op.GeoM.Translate(screenWidth-20, 40) text.Draw(screen, arabicText, &text.GoTextFace{ Source: arabicFaceSource, Direction: text.DirectionRightToLeft, @@ -105,7 +105,7 @@ func (g *Game) Draw(screen *ebiten.Image) { const hindiText = "चूंकि मानव परिवार के सभी सदस्यों के जन्मजात गौरव और समान" op.GeoM.Reset() - op.GeoM.Translate(20, 150) + op.GeoM.Translate(20, 110) text.Draw(screen, hindiText, &text.GoTextFace{ Source: devanagariFaceSource, SizeInPoints: 24, @@ -115,17 +115,18 @@ func (g *Game) Draw(screen *ebiten.Image) { const thaiText = "โดยที่การไม่นำพาและการหมิ่นในคุณค่าของสิทธิมนุษยชน" op.GeoM.Reset() - op.GeoM.Translate(20, 200) + op.GeoM.Translate(20, 160) text.Draw(screen, thaiText, &text.GoTextFace{ Source: thaiFaceSource, SizeInPoints: 24, Language: language.Thai, }, op) - const japaneseText = "ラーメン。" + const japaneseText = "あのイーハトーヴォの\nすきとおった風、\n夏でも底に冷たさを\nもつ青いそら…" op.GeoM.Reset() - op.GeoM.Translate(20, 250) + op.GeoM.Translate(screenWidth-20, 210) + op.LineHeightInPixels = 48 text.Draw(screen, japaneseText, &text.GoTextFace{ Source: japaneseFaceSource, Direction: text.DirectionTopToBottomAndRightToLeft,