Exemple #1
0
func drawposition(entity *physics.Entity, drawable *gdk.Drawable, gc *gdk.GC) {
	radius := math.Sqrt(entity.Mass)
	startx := utils.RoundInt(centerfloatx(entity.Position.X) - (radius / 2))
	starty := utils.RoundInt(centerfloaty(entity.Position.Y) - (radius / 2))

	// Draw at least 1 pixel for position
	if radius < 1 {
		radius = 1
	}

	drawable.DrawArc(gc, true, startx, starty, int(utils.Round(radius)), int(radius), 0, 360*64)
}