You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In mizu,struct world implements the method "Layout" from ebiten.Game interface,But I want overwrite the method,or my ebiten app draw text with chinese would be fuzzy。
if I use ebiten directly,use the code below,the text display very clear,
Hello, since the mizu's world implements the ebiten.Game interface, you can just insert it into your ebiten.Game implementation by connecting its methods. The screen borders that it inserts into Bounds() will also change.
Here is a complete example:
package main
import (
"log""github.com/sedyh/mizu/pkg/engine""github.com/hajimehoshi/ebiten/v2"
)
funcmain() {
ebiten.SetVsyncEnabled(false)
ebiten.SetWindowResizingMode(ebiten.WindowResizingModeEnabled)
iferr:=ebiten.RunGame(NewGame(engine.NewGame(NewSetup()))); err!=nil {
log.Fatal(err)
}
}
typeSetupstruct{}
funcNewSetup() *Setup {
return&Setup{}
}
func (s*Setup) Setup(w engine.World) {
// Register some systems here.// w.Bounds() will get a modified Layout() now.
}
typeGamestruct {
e ebiten.Game
}
funcNewGame(e ebiten.Game) *Game {
return&Game{e}
}
func (g*Game) Update() error {
returng.e.Update()
}
func (g*Game) Draw(screen*ebiten.Image) {
g.e.Draw(screen)
}
func (g*Game) Layout(w, hint) (int, int) {
// Modify your layout here.g.e.Layout(w, h)
returnw, h
}
In mizu,struct world implements the method "Layout" from ebiten.Game interface,But I want overwrite the method,or my ebiten app draw text with chinese would be fuzzy。
if I use ebiten directly,use the code below,the text display very clear,
But if I use mizu, I didnt overwrite the method named Layout, So How do I do?
The text was updated successfully, but these errors were encountered: