examples/texti18n: adjust positions and texts

This commit is contained in:
Hajime Hoshi 2023-11-15 12:35:34 +09:00
parent 4694b78d54
commit 5fa2c00014

View File

@ -94,7 +94,7 @@ func (g *Game) Draw(screen *ebiten.Image) {
const arabicText = "لمّا كان الاعتراف بالكرامة المتأصلة في جميع" const arabicText = "لمّا كان الاعتراف بالكرامة المتأصلة في جميع"
op := &text.DrawOptions{} op := &text.DrawOptions{}
op.GeoM.Translate(screenWidth-20, 100) op.GeoM.Translate(screenWidth-20, 40)
text.Draw(screen, arabicText, &text.GoTextFace{ text.Draw(screen, arabicText, &text.GoTextFace{
Source: arabicFaceSource, Source: arabicFaceSource,
Direction: text.DirectionRightToLeft, Direction: text.DirectionRightToLeft,
@ -105,7 +105,7 @@ func (g *Game) Draw(screen *ebiten.Image) {
const hindiText = "चूंकि मानव परिवार के सभी सदस्यों के जन्मजात गौरव और समान" const hindiText = "चूंकि मानव परिवार के सभी सदस्यों के जन्मजात गौरव और समान"
op.GeoM.Reset() op.GeoM.Reset()
op.GeoM.Translate(20, 150) op.GeoM.Translate(20, 110)
text.Draw(screen, hindiText, &text.GoTextFace{ text.Draw(screen, hindiText, &text.GoTextFace{
Source: devanagariFaceSource, Source: devanagariFaceSource,
SizeInPoints: 24, SizeInPoints: 24,
@ -115,17 +115,18 @@ func (g *Game) Draw(screen *ebiten.Image) {
const thaiText = "โดยที่การไม่นำพาและการหมิ่นในคุณค่าของสิทธิมนุษยชน" const thaiText = "โดยที่การไม่นำพาและการหมิ่นในคุณค่าของสิทธิมนุษยชน"
op.GeoM.Reset() op.GeoM.Reset()
op.GeoM.Translate(20, 200) op.GeoM.Translate(20, 160)
text.Draw(screen, thaiText, &text.GoTextFace{ text.Draw(screen, thaiText, &text.GoTextFace{
Source: thaiFaceSource, Source: thaiFaceSource,
SizeInPoints: 24, SizeInPoints: 24,
Language: language.Thai, Language: language.Thai,
}, op) }, op)
const japaneseText = "ラーメン。" const japaneseText = "あのイーハトーヴォの\nすきとおった風、\n夏でも底に冷たさを\nもつ青いそら…"
op.GeoM.Reset() op.GeoM.Reset()
op.GeoM.Translate(20, 250) op.GeoM.Translate(screenWidth-20, 210)
op.LineHeightInPixels = 48
text.Draw(screen, japaneseText, &text.GoTextFace{ text.Draw(screen, japaneseText, &text.GoTextFace{
Source: japaneseFaceSource, Source: japaneseFaceSource,
Direction: text.DirectionTopToBottomAndRightToLeft, Direction: text.DirectionTopToBottomAndRightToLeft,