2024-01-11 07:05:27 +03:00
|
|
|
package gg
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/hajimehoshi/ebiten/v2/vector"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Circle struct {
|
|
|
|
Object
|
|
|
|
Transform
|
|
|
|
Visibility
|
|
|
|
Colority
|
|
|
|
Antialiasity
|
|
|
|
Layer
|
2024-01-18 06:06:27 +03:00
|
|
|
Radius Float
|
2024-01-11 07:05:27 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (circle *Circle) Draw(c *Context) []EVertex {
|
2024-01-18 06:06:27 +03:00
|
|
|
rPos := circle.Position().Apply(c.Camera.RealMatrix())
|
2024-01-11 07:05:27 +03:00
|
|
|
vector.DrawFilledCircle(
|
|
|
|
c.Image,
|
|
|
|
float32(rPos.X), float32(rPos.Y),
|
2024-01-18 06:06:27 +03:00
|
|
|
float32(circle.Radius),
|
2024-01-11 07:05:27 +03:00
|
|
|
circle.Color,
|
|
|
|
circle.Antialias,
|
|
|
|
)
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
|