This commit is contained in:
Hajime Hoshi 2013-06-21 11:16:19 +09:00
parent 970b087035
commit faa9c1bfe8
4 changed files with 5 additions and 7 deletions

View File

@ -44,8 +44,8 @@ func (game *RotatingImage) Draw(g graphics.GraphicsContext, offscreen graphics.T
geometryMatrix.Translate(-tx/2, -ty/2)
geometryMatrix.Rotate(float64(game.x) / 60)
geometryMatrix.Translate(tx/2, ty/2)
centerX, centerY := float64(offscreen.Width) / 2, float64(offscreen.Height) / 2
geometryMatrix.Translate(centerX - tx/2, centerY - ty/2)
centerX, centerY := float64(offscreen.Width)/2, float64(offscreen.Height)/2
geometryMatrix.Translate(centerX-tx/2, centerY-ty/2)
g.DrawTexture(game.ebitenTexture.ID,
0, 0, int(tx), int(ty),
geometryMatrix,

View File

@ -1,3 +1 @@
package matrix_test