From d54c4841659108ab9803ee87c808816274e6a66d Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Fri, 21 Jun 2013 01:58:35 +0900 Subject: [PATCH] Center the ebiten --- examples/glut/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/glut/main.go b/examples/glut/main.go index ee76c4eb9..a363afd47 100644 --- a/examples/glut/main.go +++ b/examples/glut/main.go @@ -123,7 +123,8 @@ func (game *DemoGame) Draw(g graphics.GraphicsContext, offscreen graphics.Textur geometryMatrix.Translate(-tx/2, -ty/2) geometryMatrix.Rotate(float64(game.x) / 60) geometryMatrix.Translate(tx/2, ty/2) - geometryMatrix.Translate(100, 100) + 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,