Skip to content

Commit

Permalink
Overhaul to use classes (#56)
Browse files Browse the repository at this point in the history
* Delete docs

- Will redo docs in a different way, this was too frustrating

* Delete print.lua.minified

* Delete debug.lua

* Delete color.lua

* Delete draw.button.lua

* Delete draw.lua

* Update print_logger.lua

* Delete print_logger.lua

* Create create_print_logger.lua

* Update builtins.lua

* Update library.lua

* Update build_library.sh

- Formats the library.lua file better

* Delete print.lua.minified

- Removing this for now to get rid of clutter. Will use the library.lua file going forward in all dev work.

* Update builtins.lua

- Removed comments
- Will redo docs later

* Consolidate ColorUtils

- Consolidated utilities into a static class

* Create ColorTables class

- This class will hold color table palettes

* Update Vec2.lua

- Redefine validator functions as global so other functions can depend on them
- Add scale_about and Set
- Handles case that a future Vec3 doesn't accidentally pass as Vec2

* Create Utils.lua

- Shared Utility class for common functions

* Create Button.lua

- Recategorize Button class into a widget
- Will have to rewrite this, but essentially you'll create a shape and pass it to the Button constructor class and create a button from that.

* Create Triangle.lua

- Add robust Triangle class
- Still need to add some more methods like Set_vec2s

* Update Point.lua

- Uses Utils.process_args for clarity and to reduce repetition

* Update Line.lua

- Add methods to create dashed lines between all and from one to all

* Delete draw.primitives.lua

- Will not bother making this since it'll be essentially useless in the library even though it does show what the equivalent API would be for something that matches the library

* Delete button.lua

- Moved

* Create Debug class

- Debug class now holds Debug.Logger() which is the old print() function factory.

* Update library.lua

---------

Co-authored-by: Mark Boyd <[email protected]>
  • Loading branch information
markalanboyd and markalanboyd authored Dec 24, 2023
1 parent acc7c2d commit e440452
Show file tree
Hide file tree
Showing 32 changed files with 1,064 additions and 1,678 deletions.
16 changes: 14 additions & 2 deletions build_library.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
#!/bin/zsh
# Concatenate all Lua files in the current directory into one
# Concatenate all Lua files in the current directory into one except for builtins.

find . -name '*.lua' -not -name 'library.lua' -exec sh -c 'cat {} && echo && echo' \; > library.lua
temp_file="temp_library.lua"

# Add the top content
echo "-- SCROLL TO BOTTOM ----------------------------------------------------\n" > "$temp_file"

# Concatenate the Lua files
find . -name '*.lua' -not -name 'library.lua' -not -name 'builtins.lua' -not -name 'temp_library.lua' -exec sh -c 'cat {} && echo && echo' \; >> "$temp_file"

# Add the bottom content
echo -e "-- AUDULUS-CANVAS LIBRARY ----------------------------------------------\n\n----- Instructions -----\n-- 1. Create 'Time' input (case-sensitive)\n-- 2. Attach Timer node to the 'Time' input\n-- 3. Select 'Save Data' at the bottom of the inspector panel\n-- 4. Set a custom W(idth) and H(eight) in the inspector panel\n-- 5. Write your code below this line\n\n-- CODE ----------------------------------------------------------------\n\n\n\n\n\n-- PRINT CONSOLE -------------------------------------------------------\n\nprint_all()" >> "$temp_file"

# Rename the temporary file to library.lua
mv "$temp_file" "library.lua"
Empty file removed config.ld
Empty file.
66 changes: 0 additions & 66 deletions doc/index.html

This file was deleted.

312 changes: 0 additions & 312 deletions doc/ldoc_fixed.css

This file was deleted.

Loading

0 comments on commit e440452

Please sign in to comment.