Skip to content

Commit cc65886

Browse files
init: Initial Commit
0 parents  commit cc65886

295 files changed

Lines changed: 23180 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Normalize EOL for all files that Git considers text files.
2+
* text=auto eol=lf

.github/workflows/build.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: "Build Sketchpad"
2+
on: push
3+
4+
env:
5+
GODOT_VERSION: 4.6
6+
EXPORT_NAME: sketchpad
7+
PROJECT_PATH: .
8+
9+
jobs:
10+
verify-code:
11+
name: Verify and Test Code
12+
runs-on: ubuntu-24.04
13+
container:
14+
image: barichello/godot-ci:4.6
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
lfs: true
20+
- uses: actions/setup-python@v6
21+
with:
22+
python-version: '3.13'
23+
- name: Setup
24+
run: |
25+
mkdir -v -p ~/.local/share/godot/export_templates/
26+
mkdir -v -p ~/.config/
27+
mv /root/.config/godot ~/.config/godot
28+
mv /root/.local/share/godot/export_templates/${GODOT_VERSION}.stable ~/.local/share/godot/export_templates/${GODOT_VERSION}.stable
29+
- name: Check Code Formatting
30+
run: |
31+
python -m pip install 'gdtoolkit==4.*'
32+
cd $PROJECT_PATH
33+
gdlint $(find . -name "*.gd" -not -path "./addons/*")
34+
- name: Run Unit Tests
35+
run: |
36+
cd $PROJECT_PATH
37+
godot --headless --editor --quit --path "$PWD"
38+
godot -d -s --headless --path "$PWD" addons/gut/gut_cmdln.gd
39+
40+
41+
export-windows:
42+
name: Windows Export
43+
needs: verify-code
44+
runs-on: ubuntu-24.04
45+
container:
46+
image: barichello/godot-ci:4.6
47+
steps:
48+
- name: Checkout
49+
uses: actions/checkout@v4
50+
with:
51+
lfs: true
52+
- name: Setup
53+
run: |
54+
mkdir -v -p ~/.local/share/godot/export_templates/
55+
mkdir -v -p ~/.config/
56+
mv /root/.config/godot ~/.config/godot
57+
mv /root/.local/share/godot/export_templates/${GODOT_VERSION}.stable ~/.local/share/godot/export_templates/${GODOT_VERSION}.stable
58+
- name: Windows Build
59+
run: |
60+
mkdir -v -p build/windows
61+
EXPORT_DIR="$(readlink -f build)"
62+
cd $PROJECT_PATH
63+
godot --headless --verbose --export-release "Windows" "$EXPORT_DIR/windows/$EXPORT_NAME.exe"
64+
- name: Upload Artifact
65+
uses: actions/upload-artifact@v4
66+
with:
67+
name: windows
68+
path: build/windows
69+
70+
export-linux:
71+
name: Linux Export
72+
needs: verify-code
73+
runs-on: ubuntu-24.04 # Use 24.04 with godot 4
74+
container:
75+
image: barichello/godot-ci:4.6
76+
steps:
77+
- name: Checkout
78+
uses: actions/checkout@v4
79+
with:
80+
lfs: true
81+
- name: Setup
82+
run: |
83+
mkdir -v -p ~/.local/share/godot/export_templates/
84+
mv /root/.local/share/godot/export_templates/${GODOT_VERSION}.stable ~/.local/share/godot/export_templates/${GODOT_VERSION}.stable
85+
- name: Linux Build
86+
run: |
87+
mkdir -v -p build/linux
88+
EXPORT_DIR="$(readlink -f build)"
89+
cd $PROJECT_PATH
90+
godot --headless --verbose --export-release "Linux" "$EXPORT_DIR/linux/$EXPORT_NAME.x86_64"
91+
- name: Upload Artifact
92+
uses: actions/upload-artifact@v4
93+
with:
94+
name: linux
95+
path: build/linux

.gitignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Godot 4+ specific ignores
2+
.godot/
3+
.nomedia
4+
5+
# Godot-specific ignores
6+
.import/
7+
export.cfg
8+
export_credentials.cfg
9+
*.tmp
10+
11+
# Imported translations (automatically generated from CSV files)
12+
*.translation
13+
14+
# Mono-specific ignores
15+
.mono/
16+
data_*/
17+
mono_crash.*.json
18+
19+
Builds/

.gutconfig.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"background_color": "262626ff",
3+
"compact_mode": false,
4+
"configured_dirs": [
5+
"res://test/unit"
6+
],
7+
"dirs": [
8+
"res://test/unit"
9+
],
10+
"disable_colors": false,
11+
"double_strategy": 1,
12+
"failure_error_types": [
13+
"engine",
14+
"push_error",
15+
"gut"
16+
],
17+
"font_color": "ccccccff",
18+
"font_name": "CourierPrime",
19+
"font_size": 16.0,
20+
"gut_on_top": true,
21+
"hide_orphans": false,
22+
"ignore_pause": false,
23+
"include_subdirs": false,
24+
"junit_xml_file": "",
25+
"junit_xml_timestamp": false,
26+
"log_level": 1.0,
27+
"no_error_tracking": false,
28+
"opacity": 100.0,
29+
"paint_after": 0.1,
30+
"post_run_script": "",
31+
"pre_run_script": "",
32+
"prefix": "test_",
33+
"should_exit": false,
34+
"should_exit_on_success": false,
35+
"should_maximize": false,
36+
"suffix": ".gd",
37+
"wait_log_delay": 0.5
38+
}

LICENSE

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright (c) 2026 Jordan Brotherton
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
![Sketchpad Logo](assets/base_ux/icon_128.png)
2+
# Sketchpad
3+
Animate like it's 2009!
4+
5+
Modeled after old handheld animation tools, Sketchpad is meant to be fun and easy to use!
6+
7+
## Features
8+
* Lo-fi animations with two resolution options.
9+
* Simple to use UI that gets out of your way.
10+
* Powered by Godot 4.6 for lightweight performance on any device.
11+
12+
## Installation
13+
If you want to use Sketchpad, feel free to download it from the [releases](../../releases/latest) page.
14+
15+
Sketchpad is currently built for Windows and Linux.
16+
17+
## Development
18+
### Building
19+
Make sure you have the standard edition of [Godot 4.6](https://godotengine.org/download/) installed.
20+
21+
1. Clone the repository.
22+
2. Open Godot and load Sketchpad's `project.godot` file.
23+
3. For instructions on how to export an executable, consult the [Godot documentation](https://docs.godotengine.org/en/4.6/tutorials/export/exporting_projects.html).
24+
25+
### GDScript Toolkit
26+
Sketchpad also uses the GDScript Toolkit for linting and formatting. To install it, use the pip package manager:
27+
```
28+
pip install "gdtoolkit==4.*"
29+
```
30+
31+
Once you have it installed, you can run this command in the project folder to verify your contributions follows the [GDScript style guidelines](https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/gdscript_styleguide.html):
32+
```
33+
gdlint $(find . -name "*.gd" -not -path "./addons/*")
34+
```
35+
36+
Any change will be checked for quality in the build automation, so be sure to check to prevent any extra commits.
37+
38+
### Unit Testing
39+
Sketchpad makes use of [Godot Unit Test (GUT)](https://github.com/bitwes/Gut) to test proper functionality. You can run these tests in Godot itself, the command line, or through GUT's VSCode extension.
40+
41+
### Contribution Guidelines
42+
For contributing to Sketchpad, be sure to follow these guidelines:
43+
* For any major change, design considerations should be made in an issue before implementation.
44+
* Your changes should follow the [GDScript style guidelines](https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/gdscript_styleguide.html). The CI builds will halt if any style error is found.
45+
* If you are adding any major new feature, be sure to consider unit testing to verify proper functionality.
46+
* The commit messages should follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard.

addons/gut/GutScene.gd

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
extends Node2D
2+
# ##############################################################################
3+
# This is a wrapper around the normal and compact gui controls and serves as
4+
# the interface between gut.gd and the gui. The GutRunner creates an instance
5+
# of this and then this takes care of managing the different GUI controls.
6+
# ##############################################################################
7+
@onready var _normal_gui = $Normal
8+
@onready var _compact_gui = $Compact
9+
10+
var gut = null :
11+
set(val):
12+
gut = val
13+
_set_gut(val)
14+
15+
16+
func _ready():
17+
_normal_gui.switch_modes.connect(use_compact_mode.bind(true))
18+
_compact_gui.switch_modes.connect(use_compact_mode.bind(false))
19+
20+
_normal_gui.set_title("GUT")
21+
_compact_gui.set_title("GUT")
22+
23+
_normal_gui.align_right()
24+
_compact_gui.to_bottom_right()
25+
26+
use_compact_mode(false)
27+
28+
if(get_parent() == get_tree().root):
29+
_test_running_setup()
30+
31+
func _test_running_setup():
32+
set_font_size(100)
33+
_normal_gui.get_textbox().text = "hello world, how are you doing?"
34+
35+
# ------------------------
36+
# Private
37+
# ------------------------
38+
func _set_gut(val):
39+
if(_normal_gui.get_gut() == val):
40+
return
41+
_normal_gui.set_gut(val)
42+
_compact_gui.set_gut(val)
43+
44+
val.start_run.connect(_on_gut_start_run)
45+
val.end_run.connect(_on_gut_end_run)
46+
val.start_pause_before_teardown.connect(_on_gut_pause)
47+
val.end_pause_before_teardown.connect(_on_pause_end)
48+
49+
func _set_both_titles(text):
50+
_normal_gui.set_title(text)
51+
_compact_gui.set_title(text)
52+
53+
54+
# ------------------------
55+
# Events
56+
# ------------------------
57+
func _on_gut_start_run():
58+
_set_both_titles('Running')
59+
60+
func _on_gut_end_run():
61+
_set_both_titles('Finished')
62+
63+
func _on_gut_pause():
64+
_set_both_titles('-- Paused --')
65+
66+
func _on_pause_end():
67+
_set_both_titles('Running')
68+
69+
70+
# ------------------------
71+
# Public
72+
# ------------------------
73+
func get_textbox():
74+
return _normal_gui.get_textbox()
75+
76+
77+
func set_font_size(new_size):
78+
var rtl = _normal_gui.get_textbox()
79+
80+
rtl.set('theme_override_font_sizes/bold_italics_font_size', new_size)
81+
rtl.set('theme_override_font_sizes/bold_font_size', new_size)
82+
rtl.set('theme_override_font_sizes/italics_font_size', new_size)
83+
rtl.set('theme_override_font_sizes/normal_font_size', new_size)
84+
85+
86+
func set_font(font_name):
87+
_set_all_fonts_in_rtl(_normal_gui.get_textbox(), font_name)
88+
89+
90+
func _set_font(rtl, font_name, custom_name):
91+
if(font_name == null):
92+
rtl.remove_theme_font_override(custom_name)
93+
else:
94+
var font_path = 'res://addons/gut/fonts/' + font_name + '.ttf'
95+
if(FileAccess.file_exists(font_path)):
96+
var dyn_font = FontFile.new()
97+
dyn_font.load_dynamic_font('res://addons/gut/fonts/' + font_name + '.ttf')
98+
rtl.add_theme_font_override(custom_name, dyn_font)
99+
100+
101+
func _set_all_fonts_in_rtl(rtl, base_name):
102+
if(base_name == 'Default'):
103+
_set_font(rtl, null, 'normal_font')
104+
_set_font(rtl, null, 'bold_font')
105+
_set_font(rtl, null, 'italics_font')
106+
_set_font(rtl, null, 'bold_italics_font')
107+
else:
108+
_set_font(rtl, base_name + '-Regular', 'normal_font')
109+
_set_font(rtl, base_name + '-Bold', 'bold_font')
110+
_set_font(rtl, base_name + '-Italic', 'italics_font')
111+
_set_font(rtl, base_name + '-BoldItalic', 'bold_italics_font')
112+
113+
114+
func set_default_font_color(color):
115+
_normal_gui.get_textbox().set('custom_colors/default_color', color)
116+
117+
118+
func set_background_color(color):
119+
_normal_gui.set_bg_color(color)
120+
121+
122+
func use_compact_mode(should=true):
123+
_compact_gui.visible = should
124+
_normal_gui.visible = !should
125+
126+
127+
func set_opacity(val):
128+
_normal_gui.modulate.a = val
129+
_compact_gui.modulate.a = val
130+
131+
func set_title(text):
132+
_set_both_titles(text)

addons/gut/GutScene.gd.uid

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
uid://bw7tukh738kw1

addons/gut/GutScene.tscn

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[gd_scene load_steps=4 format=3 uid="uid://m28heqtswbuq"]
2+
3+
[ext_resource type="Script" uid="uid://bw7tukh738kw1" path="res://addons/gut/GutScene.gd" id="1_b4m8y"]
4+
[ext_resource type="PackedScene" uid="uid://duxblir3vu8x7" path="res://addons/gut/gui/NormalGui.tscn" id="2_j6ywb"]
5+
[ext_resource type="PackedScene" uid="uid://cnqqdfsn80ise" path="res://addons/gut/gui/MinGui.tscn" id="3_3glw1"]
6+
7+
[node name="GutScene" type="Node2D"]
8+
script = ExtResource("1_b4m8y")
9+
10+
[node name="Normal" parent="." instance=ExtResource("2_j6ywb")]
11+
12+
[node name="Compact" parent="." instance=ExtResource("3_3glw1")]
13+
offset_left = 5.0
14+
offset_top = 273.0
15+
offset_right = 265.0
16+
offset_bottom = 403.0

addons/gut/LICENSE.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
=====================
3+
4+
Copyright (c) 2018 Tom "Butch" Wesley
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in
14+
all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
THE SOFTWARE.

0 commit comments

Comments
 (0)