automated snapshot
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"math"
|
"math"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"github.com/gen2brain/raylib-go/raylib"
|
"github.com/gen2brain/raylib-go/raylib"
|
||||||
@@ -52,7 +51,6 @@ func (s *ContourLayer) AddActors(n, sourceWidth, sourceHeight int32) {
|
|||||||
|
|
||||||
func (s *ContourLayer) Update(ctx *RenderCtx) {
|
func (s *ContourLayer) Update(ctx *RenderCtx) {
|
||||||
s.AddActors(100, ctx.SourceWidth, ctx.SourceHeight)
|
s.AddActors(100, ctx.SourceWidth, ctx.SourceHeight)
|
||||||
fmt.Printf("num actors = %d\n", len(s.actors))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ContourLayer) Draw(ctx *RenderCtx) {
|
func (s *ContourLayer) Draw(ctx *RenderCtx) {
|
||||||
@@ -81,7 +79,6 @@ func (a *Actor) Draw() {
|
|||||||
rad := rl.Remap(v, 0, 1, 0, 3*math.Pi)
|
rad := rl.Remap(v, 0, 1, 0, 3*math.Pi)
|
||||||
nextPosition := rl.Vector2{X: a.position.X + a.stepSize*float32(math.Cos(float64(rad))), Y: a.position.Y + a.stepSize*float32(math.Sin(float64(rad)))}
|
nextPosition := rl.Vector2{X: a.position.X + a.stepSize*float32(math.Cos(float64(rad))), Y: a.position.Y + a.stepSize*float32(math.Sin(float64(rad)))}
|
||||||
rl.DrawLineV(a.position, nextPosition, a.color)
|
rl.DrawLineV(a.position, nextPosition, a.color)
|
||||||
//fmt.Printf("position %v -> nextPosition %v \n", a.position, nextPosition)
|
|
||||||
a.position = nextPosition
|
a.position = nextPosition
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"math"
|
"math"
|
||||||
"github.com/gen2brain/raylib-go/raylib"
|
"github.com/gen2brain/raylib-go/raylib"
|
||||||
)
|
)
|
||||||
@@ -145,6 +146,9 @@ func (s *Sketch) Draw(ctx *RenderCtx) {
|
|||||||
b = config.b
|
b = config.b
|
||||||
}
|
}
|
||||||
tint := rl.NewColor(r, g, b, config.a)
|
tint := rl.NewColor(r, g, b, config.a)
|
||||||
|
|
||||||
|
fmt.Printf("rendering layer '%s' with config %v\n", instance.name, instance.config)
|
||||||
|
|
||||||
rl.DrawTexturePro(instance.texture.Texture, src, dst, rl.Vector2{}, 0, tint)
|
rl.DrawTexturePro(instance.texture.Texture, src, dst, rl.Vector2{}, 0, tint)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user