
Drawn2Code
Although writing script code by hand is a great way to program, it isn't necessarily great for everyone or all the time. In addition to the Solar2D, you will have the option to use Drawn2Code to write much of the code for us. Drawn2Code has been created by me specifically for this course. This can be a great tool to help build apps and to explore scripting techniques.

Downloads
Get the latest version! There are separate downloads for Mac or PC:
mac_d2c_download.dmg (Notarized Mac app; Updated 2/27/25, Version 1.587)
win_d2c_download.zip (Windows installer file, Updated 2/27/25, Version 1.587)
The download is encrypted using access code (provided on the first day of class or on page 8 of the course textbook).
The latest version features (be sure to refresh this page):
Update focused on the editability of the troublesome texfields. Let me know. Also, loaded designs with controls should now show the control condition correctly in the settings panel after opening the design. (1.587)
Recently added:
This is a small update to change the close window behavior. Now, you can shut an open object stack window, for example, by just closing it (rather than hitting the recall window button). Nothing major. (1.586)
Fixed the issue stopping script objects inside controls from being able to be moved up or down in the stack. Other minor fixes. Get this update. (1.585)
Revised built-in functions so that the function code is now in a snippet. Added a new function (clearDisplayGroup) and updated the warning system that adds alerts to script objects with potential errors. Recoded textfields for control conditions and button text to try to eliminate the weird editing issues. Also, remembered to include the document icon in the Mac release, so your .d2c files should have their icon back. Sorry. (1.584).
Initial support for the while and for loops. Recoded text field for the control expression field. (1.582).
The Windows version has a few tweaks to get the if-then script object working on Windows 11. Not totally successful. Please update to the newer release. (1.581)
This update adds the first control element: the if-then block. You can now add an if-then block to your stack and insert script objects inside it. In addition, enhancements have been made to the warning system that displays messages when you leave script objects with dependencies or orphaned functions. This is a signficant revision and you should keep your prior installer in case you need to revert. (1.580)
Small update to the file save method to warn if it is unable to save the design file; fix to the insertion point of a "convert to snippet" script object (it should now show up directly below the converted object, instead of at the end of the stack). (1.577)
Fix for the really obnoxious error when closing a file that hadn't been saved; various small fixes. (1.576)
Various minor fixes; attempt to fix issue with dirty file indication immediately after file save on Windows. (1.575) <— still an issue :(
Fixes an issue loading older d2c designs. Hopefully fixed the issue of moving/reordering script objects inside function when the function body is open in the popped out editor window. Fixed an issue on the segmented control settings/detail panel. (1.573)
Fixes mainly related to new functions. New functions now come with an empty snippet and revised instructions (rather than suggesting that the body itself be edited). (1.572)
More fixes. Additional code to deal with loading older designs. Also, fix to the "show alert" script object so that it now allows you to edit the button labels. (1.569)
Small fixes to stack text and loading older designs. (1.566)
Update to fix the "set" button in the stack settings card. Also, fix for an issue causing a crash when loading a saved design. (1.565)
Update to allow you to set the starting number for creating new objects. For example, if you want to start your design out at Obj1000, you can set the starting number of 1000 in the stack settings panel. (1.564)
Fixes to allow older designs to load (specifically, game9.d2c). (1.563)
Updates to dependency-checking (to alert you when you try to delete something that is used by other script objects). Still a way to go on that. Also, a fix to a bug that wrecked display groups if they contained display object that were named. That's been there since 1.553. Yikes. (1.562)
More work on "set attribute" to get it working better. (1.561)
Updates to stack item text to make the stack more informative; hopefully fixed an issue where the wrong image was being displayed after being deleted. (1.559)
Updates to read older files better and more clearly report on load fixes. Hopefully, no more corrupt file saves. Width and height sliders should also be set correctly after design loads. (1.558)
Initial support for locking display objects on screen (i.e., by not allowing x, y, w, h to be modified) via check box. Locked items will show up in the stack with a '◘' symbol. (1.557)
Display object names should show up correctly after loading an existing design. Not sure when that broke or how I broke it so quickly! Also, the default polygon should now stay flipped when resized. That was annoying. More small enhancements to the stack data displayed. (1.555)
New feature: now you can "name" display objects to make it easier to make sense of them in your stack. Remember you can turn off the line numbers in the stack to make more room. (1.553)
That "set attribute" fix is fixed. I hope. (1.552) <— news flash! It wasn't
Fixed an issue with the "set attribute" action and object visibility. (1.551)
Fixed a code-generation glitch for new images. Ugh. (1.550)
Added the ability to resize polygons! In addition, you can use the "shift" key to lock the width and height (sliders) together. Also, provided a new setting to configure the stack (you can now turn the line numbers off if you are short on screen space or see them as clutter). As with every update, back up your old version and important d2c files. (1.549)
Fixes to the edit menu and a new function to get a boundary box for dragging shapes. (1.547)
More options added to the "Edit" menu. Added functions to round numbers and format number as percentages. Update to image button objects: Code will now run even if images are not selected. (1.546)
Added option to open folder that the design file is in (File…Show Design File in Project Folder). (1.544)
Added an "Edit" menu with options to copy the selected script object to the clipboard or convert it to a snippet. Use with caution — the convert feature hasn't been completely tested! (1.542)
Update to the Set Attribute script object (also added checkboxes to select attribute(s)). Option to delete configuration files on file settings card (config.lua and build.settings). Drawn2Code now remembers app size and position on screen. (1.539)
Fixed a bug which stalled the app (or locked it up) trying to constantly revalidate tool bar images. Added initial support for the Stepper widget. (1.538)
More information and fixes for loading older design files (still can't load cursed designs). (1.536)
Prior updates and improvements
Notes
- This is a Java desktop app (like the ScoreKeeper or Course Access app). As of Fall 2018, the app bundles a version of Java with it, so you don't have to download or install anything else. This makes the download bigger, but should end the compatibility issues.
- Loading older design files (.d2c files) into a newer version of the app may have unpredictable results (well, predictably bad, I guess). It is smart to hang on to an older version of the app as a backup.
- Loading newer design files in older versions of the app is also risky.
- Make backups of your d2c design regularly.
- Troubleshooting: This is really experimental and rapidly evolving software. Glitches will occur.
- Two general tips: (1) If the script stack seems off, try moving a script object up and down the stack; and (2) Try saving your design (the .d2c file), then quitting and reloading the design file in the app.
Troubleshooting
- Looks over the solutions for the CourseAccess app (here).
- Remember to use the password from the text book (or class) to save it from the zip/dmg and to launch it the first time.
- On the Mac, you'll probably get the message about the app being "damaged" (which it isn't). Follow the steps in the CourseAccess section or watch this youtube video: https://www.youtube.com/watch?v=6fqzb4qpgcs
Mac OS Catalina
- So, Catalina has added a new Gatekeeper check to keep you safe from potentially malicious software. To run an app that didn't come from the Mac App Store, the app has to be signed with a developer id (this isn't new) and also submitted for Apple to "notarize". As of Feb. 3rd (2020) these are requirements are being strictly enforced. While this is fine, the notarization process is really finicky. It has taken weeks to get it to work, but versions 1.544 (and beyond) are notarized and stapled per Apple guidelines.
- This doesn't affect the Windows version, so another workaround for Mac users would be to run the Windows version using VMWare or Parallels.
Prior Versions
- Version 1.577 [Mac DMG] [Windows ZIP]
- Version 1.538 [Mac DMG] [Windows ZIP]