automated snapshot
This commit is contained in:
59
main.go
59
main.go
@@ -62,11 +62,14 @@ func main() {
|
||||
|
||||
sketch := NewSketch(sourceWidth, sourceHeight)
|
||||
|
||||
sierpinskiLayer := &SierpinskiArrow { dirty: true }
|
||||
|
||||
contourLayer := NewContourLayer(&sketch, rng, field)
|
||||
//sketch.CreateLayer("testPattern", &TestPattern{}, int32(sourceWidth), int32(sourceHeight))
|
||||
//sketch.CreateLayer("actors", &contourLayer, int32(sourceWidth), int32(sourceHeight))
|
||||
//sketch.CreateLayer("field", &FieldLayer{field: &field, dirty: true}, int32(sourceWidth), int32(sourceHeight))
|
||||
sketch.CreateLayer("contours", contourLayer)
|
||||
sketch.CreateLayer("sierpinski", sierpinskiLayer)
|
||||
|
||||
ports := MakePorts()
|
||||
ports["sierpinskiArrowAngle"] = Sine {
|
||||
@@ -106,14 +109,14 @@ func main() {
|
||||
|
||||
sketch.Draw(renderCtx)
|
||||
|
||||
//gui.LoadStyle("styles/dark.rgs")
|
||||
gui.SetStyle(gui.DEFAULT, gui.BACKGROUND_COLOR, 0x181818FF)
|
||||
gui.SetStyle(gui.DEFAULT, gui.BASE_COLOR_NORMAL, 0x2A2A2AFF)
|
||||
gui.SetStyle(gui.DEFAULT, gui.BASE_COLOR_FOCUSED, 0x3A3A3AFF)
|
||||
gui.SetStyle(gui.DEFAULT, gui.BASE_COLOR_PRESSED, 0x4A4A4AFF)
|
||||
gui.SetStyle(gui.DEFAULT, gui.TEXT_COLOR_NORMAL, 0xE0E0E0FF)
|
||||
gui.SetStyle(gui.DEFAULT, gui.TEXT_COLOR_FOCUSED, 0xFFFFFFFF)
|
||||
gui.SetStyle(gui.DEFAULT, gui.BORDER_COLOR_NORMAL, 0x404040FF)
|
||||
//gui.LoadStyle("styles/dark.rgs")
|
||||
gui.SetStyle(gui.DEFAULT, gui.BACKGROUND_COLOR, 0x181818FF)
|
||||
gui.SetStyle(gui.DEFAULT, gui.BASE_COLOR_NORMAL, 0x2A2A2AFF)
|
||||
gui.SetStyle(gui.DEFAULT, gui.BASE_COLOR_FOCUSED, 0x3A3A3AFF)
|
||||
gui.SetStyle(gui.DEFAULT, gui.BASE_COLOR_PRESSED, 0x4A4A4AFF)
|
||||
gui.SetStyle(gui.DEFAULT, gui.TEXT_COLOR_NORMAL, 0xE0E0E0FF)
|
||||
gui.SetStyle(gui.DEFAULT, gui.TEXT_COLOR_FOCUSED, 0xFFFFFFFF)
|
||||
gui.SetStyle(gui.DEFAULT, gui.BORDER_COLOR_NORMAL, 0x404040FF)
|
||||
|
||||
controlPanelWidth := float32(targetWidth) / 4.0
|
||||
controlPanelHeight := float32(targetHeight)
|
||||
@@ -136,30 +139,44 @@ func main() {
|
||||
gui.GroupBox(rl.Rectangle{X: 20, Y: 20, Width: controlPanelWidth - 50, Height: 60 }, "Blending")
|
||||
BlendModeToggleGroupActive = gui.ToggleGroup(rl.Rectangle{X: 30, Y: 40, Width: (controlPanelWidth - 70) / 3.0, Height: 24}, "ONE;TWO;THREE", BlendModeToggleGroupActive)
|
||||
|
||||
y := float32(90)
|
||||
for _, layerTools := range sketch.layerToolsOrdered {
|
||||
|
||||
config := layerTools.config
|
||||
|
||||
gui.Label(rl.Rectangle{X: 20, Y: 90, Width: 120, Height: 24}, layerTools.name)
|
||||
gui.Label(rl.Rectangle{X: 20, Y: y, Width: 120, Height: 24}, layerTools.name)
|
||||
|
||||
config.visible = gui.Toggle(rl.Rectangle{X: 40, Y: 136, Width: 16, Height: 16}, "A", config.visible)
|
||||
config.a = uint8(gui.Slider(rl.Rectangle{X: 64, Y: 136, Width: 264, Height: 16}, "", "", float32(config.a), 0, 255))
|
||||
y += 30
|
||||
|
||||
config.rVisible = gui.Toggle(rl.Rectangle{X: 40, Y: 160, Width: 16, Height: 16}, "R", config.rVisible)
|
||||
config.r = uint8(gui.Slider(rl.Rectangle{X: 64, Y: 160, Width: 264, Height: 16}, "", "", float32(config.r), 0, 255))
|
||||
config.visible = gui.Toggle(rl.Rectangle{X: 30, Y: y, Width: 16, Height: 16}, "A", config.visible)
|
||||
config.a = uint8(gui.Slider(rl.Rectangle{X: 50, Y: y, Width: 264, Height: 16}, "", "", float32(config.a), 0, 255))
|
||||
|
||||
config.gVisible = gui.Toggle(rl.Rectangle{X: 40, Y: 184, Width: 16, Height: 16}, "G", config.gVisible)
|
||||
config.g = uint8(gui.Slider(rl.Rectangle{X: 64, Y: 184, Width: 264, Height: 16}, "", "", float32(config.g), 0, 255))
|
||||
y += 24
|
||||
|
||||
config.bVisible = gui.Toggle(rl.Rectangle{X: 40, Y: 208, Width: 16, Height: 16}, "B", config.bVisible)
|
||||
config.b = uint8(gui.Slider(rl.Rectangle{X: 64, Y: 208, Width: 264, Height: 16}, "", "", float32(config.b), 0, 255))
|
||||
config.rVisible = gui.Toggle(rl.Rectangle{X: 30, Y: y, Width: 16, Height: 16}, "R", config.rVisible)
|
||||
config.r = uint8(gui.Slider(rl.Rectangle{X: 50, Y: y, Width: 264, Height: 16}, "", "", float32(config.r), 0, 255))
|
||||
|
||||
config.desaturate = !gui.Toggle(rl.Rectangle{X: 40, Y: 232, Width: 16, Height: 16}, "S", !config.desaturate)
|
||||
config.saturation = gui.Slider(rl.Rectangle{X: 64, Y: 232, Width: 264, Height: 16}, "", "", config.saturation, 0, 100)
|
||||
y += 24
|
||||
|
||||
gui.Label(rl.Rectangle{X: 40, Y: 256, Width: 16, Height: 16}, "S")
|
||||
config.kValue = gui.Slider(rl.Rectangle{X: 64, Y: 256, Width: 264, Height: 16}, "", "", config.kValue, 0, 2)
|
||||
config.gVisible = gui.Toggle(rl.Rectangle{X: 30, Y: y, Width: 16, Height: 16}, "G", config.gVisible)
|
||||
config.g = uint8(gui.Slider(rl.Rectangle{X: 50, Y: y, Width: 264, Height: 16}, "", "", float32(config.g), 0, 255))
|
||||
|
||||
y += 24
|
||||
|
||||
config.bVisible = gui.Toggle(rl.Rectangle{X: 30, Y: y, Width: 16, Height: 16}, "B", config.bVisible)
|
||||
config.b = uint8(gui.Slider(rl.Rectangle{X: 50, Y: y, Width: 264, Height: 16}, "", "", float32(config.b), 0, 255))
|
||||
|
||||
y += 24
|
||||
|
||||
config.desaturate = !gui.Toggle(rl.Rectangle{X: 30, Y: y, Width: 16, Height: 16}, "S", !config.desaturate)
|
||||
config.saturation = gui.Slider(rl.Rectangle{X: 50, Y: y, Width: 264, Height: 16}, "", "", config.saturation, 0, 100)
|
||||
|
||||
y += 24
|
||||
|
||||
gui.Label(rl.Rectangle{X: 30, Y: y, Width: 16, Height: 16}, "K")
|
||||
config.kValue = gui.Slider(rl.Rectangle{X: 50, Y: y, Width: 264, Height: 16}, "", "", config.kValue, 0, 2)
|
||||
|
||||
y += 30
|
||||
}
|
||||
|
||||
rl.EndDrawing()
|
||||
|
||||
Reference in New Issue
Block a user