ebiten: rename FloatLayouter -> LayoutFer

Updates #2285
This commit is contained in:
Hajime Hoshi 2022-11-09 02:00:07 +09:00
parent 8567c3c654
commit f4b12462e6
3 changed files with 5 additions and 5 deletions

View File

@ -96,7 +96,7 @@ type game struct {
} }
func (g *game) Layout(outsideWidth, outsideHeight int) (int, int) { func (g *game) Layout(outsideWidth, outsideHeight int) (int, int) {
// As game implements the interface FloatLayouter, Layout is never called and LayoutF is called instead. // As game implements the interface LayoutFer, Layout is never called and LayoutF is called instead.
// However, game has to implement Layout to satisfy the interface Game. // However, game has to implement Layout to satisfy the interface Game.
panic("windowsize: Layout must not be called") panic("windowsize: Layout must not be called")
} }

View File

@ -126,7 +126,7 @@ func (g *gameForUI) NewScreenImage(width, height int) *ui.Image {
} }
func (g *gameForUI) Layout(outsideWidth, outsideHeight float64) (float64, float64) { func (g *gameForUI) Layout(outsideWidth, outsideHeight float64) (float64, float64) {
if l, ok := g.game.(FloatLayouter); ok { if l, ok := g.game.(LayoutFer); ok {
return l.LayoutF(outsideWidth, outsideHeight) return l.LayoutF(outsideWidth, outsideHeight)
} }

6
run.go
View File

@ -80,12 +80,12 @@ type Game interface {
// You can return a fixed screen size if you don't care, or you can also return a calculated screen size // You can return a fixed screen size if you don't care, or you can also return a calculated screen size
// adjusted with the given outside size. // adjusted with the given outside size.
// //
// If the game implements the interface FloatLayouter, Layout is never called and LayoutF is called instead. // If the game implements the interface LayoutFer, Layout is never called and LayoutF is called instead.
Layout(outsideWidth, outsideHeight int) (screenWidth, screenHeight int) Layout(outsideWidth, outsideHeight int) (screenWidth, screenHeight int)
} }
// FloatLayouter is an interface for the float version of Game.Layout. // LayoutFer is an interface for the float version of Game.Layout.
type FloatLayouter interface { type LayoutFer interface {
// LayoutF is the float version of Game.Layout. // LayoutF is the float version of Game.Layout.
// //
// If the game implements this interface, Layout is never called and LayoutF is called instead. // If the game implements this interface, Layout is never called and LayoutF is called instead.