diff --git a/lights/main.go b/lights/main.go index dd41386..b3d4f9d 100644 --- a/lights/main.go +++ b/lights/main.go @@ -43,9 +43,9 @@ func (cl *colorlight) apply(dst pixel.ComposeTarget, center pixel.Vec, src, nois // create the light arc if not created already if cl.imd == nil { imd := imdraw.New(nil) - imd.Color(pixel.Alpha(1)) + imd.Color = pixel.Alpha(1) imd.Push(0) - imd.Color(pixel.Alpha(0)) + imd.Color = pixel.Alpha(0) for angle := -cl.spread / 2; angle <= cl.spread/2; angle += cl.spread / 64 { imd.Push(pixel.X(1).Rotated(angle)) } diff --git a/platformer/main.go b/platformer/main.go index dab3628..09253b3 100644 --- a/platformer/main.go +++ b/platformer/main.go @@ -86,7 +86,7 @@ type platform struct { } func (p *platform) draw(imd *imdraw.IMDraw) { - imd.Color(p.color) + imd.Color = p.color imd.Push(p.rect.Min, p.rect.Max) imd.Rectangle(0) } @@ -247,7 +247,7 @@ func (g *goal) update(dt float64) { func (g *goal) draw(imd *imdraw.IMDraw) { for i := len(g.cols) - 1; i >= 0; i-- { - imd.Color(g.cols[i]) + imd.Color = g.cols[i] imd.Push(g.pos) imd.Circle(float64(i+1)*g.radius/float64(len(g.cols)), 0) } @@ -324,7 +324,7 @@ func run() { canvas := pixelgl.NewCanvas(pixel.R(-160/2, -120/2, 160/2, 120/2)) imd := imdraw.New(sheet) - imd.Precision(32) + imd.Precision = 32 camPos := pixel.V(0, 0) diff --git a/xor/main.go b/xor/main.go index a062de4..94c2c09 100644 --- a/xor/main.go +++ b/xor/main.go @@ -39,28 +39,28 @@ func run() { // red circle imd.Clear() - imd.Color(pixel.RGB(1, 0, 0)) + imd.Color = pixel.RGB(1, 0, 0) imd.Push(win.Bounds().Center() - pixel.X(offset)) imd.Circle(200, 0) imd.Draw(canvas) // blue circle imd.Clear() - imd.Color(pixel.RGB(0, 0, 1)) + imd.Color = pixel.RGB(0, 0, 1) imd.Push(win.Bounds().Center() + pixel.X(offset)) imd.Circle(150, 0) imd.Draw(canvas) // yellow circle imd.Clear() - imd.Color(pixel.RGB(1, 1, 0)) + imd.Color = pixel.RGB(1, 1, 0) imd.Push(win.Bounds().Center() - pixel.Y(offset)) imd.Circle(100, 0) imd.Draw(canvas) // magenta circle imd.Clear() - imd.Color(pixel.RGB(1, 0, 1)) + imd.Color=pixel.RGB(1, 0, 1) imd.Push(win.Bounds().Center() + pixel.Y(offset)) imd.Circle(50, 0) imd.Draw(canvas)