diff --git a/aphrodite b/aphrodite deleted file mode 100644 index 85bbb13..0000000 Binary files a/aphrodite and /dev/null differ diff --git a/aphrodite.jpeg b/aphrodite.jpeg deleted file mode 100644 index b779412..0000000 Binary files a/aphrodite.jpeg and /dev/null differ diff --git a/flake.nix b/flake.nix index a776098..d1b00de 100644 --- a/flake.nix +++ b/flake.nix @@ -72,7 +72,8 @@ #vendorHash = "sha256-HDfllPEKJZOtkSoasS1yDCyZrWihlkBVRstLkF8AHd0="; # use this every time there's vendor changeO - vendorHash = pkgs.lib.fakeHash; + #vendorHash = pkgs.lib.fakeHash; + vendorHash = "sha256-Z0zuk4F8O/5fTe7vawOTFPODp8lm00VJBd2P4n0XNU8="; ldflags = [ "-s" diff --git a/go.mod b/go.mod index 2ab5218..50e0c7b 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,7 @@ go 1.24.0 toolchain go1.24.10 require ( + github.com/gen2brain/raylib-go/raygui v0.0.0-20251219174542-17d5a83d1c33 github.com/gen2brain/raylib-go/raylib v0.55.1 github.com/go-git/go-git/v6 v6.0.0-20251212081956-e83cbb9651e8 github.com/ojrac/opensimplex-go v1.0.2 @@ -17,7 +18,7 @@ require ( github.com/cloudflare/circl v1.6.1 // indirect github.com/cyphar/filepath-securejoin v0.6.1 // indirect github.com/dustin/go-humanize v1.0.1 // indirect - github.com/ebitengine/purego v0.7.1 // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/go-git/gcfg/v2 v2.0.2 // indirect github.com/go-git/go-billy/v6 v6.0.0-20251126203821-7f9c95185ee0 // indirect diff --git a/go.sum b/go.sum index 62df516..fe24bda 100644 --- a/go.sum +++ b/go.sum @@ -15,12 +15,14 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/ebitengine/purego v0.7.1 h1:6/55d26lG3o9VCZX8lping+bZcmShseiqlh2bnUDiPA= -github.com/ebitengine/purego v0.7.1/go.mod h1:ah1In8AOtksoNK6yk5z1HTJeUkC1Ez4Wk2idgGslMwQ= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/elazarl/goproxy v1.7.2 h1:Y2o6urb7Eule09PjlhQRGNsqRfPmYI3KKQLFpCAV3+o= github.com/elazarl/goproxy v1.7.2/go.mod h1:82vkLNir0ALaW14Rc399OTTjyNREgmdL2cVoIbS6XaE= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= +github.com/gen2brain/raylib-go/raygui v0.0.0-20251219174542-17d5a83d1c33 h1:0QCKLp5dkMP9f2LOz/LBeJVVSMs66661AIih7GOMHb4= +github.com/gen2brain/raylib-go/raygui v0.0.0-20251219174542-17d5a83d1c33/go.mod h1:Ji/uPEko2AUkcyPLAelEUa+E8Npc89/XY5Fo/lS/e3I= github.com/gen2brain/raylib-go/raylib v0.55.1 h1:1rdc10WvvYjtj7qijHnV9T38/WuvlT6IIL+PaZ6cNA8= github.com/gen2brain/raylib-go/raylib v0.55.1/go.mod h1:BaY76bZk7nw1/kVOSQObPY1v1iwVE1KHAGMfvI6oK1Q= github.com/gliderlabs/ssh v0.3.8 h1:a4YXD1V7xMF9g5nTkdfnja3Sxy1PVDCj1Zg4Wb8vY6c= diff --git a/main.go b/main.go index e415bc2..c65488c 100644 --- a/main.go +++ b/main.go @@ -1,14 +1,15 @@ package main import ( - "fmt" + // "fmt" "log" "math/rand" "os" "time" - "github.com/gen2brain/raylib-go/raylib" - "github.com/ojrac/opensimplex-go" + gui "github.com/gen2brain/raylib-go/raygui" + rl "github.com/gen2brain/raylib-go/raylib" + //"github.com/ojrac/opensimplex-go" ) const ( @@ -34,6 +35,31 @@ func main() { rl.SetConfigFlags(rl.FlagMsaa4xHint) rl.InitWindow(targetWidth, targetHeight, "sumi sierpinski arrow") + // layout_name: controls initialization + var ControlScrollPaneScrollView rl.Rectangle + var ControlScrollPaneScrollOffset rl.Vector2 + //var ControlScrollPaneBoundsOffset rl.Vector2 + + BlendModeToggleGroupActive := int32(0) + + Slider003Value := float32(0.0) + + RTogglePressed := false + GTogglePressed := false + BTogglePressed := false + + Slider008Value := float32(0.0) + Slider009Value := float32(0.0) + Slider010Value := float32(0.0) + + ATogglePressed := false + SaturationTogglePressed := false + + SaturationSliderValue := float32(0.0) + KSliderValue := float32(0.0) + KTogglePressed := false + // end layout vars + rl.SetTargetFPS(60) t0 := time.Now() @@ -96,8 +122,69 @@ func main() { * MAIN DRAWING */ rl.BeginDrawing() - rl.ClearBackground(rl.Blank) + rl.ClearBackground(rl.GetColor(uint(gui.GetStyle(gui.DEFAULT, gui.BACKGROUND_COLOR)))) + 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) + + controlPanelWidth := float32(targetWidth) / 4.0 + controlPanelHeight := float32(targetHeight) + + // add gui layout controls + // raygui: controls drawing + gui.ScrollPanel( + rl.Rectangle{ + X: 10, + Y: 10, + Width: controlPanelWidth - 20, + Height: controlPanelHeight - 20, + }, + "", + rl.Rectangle{X: 10, Y: 10, Width: controlPanelWidth, Height: controlPanelHeight }, + &ControlScrollPaneScrollOffset, + &ControlScrollPaneScrollView, + ) + + 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) + + gui.Label(rl.Rectangle{X: 20, Y: 90, Width: 120, Height: 24}, "Contour Layer") + + ATogglePressed = gui.LabelButton(rl.Rectangle{X: 40, Y: 136, Width: 16, Height: 16}, "A") + Slider003Value = gui.Slider(rl.Rectangle{X: 64, Y: 136, Width: 264, Height: 16}, "", "", Slider003Value, 0, 255) + + RTogglePressed = gui.LabelButton(rl.Rectangle{X: 40, Y: 160, Width: 16, Height: 16}, "R") + Slider008Value = gui.Slider(rl.Rectangle{X: 64, Y: 160, Width: 264, Height: 16}, "", "", Slider008Value, 0, 100) + + GTogglePressed = gui.LabelButton(rl.Rectangle{X: 40, Y: 184, Width: 16, Height: 16}, "G") + Slider009Value = gui.Slider(rl.Rectangle{X: 64, Y: 184, Width: 264, Height: 16}, "", "", Slider009Value, 0, 100) + + BTogglePressed = gui.LabelButton(rl.Rectangle{X: 40, Y: 208, Width: 16, Height: 16}, "B") + Slider010Value = gui.Slider(rl.Rectangle{X: 64, Y: 208, Width: 264, Height: 16}, "", "", Slider010Value, 0, 100) + + SaturationTogglePressed = gui.LabelButton(rl.Rectangle{X: 40, Y: 232, Width: 16, Height: 16}, "S") + + gui.Slider(rl.Rectangle{X: 64, Y: 232, Width: 264, Height: 16}, "", "", SaturationSliderValue, 0, 100) + gui.Slider(rl.Rectangle{X: 64, Y: 256, Width: 264, Height: 16}, "", "", KSliderValue, 0, 100) + + KTogglePressed = gui.LabelButton(rl.Rectangle{X: 40, Y: 256, Width: 16, Height: 16}, "K") + + // NOTE: LabelButton returns "pressed this frame" bool, so these are edge-triggered. + _ = RTogglePressed + _ = GTogglePressed + _ = BTogglePressed + _ = ATogglePressed + _ = SaturationTogglePressed + _ = KTogglePressed + rl.EndDrawing() if rl.IsKeyDown(rl.KeySpace) { @@ -149,51 +236,3 @@ func (s *FieldLayer) IsDirty() bool { return s.dirty } -type SierpinskiArrow struct{} - -func (s *SierpinskiArrow) Draw(ctx *RenderCtx) { - sierpinskiArrow(ctx, int(ctx.Ports["sierpinskiArrowDepth"]), ctx.Ports["sierpinskiArrowLength"]) -} - -func sierpinskiArrow(ctx *RenderCtx, order int, length float64) { - if order == 0 { - curve(ctx, order, length, ctx.Ports["sierpinskiArrowAngle"]) - } else { - rl.Rotatef(float32(ctx.Ports["sierpinskiArrowAngle"]), 0, 0, 1) - curve(ctx, order, length, -ctx.Ports["sierpinskiArrowAngle"]) - } -} - -func curve(ctx *RenderCtx, order int, length float64, angle float64) { - if order == 0 { - len := int32(length) - rl.DrawLine(0, 0, len, 0, rl.Black) - rl.Translatef(float32(length), 0, 0) - } else { - curve(ctx, order-1, length/2, -angle) - rl.Rotatef(float32(angle), 0, 0, 1) - curve(ctx, order-1, length/2, angle) - rl.Rotatef(float32(angle), 0, 0, 1) - curve(ctx, order-1, length/2, -angle) - } -} - -func main2() { - angles := make([]float32, 1000) - noise := opensimplex.NewNormalized(0) - for i := range len(angles) { - angles[i] = float32(noise.Eval2(float64(i)*0.05, 0.00))*0.1 - 0.05 - } - frameNum := 0 - for !rl.WindowShouldClose() { - frameNum++ - // initial transform by halfway again through angle array - angleIndex := (frameNum / 10) % len(angles) - angle := angles[angleIndex] - initAngle := angles[(angleIndex+len(angles)/2)%len(angles)] - rl.Rotatef(2500*initAngle, 0, 0, 1) - rl.Translatef(100*initAngle, 100*initAngle, 0) - fmt.Printf("%.3f", angle) - rl.EndMode2D() - } -} diff --git a/rguistyler_v6.0_linux_x64.zip b/rguistyler_v6.0_linux_x64.zip deleted file mode 100644 index 7161a1f..0000000 Binary files a/rguistyler_v6.0_linux_x64.zip and /dev/null differ diff --git a/rguistyler_v6.0_linux_x64/LICENSE b/rguistyler_v6.0_linux_x64/LICENSE deleted file mode 100644 index 31e82a6..0000000 --- a/rguistyler_v6.0_linux_x64/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -zlib License - -Copyright (c) 2015-2024 raylib technologies (@raylibtech) / Ramon Santamaria (@raysan5) - -This software is provided "as-is", without any express or implied warranty. In no event -will the authors be held liable for any damages arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, including commercial -applications, and to alter it and redistribute it freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not claim that you - wrote the original software. If you use this software in a product, an acknowledgment - in the product documentation would be appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be misrepresented - as being the original software. - - 3. This notice may not be removed or altered from any source distribution. diff --git a/rguistyler_v6.0_linux_x64/README.md b/rguistyler_v6.0_linux_x64/README.md deleted file mode 100644 index 0b35684..0000000 --- a/rguistyler_v6.0_linux_x64/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# `rGuiStyler` - -A simple and easy-to-use [raygui](https://github.com/raysan5/raygui) styles editor. - -Useful for tools style customization. The best tool companion for [rGuiLayout](https://raylibtech.itch.io/rguilayout) and [rGuiIcons](https://raylibtech.itch.io/rguiicons). - -`rGuiStyler` can be used for free as a [WebAssembly online tool](https://raylibtech.itch.io/rguistyler) and it can also be downloaded as a **standalone tool** for `Windows`, `Linux` and `macOS` with some extra features. - -**NOTE: Latest `rGuiStyler 6.0` release is intended to be used with [`raygui 4.5+`](https://github.com/raysan5/raygui) release.** - -## Features - - - **Global and control specific styles edition** - - **Style preview** in real time with individual test controls - - **Style templates** available to start customizing new styles - - Selectable controls state: **NORMAL, FOCUSED, PRESSED, DISABLED** - - Save and load as binary style file `.rgs` (with font embedded!) - - Export style as an embeddable **code file** (`.h`) (with font embedded!) - - Export style as a `.png` **controls table image** for showcase - - Embed style as png image chunk: `rGSf` (rgs file data) - - Import, configure and preview **style fonts** (`.ttf`/`.otf`) - - Load custom font charset for the style (Unicode codepoints) - - Color palette for quick color save/selection - - **+14 custom style examples** included for reference - - Command-line support for `.rgs`/`.h`/`.png` batch conversion - - **Free and open source** - -## Screenshot - -![rGuiStyler](screenshots/rguistyler_v600_shot01.png) - -## Usage - -The tool is quite intuitive, the expected steps to follow are: - 1. Choose the control to edit from the Controls ListView (`DEFAULT` referes to global style for all controls) - 2. Choose the property to edit from Properties ListView - 3. Select a value for that property (color, number...) on Control Property Edit window - 4. Font can be loaded and atlas generated automatically - -NOTE: Changes are previewed in real time in the same tool! - -Once the desired style has been created, press the `Export Style` button to save it as a `.rgs`**binary style file**. Style can also be exported as an embeddable `.h` **code file** or a `.png` **controls table image** (intended for preview and style showcase) - -`rGuiStyler Standalone` comes with command-line support for batch conversion. For usage help: - - > rguistyler.exe --help - -## License - -`rGuiStyler` source code is distributed as **open source**, licensed under an unmodified [zlib/libpng license](LICENSE). - -`rGuiStyler` binaries are completely free for anyone willing to compile them directly from source. - -`rGuiStyler Standalone` desktop tool is distributed as freeware. - -In any case, consider some donation to help the author keep working on software for games development. - -*Copyright (c) 2017-2025 raylib technologies ([@raylibtech](https://twitter.com/raylibtech)) / Ramon Santamaria ([@raysan5](https://twitter.com/raysan5))* diff --git a/rguistyler_v6.0_linux_x64/resources/resources/2a03.ttf b/rguistyler_v6.0_linux_x64/resources/resources/2a03.ttf deleted file mode 100644 index 71f6e9d..0000000 Binary files a/rguistyler_v6.0_linux_x64/resources/resources/2a03.ttf and /dev/null differ diff --git a/rguistyler_v6.0_linux_x64/resources/resources/Cartridge.ttf b/rguistyler_v6.0_linux_x64/resources/resources/Cartridge.ttf deleted file mode 100644 index 19d7280..0000000 Binary files a/rguistyler_v6.0_linux_x64/resources/resources/Cartridge.ttf and /dev/null differ diff --git a/rguistyler_v6.0_linux_x64/resources/resources/CozetteVector.otf b/rguistyler_v6.0_linux_x64/resources/resources/CozetteVector.otf deleted file mode 100644 index 62beedb..0000000 Binary files a/rguistyler_v6.0_linux_x64/resources/resources/CozetteVector.otf and /dev/null differ diff --git a/rguistyler_v6.0_linux_x64/resources/resources/Fairfax.ttf b/rguistyler_v6.0_linux_x64/resources/resources/Fairfax.ttf deleted file mode 100644 index 86cd9b3..0000000 Binary files a/rguistyler_v6.0_linux_x64/resources/resources/Fairfax.ttf and /dev/null differ diff --git a/rguistyler_v6.0_linux_x64/resources/resources/GMSN.ttf b/rguistyler_v6.0_linux_x64/resources/resources/GMSN.ttf deleted file mode 100644 index 777a528..0000000 Binary files a/rguistyler_v6.0_linux_x64/resources/resources/GMSN.ttf and /dev/null differ diff --git a/rguistyler_v6.0_linux_x64/resources/resources/Kyrou7Wide.ttf b/rguistyler_v6.0_linux_x64/resources/resources/Kyrou7Wide.ttf deleted file mode 100644 index 165c3e7..0000000 Binary files a/rguistyler_v6.0_linux_x64/resources/resources/Kyrou7Wide.ttf and /dev/null differ diff --git a/rguistyler_v6.0_linux_x64/resources/resources/LICENSES.md b/rguistyler_v6.0_linux_x64/resources/resources/LICENSES.md deleted file mode 100644 index 9c23258..0000000 --- a/rguistyler_v6.0_linux_x64/resources/resources/LICENSES.md +++ /dev/null @@ -1,23 +0,0 @@ -## Fonts licenses - -All included fonts are licensed under a permissive license, usually free to use for personal use and in most cases also for commercial use. In any case, individual licenses should be carefully reviewed and it's recommended to contact creators in case of doubts. - -| Font Name | File Name | License Type | Creator | More details | -|-----------------------|----------------------|------------------------------------------|--------------------------------|-------------------------------------| -| 2A03 | `2a03.ttf` | Free for Personal & Commercial Use | memesbruh03 | https://www.dafont.com/2a03.font | -| Cartridge | `Cartridge.ttf` | [Creative Commons BY 4.0](https://creativecommons.org/licenses/by/4.0/) | jeti | https://www.dafont.com/cartridge.font | -| CozetteVector | `CozetteVector.otf` | [MIT License](https://github.com/slavfox/Cozette/blob/main/LICENSE) | [Slavfox](https://github.com/slavfox) | https://github.com/slavfox/Cozette | -| Fairfax | `Fairfax.ttf` | [SIL Open Font License 1.1](https://github.com/kreativekorp/open-relay/blob/master/Fairfax/OFL.txt) | Kreative Korp | https://github.com/kreativekorp/open-relay | -| Generic Mobile System Nuevo | `GMSN.ttf` | [Creative Commons Zero (CC0) 1.0](https://creativecommons.org/licenses/zero/1.0/) | Jayvee Enaguas (HarvettFox96) | https://www.dafont.com/generic-mobile-system.font | -| Hello World Regular | `hello-world.ttf` | SIL Open Font License | Anthony Gross | https://www.dafont.com/hello-world.font | -| Homespun TT BRK | `homespun.ttf` | Free for Personal Use | AEnigma (Brian Kent) | https://www.dafont.com/homespun-brk.font | -| Grixel Kyrou 7 Wide | `Kyrou7Wide.ttf` | [Creative Commons BY-ND 2.5](http://creativecommons.org/licenses/by-nd/2.5/) | Nikos Giannakopoulos | https://www.dafont.com/grixel-kyrou-7-wide.font -| Mecha | `Mecha.ttf` | Free for Personal Use | Captain Falcon | https://www.dafont.com/mecha-cf.font | -| OwreKynge | `OwreKynge.ttf` | [Creative Commons BY 4.0](https://creativecommons.org/licenses/by/4.0/) | jeti | https://www.dafont.com/owrekynge.font | -| Pixel Intv | `PixelIntv.otf` | Free for Personal Use | Pixel Sagas (Neale Davidson) | https://www.dafont.com/pixel-intv.font | -| Pixel Operator | `PixelOperator.ttf` | [Creative Commons Zero (CC0) 1.0](https://creativecommons.org/licenses/zero/1.0/) | Jayvee Enaguas (HarvettFox96) | https://www.dafont.com/pixel-operator.font | -| V5 Eastergothic | `v5easter.ttf` | Free, use at will | Roberto Christen | https://www.dafont.com/v5eastergothic.font | -| V5 Loxical Lixera | `v5loxical.ttf` | Free, use at will | Roberto Christen | https://www.dafont.com/v5loxica-lixera.font | -| Westington | `Westington.ttf` | Free use for anything, personal or otherwise | Hazel Abbiati | https://www.dafont.com/westington.font | - -Enjoy it! \ No newline at end of file diff --git a/rguistyler_v6.0_linux_x64/resources/resources/Mecha.ttf b/rguistyler_v6.0_linux_x64/resources/resources/Mecha.ttf deleted file mode 100644 index 928f63a..0000000 Binary files a/rguistyler_v6.0_linux_x64/resources/resources/Mecha.ttf and /dev/null differ diff --git a/rguistyler_v6.0_linux_x64/resources/resources/OwreKynge.ttf b/rguistyler_v6.0_linux_x64/resources/resources/OwreKynge.ttf deleted file mode 100644 index 6a0dc64..0000000 Binary files a/rguistyler_v6.0_linux_x64/resources/resources/OwreKynge.ttf and /dev/null differ diff --git a/rguistyler_v6.0_linux_x64/resources/resources/PixelIntv.otf b/rguistyler_v6.0_linux_x64/resources/resources/PixelIntv.otf deleted file mode 100644 index e8c54a7..0000000 Binary files a/rguistyler_v6.0_linux_x64/resources/resources/PixelIntv.otf and /dev/null differ diff --git a/rguistyler_v6.0_linux_x64/resources/resources/PixelOperator.ttf b/rguistyler_v6.0_linux_x64/resources/resources/PixelOperator.ttf deleted file mode 100644 index 34fe947..0000000 Binary files a/rguistyler_v6.0_linux_x64/resources/resources/PixelOperator.ttf and /dev/null differ diff --git a/rguistyler_v6.0_linux_x64/resources/resources/Westington.ttf b/rguistyler_v6.0_linux_x64/resources/resources/Westington.ttf deleted file mode 100644 index 68efae8..0000000 Binary files a/rguistyler_v6.0_linux_x64/resources/resources/Westington.ttf and /dev/null differ diff --git a/rguistyler_v6.0_linux_x64/resources/resources/hello-world.ttf b/rguistyler_v6.0_linux_x64/resources/resources/hello-world.ttf deleted file mode 100644 index 7d190b8..0000000 Binary files a/rguistyler_v6.0_linux_x64/resources/resources/hello-world.ttf and /dev/null differ diff --git a/rguistyler_v6.0_linux_x64/resources/resources/homespun.ttf b/rguistyler_v6.0_linux_x64/resources/resources/homespun.ttf deleted file mode 100644 index 45c23e0..0000000 Binary files a/rguistyler_v6.0_linux_x64/resources/resources/homespun.ttf and /dev/null differ diff --git a/rguistyler_v6.0_linux_x64/resources/resources/v5easter.ttf b/rguistyler_v6.0_linux_x64/resources/resources/v5easter.ttf deleted file mode 100644 index 77a911a..0000000 Binary files a/rguistyler_v6.0_linux_x64/resources/resources/v5easter.ttf and /dev/null differ diff --git a/rguistyler_v6.0_linux_x64/resources/resources/v5loxical.ttf b/rguistyler_v6.0_linux_x64/resources/resources/v5loxical.ttf deleted file mode 100644 index 61501cb..0000000 Binary files a/rguistyler_v6.0_linux_x64/resources/resources/v5loxical.ttf and /dev/null differ diff --git a/rguistyler_v6.0_linux_x64/rguistyler b/rguistyler_v6.0_linux_x64/rguistyler deleted file mode 100755 index 86c3706..0000000 Binary files a/rguistyler_v6.0_linux_x64/rguistyler and /dev/null differ diff --git a/rguistyler_v6.0_linux_x64/styles/styles/style_amber.rgs b/rguistyler_v6.0_linux_x64/styles/styles/style_amber.rgs deleted file mode 100644 index 44d806e..0000000 Binary files a/rguistyler_v6.0_linux_x64/styles/styles/style_amber.rgs and /dev/null differ diff --git a/rguistyler_v6.0_linux_x64/styles/styles/style_ashes.rgs b/rguistyler_v6.0_linux_x64/styles/styles/style_ashes.rgs deleted file mode 100644 index 56fb93b..0000000 Binary files a/rguistyler_v6.0_linux_x64/styles/styles/style_ashes.rgs and /dev/null differ diff --git a/rguistyler_v6.0_linux_x64/styles/styles/style_bluish.rgs b/rguistyler_v6.0_linux_x64/styles/styles/style_bluish.rgs deleted file mode 100644 index 5a27c6e..0000000 Binary files a/rguistyler_v6.0_linux_x64/styles/styles/style_bluish.rgs and /dev/null differ diff --git a/rguistyler_v6.0_linux_x64/styles/styles/style_candy.rgs b/rguistyler_v6.0_linux_x64/styles/styles/style_candy.rgs deleted file mode 100644 index f016522..0000000 Binary files a/rguistyler_v6.0_linux_x64/styles/styles/style_candy.rgs and /dev/null differ diff --git a/rguistyler_v6.0_linux_x64/styles/styles/style_cherry.rgs b/rguistyler_v6.0_linux_x64/styles/styles/style_cherry.rgs deleted file mode 100644 index 7ef11a2..0000000 Binary files a/rguistyler_v6.0_linux_x64/styles/styles/style_cherry.rgs and /dev/null differ diff --git a/rguistyler_v6.0_linux_x64/styles/styles/style_cyber.rgs b/rguistyler_v6.0_linux_x64/styles/styles/style_cyber.rgs deleted file mode 100644 index 142aeee..0000000 Binary files a/rguistyler_v6.0_linux_x64/styles/styles/style_cyber.rgs and /dev/null differ diff --git a/rguistyler_v6.0_linux_x64/styles/styles/style_dark.rgs b/rguistyler_v6.0_linux_x64/styles/styles/style_dark.rgs deleted file mode 100644 index 1e965d9..0000000 Binary files a/rguistyler_v6.0_linux_x64/styles/styles/style_dark.rgs and /dev/null differ diff --git a/rguistyler_v6.0_linux_x64/styles/styles/style_enefete.rgs b/rguistyler_v6.0_linux_x64/styles/styles/style_enefete.rgs deleted file mode 100644 index 7eea922..0000000 Binary files a/rguistyler_v6.0_linux_x64/styles/styles/style_enefete.rgs and /dev/null differ diff --git a/rguistyler_v6.0_linux_x64/styles/styles/style_genesis.rgs b/rguistyler_v6.0_linux_x64/styles/styles/style_genesis.rgs deleted file mode 100644 index 1d12f67..0000000 Binary files a/rguistyler_v6.0_linux_x64/styles/styles/style_genesis.rgs and /dev/null differ diff --git a/rguistyler_v6.0_linux_x64/styles/styles/style_jungle.rgs b/rguistyler_v6.0_linux_x64/styles/styles/style_jungle.rgs deleted file mode 100644 index 843867c..0000000 Binary files a/rguistyler_v6.0_linux_x64/styles/styles/style_jungle.rgs and /dev/null differ diff --git a/rguistyler_v6.0_linux_x64/styles/styles/style_lavanda.rgs b/rguistyler_v6.0_linux_x64/styles/styles/style_lavanda.rgs deleted file mode 100644 index 1a28c1c..0000000 Binary files a/rguistyler_v6.0_linux_x64/styles/styles/style_lavanda.rgs and /dev/null differ diff --git a/rguistyler_v6.0_linux_x64/styles/styles/style_rltech.rgs b/rguistyler_v6.0_linux_x64/styles/styles/style_rltech.rgs deleted file mode 100644 index 576d1ac..0000000 Binary files a/rguistyler_v6.0_linux_x64/styles/styles/style_rltech.rgs and /dev/null differ diff --git a/rguistyler_v6.0_linux_x64/styles/styles/style_sunny.rgs b/rguistyler_v6.0_linux_x64/styles/styles/style_sunny.rgs deleted file mode 100644 index 5a53c50..0000000 Binary files a/rguistyler_v6.0_linux_x64/styles/styles/style_sunny.rgs and /dev/null differ diff --git a/rguistyler_v6.0_linux_x64/styles/styles/style_terminal.rgs b/rguistyler_v6.0_linux_x64/styles/styles/style_terminal.rgs deleted file mode 100644 index 6cea868..0000000 Binary files a/rguistyler_v6.0_linux_x64/styles/styles/style_terminal.rgs and /dev/null differ diff --git a/sierpinski.go b/sierpinski.go new file mode 100644 index 0000000..3f3d5be --- /dev/null +++ b/sierpinski.go @@ -0,0 +1,35 @@ +package main + +import ( + rl "github.com/gen2brain/raylib-go/raylib" +) + +type SierpinskiArrow struct{} + +func (s *SierpinskiArrow) Draw(ctx *RenderCtx) { + sierpinskiArrow(ctx, int(ctx.Ports["sierpinskiArrowDepth"]), ctx.Ports["sierpinskiArrowLength"]) +} + +func sierpinskiArrow(ctx *RenderCtx, order int, length float64) { + if order == 0 { + curve(ctx, order, length, ctx.Ports["sierpinskiArrowAngle"]) + } else { + rl.Rotatef(float32(ctx.Ports["sierpinskiArrowAngle"]), 0, 0, 1) + curve(ctx, order, length, -ctx.Ports["sierpinskiArrowAngle"]) + } +} + +func curve(ctx *RenderCtx, order int, length float64, angle float64) { + if order == 0 { + len := int32(length) + rl.DrawLine(0, 0, len, 0, rl.Black) + rl.Translatef(float32(length), 0, 0) + } else { + curve(ctx, order-1, length/2, -angle) + rl.Rotatef(float32(angle), 0, 0, 1) + curve(ctx, order-1, length/2, angle) + rl.Rotatef(float32(angle), 0, 0, 1) + curve(ctx, order-1, length/2, -angle) + } +} + diff --git a/sketch.go b/sketch.go index ba8a296..a4c6e93 100644 --- a/sketch.go +++ b/sketch.go @@ -45,6 +45,7 @@ func (s *Sketch) CreateLayer(name string, layer Layer) { name: name, texture: &texture, layer: layer, + config: NewLayerConfig(), } s.layerToolsOrdered = append(s.layerToolsOrdered, layerTools) s.layerTools[name] = layerTools @@ -194,6 +195,44 @@ type LayerTools struct { name string layer Layer texture *rl.RenderTexture2D + config LayerConfig +} + +func NewLayerConfig() LayerConfig { + return LayerConfig { + visible: true, + a: 255, + rVisible: true, + r: 255, + gVisible: true, + g: 255, + bVisible: true, + b: 255, + desaturate: false, + kValue: 1.0, + } +} + +type LayerConfig struct { + + visible bool + a uint8 + + rVisible bool + r uint8 + + gVisible bool + g uint8 + + + bVisible bool + b uint8 + + + desaturate bool + saturation float32 + + kValue float32 } /** Layer **/ diff --git a/styles/dark.rgs b/styles/dark.rgs new file mode 100644 index 0000000..76fc64e Binary files /dev/null and b/styles/dark.rgs differ