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.
Author: Jacob
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.
PICO-8 Text Editor with Effects, #6
Today I worked on splitting the huge “handle_keypress” function into two separate functions: one to add/delete characters and another to format the lines. Now the “handle_keypress” function only handles adding/deleting characters and the “format_text” function will clean up after it. The editor feels a lot less like a pile of if-statements now! xDIt also finally…
PICO-8 Text Editor with Effects, #5
Today I rewrote almost the entire text editor to use tables for lines.I also switched to drawing the cursor as a rectangle instead of as a letter background color and it made the logic a lot easier. I haven’t added the character juggling or re-added mouse support yet, but I don’t think they’re going to…
PICO-8 Text Editor with Effects, #4
Today I worked more on the text editor and I’ve concluded that I need to change its text system again. The problem is the current system doesn’t have any concept of lines until the text is drawn. Let’s look at how this plays out in a common situation: the user presses the up arrow key…
PICO-8 Text Editor with Effects, #3
Today I made a bunch of changes to the text editor. I added a movable cursor, re-added particle effects, and changed the method of drawing text. Particle effects: I used the idea of saving each letter’s screen position at draw time and creating the particles afterward. Cursor: This was pretty straight forward; I just changed…
PICO-8 Text Editor with Effects, #2
I’m working on the text editor and I need to change my system of storing text to enable per-letter effects and a cursor. Right now, I’m storing the text as a table of strings, with each string storing one line of text. The problem is this system can’t do anything different per-letter because it stores…
PICO-8 Text Editor with Effects (Prototype)
Today I started making a text editor with effects! Inspired by Textreme 2 with ideas from Nerdy Teacher’s particles tutorial.It’s still missing a bunch of features, but the core idea is done.
Fish Demo in PICO-8
So what was going to be matrix rain turned into fish ¯\_(ツ)_/¯ Edit 4/30/2023 (almost 2 years later): Just repaired the ascii face. It was missing the “\”.