2023-12-02 08:08:52 +00:00
|
|
|
package internal
|
|
|
|
|
|
|
|
import (
|
|
|
|
"image/color"
|
|
|
|
|
|
|
|
"github.com/hajimehoshi/ebiten/v2"
|
|
|
|
"github.com/hajimehoshi/ebiten/v2/vector"
|
|
|
|
)
|
|
|
|
|
|
|
|
type net struct {
|
|
|
|
}
|
|
|
|
|
2023-12-02 08:09:36 +00:00
|
|
|
const netRectBaseWidth = 1
|
|
|
|
|
2023-12-02 08:08:52 +00:00
|
|
|
func (n *net) draw(img *ebiten.Image) {
|
|
|
|
bounds := img.Bounds()
|
|
|
|
|
|
|
|
dy := float32(bounds.Dy())
|
|
|
|
dx := float32(bounds.Dx())
|
|
|
|
height := dy / 29
|
2023-12-02 08:09:36 +00:00
|
|
|
width := netRectBaseWidth * dx / BaseWidth
|
2023-12-02 08:08:52 +00:00
|
|
|
|
|
|
|
for offset := float32(0); offset < dy; offset += height * 2 {
|
|
|
|
vector.DrawFilledRect(img, dx/2-width/2, offset, width, height, color.White, false)
|
|
|
|
}
|
|
|
|
}
|