Today I continued to work on the save system. I found the ls() command (it was right there in the manual xD), but it only lists p8, p8.png, and p8l files. I noticed that when I write files with printh(), any extension other than .txt results in “.p8l” being added to the file name. So…
Category: Programming
PICO-8 Text Editor with Effects, #23
I’ve started working on the save system! I can write files with “printh” and I’m trying to find a way to avoid clobbering existing files. PICO-8 has “extcmd” to run commands from inside PICO-8, but it doesn’t include “ls”, which I could use to find existing files.I’m also thinking that I’ll need a system for…
PICO-8 Text Editor with Effects, #22
Today I spent more time refining the mouse controls. They’re still not finished, but now some new things work, like clicking outside the lines and on blank lines.
PICO-8 Text Editor with Effects, #21
Today I made selections functional! Now they behave more like other text editors: pressing any key with an active selection deletes the selected text.
PICO-8 Text Editor with Effects, #20
The menu buttons are working! Or, at least the toggle highlight button.
PICO-8 Text Editor with Effects, #19
Today I started adding menus! They don’t do anything yet, but they will soon.
PICO-8 Text Editor with Effects, #18
Today I started working on selections! I have start and end positions in the text which are set by the cursor. Then I draw all characters between those positions with a background color.The editor is really starting to feel complete. Although, I probably need to spend some time cleaning the code; right now it’s just…
PICO-8 Text Editor with Effects, #17
Today I worked on re-adding mouse control! When I was using a table for each line, I could loop through the lines to find the closest character to the mouse and I can still do something similar with the list of line breaks.
PICO-8 Text Editor with Effects, #16
Today I re-added particles! I ended up using the method of setting flags on new letters, but still doing deletion immediately. The code isn’t awful, but it isn’t very clean either. Also, now that I have the letter positions from the word wrap, the second loop can just draw the letters.
PICO-8 Text Editor with Effects, #15
I’m trying to figure out how to handle particle effects. The problem is that I don’t know where letters appear on screen until the word wrap stage and I need to create particle effects at the letters’ screen positions. So now I’m faced with an architecture question: which makes more sense, storing effects in the…
PICO-8 Text Editor with Effects, #14
Today I started reworking the text effects! Now the wave effect is based on screen position to keep the letters in sync. I also made the waves and colors shift at the same rate so they can loop. I haven’t synced the cursor yet, so it blinks at the end of the loop.I realized I…
PICO-8 Text Editor with Effects, #13
Today I added support for PICO-8’s Puny font. This is the great thing about the new word wrap system: it supports different character widths. I also started working on the system for moving the cursor up/down, and it’s almost working. Edit 7/26/2021: I was mistaken about puny font. The characters in the above image aren’t…
PICO-8 Text Editor with Effects, #12
Word wrap is finally working! :DDD I still need to define the behavior of words at the end of space-only lines, but the main use case is working perfectly. Here’s the new word wrap function: It loops through the text twice: once to find the line breaks and again to draw the characters. The first…
PICO-8 Text Editor with Effects, #11
So I’m continuing with the experimental rewrite. The method of doing word wrap at draw time is the way to go, if I can just get it working xD My system looks forward in the text to the maximum line length and then backwards to find the closest possible break. The problem is the alignment…
PICO-8 Text Editor with Effects, #10
Today I worked on, you guessed it, word wrap. It may be so difficult because of how I’m storing the text. Early on, when I had one table to store the text, word wrap was almost automatic. I switched to multiple tables so that I could more easily move the cursor, but the downsides have…
PICO-8 Text Editor with Effects, #9
Word wrap is almost working! I had no idea it was going to be so complicated. I added a field to each line to track whether it has a leading space and it’s working pretty well. The main thing which still isn’t working is separating different word wrapped lines. The editor doesn’t track lines in…
PICO-8 Text Editor with Effects, #8
Today I continued to work on the word wrap and I’ve encountered some bugs. To fix them, I need to define how the editor handles leading and trailing spaces. The problem has three parts: I use spaces as delimiters for the word wrap. I don’t want the editor to show the leading and trailing spaces…
PICO-8 Text Editor with Effects, #7
Today I worked on changing the word wrap to operate on words instead of letters. It was pretty easy to get it working for adding words, but I still need to finish support for deleting words.