mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
ebiten: rename receivers
This commit is contained in:
parent
4bd3a9ef8f
commit
1ff4918390
36
gameforui.go
36
gameforui.go
@ -95,10 +95,10 @@ func newGameForUI(game Game) *gameForUI {
|
|||||||
return g
|
return g
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *gameForUI) NewOffscreenImage(width, height int) *ui.Image {
|
func (g *gameForUI) NewOffscreenImage(width, height int) *ui.Image {
|
||||||
if c.offscreen != nil {
|
if g.offscreen != nil {
|
||||||
c.offscreen.Dispose()
|
g.offscreen.Dispose()
|
||||||
c.offscreen = nil
|
g.offscreen = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keep the offscreen an unmanaged image that is always isolated from an atlas (#1938).
|
// Keep the offscreen an unmanaged image that is always isolated from an atlas (#1938).
|
||||||
@ -110,30 +110,30 @@ func (c *gameForUI) NewOffscreenImage(width, height int) *ui.Image {
|
|||||||
// A violatile image is also always isolated.
|
// A violatile image is also always isolated.
|
||||||
imageType = atlas.ImageTypeVolatile
|
imageType = atlas.ImageTypeVolatile
|
||||||
}
|
}
|
||||||
c.offscreen = newImage(image.Rect(0, 0, width, height), imageType)
|
g.offscreen = newImage(image.Rect(0, 0, width, height), imageType)
|
||||||
return c.offscreen.image
|
return g.offscreen.image
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *gameForUI) NewScreenImage(width, height int) *ui.Image {
|
func (g *gameForUI) NewScreenImage(width, height int) *ui.Image {
|
||||||
if c.screen != nil {
|
if g.screen != nil {
|
||||||
c.screen.Dispose()
|
g.screen.Dispose()
|
||||||
c.screen = nil
|
g.screen = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
c.screen = newImage(image.Rect(0, 0, width, height), atlas.ImageTypeScreen)
|
g.screen = newImage(image.Rect(0, 0, width, height), atlas.ImageTypeScreen)
|
||||||
return c.screen.image
|
return g.screen.image
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *gameForUI) Layout(outsideWidth, outsideHeight int) (int, int) {
|
func (g *gameForUI) Layout(outsideWidth, outsideHeight int) (int, int) {
|
||||||
return c.game.Layout(outsideWidth, outsideHeight)
|
return g.game.Layout(outsideWidth, outsideHeight)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *gameForUI) Update() error {
|
func (g *gameForUI) Update() error {
|
||||||
return c.game.Update()
|
return g.game.Update()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *gameForUI) DrawOffscreen() {
|
func (g *gameForUI) DrawOffscreen() {
|
||||||
c.game.Draw(c.offscreen)
|
g.game.Draw(g.offscreen)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *gameForUI) DrawScreen(scale, offsetX, offsetY float64) {
|
func (g *gameForUI) DrawScreen(scale, offsetX, offsetY float64) {
|
||||||
|
Loading…
Reference in New Issue
Block a user