mirror of
https://github.com/Fluffy-Bean/ColouringApp.git
synced 2025-05-20 10:25:00 +00:00
Redesign structure of application
This commit is contained in:
parent
be4c6c7fcf
commit
105785e6c0
9 changed files with 305 additions and 544 deletions
22
penTool.go
Normal file
22
penTool.go
Normal file
|
@ -0,0 +1,22 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
raylib "github.com/gen2brain/raylib-go/raylib"
|
||||
)
|
||||
|
||||
type penTool struct {
|
||||
Color raylib.Color
|
||||
Size float32
|
||||
Opacity float32
|
||||
Points []raylib.Vector2
|
||||
}
|
||||
|
||||
func (p *penTool) Draw(offset raylib.Vector2) {
|
||||
for i := 0; i < len(p.Points)-1; i++ {
|
||||
startPoint := raylib.Vector2Add(p.Points[i], offset)
|
||||
endPoint := raylib.Vector2Add(p.Points[i+1], offset)
|
||||
|
||||
raylib.DrawLineEx(startPoint, endPoint, p.Size, p.Color)
|
||||
raylib.DrawCircle(int32(startPoint.X), int32(startPoint.Y), p.Size/2, p.Color)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue