Rename RenderTarget.Texture -> .Image

This commit is contained in:
Hajime Hoshi 2014-12-21 02:45:50 +09:00
parent 6a2cfab839
commit 146c1db44a
5 changed files with 7 additions and 7 deletions

View File

@ -62,7 +62,7 @@ func (g *Game) Update(r *ebiten.RenderTarget) error {
for i := 0; i < 10; i++ {
geo := ebiten.TranslateGeometry(0, float64(i)*(diff))
clr := ebiten.ColorMatrixI()
if err := ebiten.DrawWholeImage(r, g.tmpRenderTarget.Texture(), geo, clr); err != nil {
if err := ebiten.DrawWholeImage(r, g.tmpRenderTarget.Image(), geo, clr); err != nil {
return err
}
}

View File

@ -74,11 +74,11 @@ func (s *SceneManager) Draw(r *ebiten.RenderTarget, textures *Textures) {
s.next.Draw(to, textures)
color := ebiten.ColorMatrixI()
ebiten.DrawWholeImage(r, from.Texture(), ebiten.GeometryMatrixI(), color)
ebiten.DrawWholeImage(r, from.Image(), ebiten.GeometryMatrixI(), color)
alpha := float64(s.transitionCount) / float64(transitionMaxCount)
color.Elements[3][3] = alpha
ebiten.DrawWholeImage(r, to.Texture(), ebiten.GeometryMatrixI(), color)
ebiten.DrawWholeImage(r, to.Image(), ebiten.GeometryMatrixI(), color)
}
func (s *SceneManager) GoTo(scene Scene) {

View File

@ -40,7 +40,7 @@ func (g *Game) Update(r *ebiten.RenderTarget) error {
ebiten.DrawWholeImage(g.gophersRenderTarget, g.gophersTexture, geo, ebiten.ColorMatrixI())
geo = ebiten.ScaleGeometry(mosaicRatio/2.0, mosaicRatio/2.0)
ebiten.DrawWholeImage(r, g.gophersRenderTarget.Texture(), geo, ebiten.ColorMatrixI())
ebiten.DrawWholeImage(r, g.gophersRenderTarget.Image(), geo, ebiten.ColorMatrixI())
return nil
}

View File

@ -54,10 +54,10 @@ func (g *Game) Update(r *ebiten.RenderTarget) error {
clr := ebiten.ScaleColor(color.RGBA{0xff, 0x40, 0x40, 0xff})
theta := 2.0 * math.Pi * float64(g.count%60) / 60.0
clr.Concat(ebiten.RotateHue(theta))
ebiten.DrawWholeImage(g.canvasRenderTarget, g.brushRenderTarget.Texture(), geo, clr)
ebiten.DrawWholeImage(g.canvasRenderTarget, g.brushRenderTarget.Image(), geo, clr)
}
ebiten.DrawWholeImage(r, g.canvasRenderTarget.Texture(), ebiten.GeometryMatrixI(), ebiten.ColorMatrixI())
ebiten.DrawWholeImage(r, g.canvasRenderTarget.Image(), ebiten.GeometryMatrixI(), ebiten.ColorMatrixI())
ebitenutil.DebugPrint(r, fmt.Sprintf("(%d, %d)", mx, my))
return nil

View File

@ -119,7 +119,7 @@ type RenderTarget struct {
inner *innerRenderTarget
}
func (r *RenderTarget) Texture() *Texture {
func (r *RenderTarget) Image() *Texture {
return r.inner.texture
}