minor change in lights example code

This commit is contained in:
faiface 2017-04-15 14:21:27 +02:00
parent 2669441ee5
commit 26b3669ff6
1 changed files with 3 additions and 4 deletions

View File

@ -61,7 +61,7 @@ func (cl *colorlight) apply(src, noise drawer, dst pixel.ComposeTarget) {
// draw the light arc // draw the light arc
dst.SetMatrix(pixel.IM.Scaled(0, cl.radius).Rotated(0, cl.angle).Moved(cl.point)) dst.SetMatrix(pixel.IM.Scaled(0, cl.radius).Rotated(0, cl.angle).Moved(cl.point))
dst.SetColorMask(pixel.Alpha(1)) dst.SetColorMask(pixel.Alpha(1))
dst.SetComposeMethod(pixel.ComposeCopy) dst.SetComposeMethod(pixel.ComposePlus)
cl.imd.Draw(dst) cl.imd.Draw(dst)
// draw the noise inside the light // draw the noise inside the light
@ -77,7 +77,7 @@ func (cl *colorlight) apply(src, noise drawer, dst pixel.ComposeTarget) {
// draw the light reflected from the dust // draw the light reflected from the dust
dst.SetMatrix(pixel.IM.Scaled(0, cl.radius).Rotated(0, cl.angle).Moved(cl.point)) dst.SetMatrix(pixel.IM.Scaled(0, cl.radius).Rotated(0, cl.angle).Moved(cl.point))
dst.SetColorMask(cl.color.Mul(pixel.Alpha(cl.dust))) dst.SetColorMask(cl.color.Mul(pixel.Alpha(cl.dust)))
dst.SetComposeMethod(pixel.ComposeOver) dst.SetComposeMethod(pixel.ComposePlus)
cl.imd.Draw(dst) cl.imd.Draw(dst)
} }
@ -178,7 +178,7 @@ func run() {
// draw the panda visible outside the light // draw the panda visible outside the light
win.SetColorMask(pixel.Alpha(0.4)) win.SetColorMask(pixel.Alpha(0.4))
win.SetComposeMethod(pixel.ComposeOver) win.SetComposeMethod(pixel.ComposePlus)
panda.Draw(win) panda.Draw(win)
allLight.Clear(pixel.Alpha(0)) allLight.Clear(pixel.Alpha(0))
@ -193,7 +193,6 @@ func run() {
// compose the final result // compose the final result
win.SetColorMask(pixel.Alpha(1)) win.SetColorMask(pixel.Alpha(1))
win.SetComposeMethod(pixel.ComposePlus)
allLight.Draw(win) allLight.Draw(win)
win.Update() win.Update()