How to use in your own projects: - Delete the tech demo and all of the comments (optional). - Drag the "PWM Library" sprite to your backpack. - In the project that you want to use this library in, every time you want to make a new sprite that uses the library, drag the "PWM Library" sprite into your project. - Profit! Introduction: What if it was possible to draw with pen without moving the sprite that's drawing at all? By making scripts that allow you to draw pixels, lines, squares, and more, this functionality can be simulated. The only problem would happen with these custom blocks is that no matter what, the pen would be placed back up after they are done drawing something. However, I addressed this problem with two custom "pen down" and "pen up" blocks. The difference between these blocks and the normal pen down and up blocks is that it sets a variable that gives the current pen state. These custom pen down and up blocks could also be used for other purposes outside of their use with this library, in case you need to check the pen state in your project.
Update 4/16/2019: Started implementing a "fill" function for drawing boxes. It's not ready yet though. You might be asking, how does this even work? It's actually very simple. Before the scripts for each of these blocks are run, the location of your sprite is saved. After the scripts are run, your sprite goes back to the coordinates saved. Since the custom blocks run without the screen refreshing, the block will be run instantaneously, meaning that your sprite shouldn't be interrupted in anything it was doing before the script was run. If you want to see how the blocks available were made, press "See Inside" to look at the code. You might also be wondering why I made this. I originally made this as a concept for how drawing graphics similar to that of other programming languages could be accomplished, but then I further expanded on it so that it could also be used as an actual resource. Please let me know if there are any problems with this library, and feel free to use it in your own projects! Oh yeah, and I really, really hate anti-aliasing sometimes. Look how it makes the filled-in squares look, they're half transparent, and transparency isn't even enabled! There should be a way to disable it.