예제 #1
0
파일: bounce.go 프로젝트: zenoss/rog-go
func makeBall(b ball) Ball {
	img := canvas.Box(ballSize, ballSize, image.NewUniform(b.col), 1, image.Black)
	p := b.p.point().Sub(image.Pt(ballSize/2, ballSize/2))
	item := canvas.NewImage(img, true, p)
	window.AddItem(item)
	window.Raise(item, nil, false)
	return Ball{item}
}
예제 #2
0
파일: bounce.go 프로젝트: zenoss/rog-go
func makeRect(r image.Rectangle, col color.Color) {
	img := canvas.Box(r.Dx(), r.Dy(), image.NewUniform(col), 1, image.Black)
	item := canvas.NewImage(img, opaqueColor(col), r.Min)
	window.AddItem(canvas.Draggable(item))
}