Note: This cartridge's settings do not allow embedded playback. A [Play at lexaloffle] link will be included instead.
This is Lemon A.D.E., which stands for Automated Dialogue Engine (ADE). With one call per frame, speech bubbles will appear where you want them on-screen.
When a new string is passed to the ade() function, it is rendered with one more character each frame.
Use
ADE's function looks like this:
ade(text,focal point x,focal point y,background color,text color,sound effect for new character)
The text field is the string to be displayed on screen, but can also accept a table as an argument and will display the text in the table in the order it's provided in. The key bind for advancing text in a table is the right d-pad button by default, but can easily be changed. For instance, if btn(➡️) is replaced with a variable equaling FALSE, you can then add your own external code to do things like listen for events in your game or a time delay. Just change the variable to TRUE and you're golden.
The focal point x and y fields are the x and y values of the focal point pixel. This is the pixel directly below the tip of the arrow at the bottom of the text box. The text box will be centered above this pixel.
The background color argument is optional. This is the color of the text box. It defaults to 0 (black). It also accepts a table as an argument. (This only works if the text type is a table as well.) If this is the case, then the value will be used that has the same index as the current item in the text table.
The text color argument is optional. This is the color of the dialogue text. It defaults to 7 (white). It also accepts a table as an argument. (This only works if the text type is a table as well.) If this is the case, then the value will be used that has the same index as the current item in the text table.
The sound effect for new character argument is optional. It is the sound effect that plays when a new character is rendered.
Known Issues
ADE doesn't support multiple text bubbles on-screen at once, and will always prioritize the most recently-called speech bubble.
It also cannot render multiple lines of text at once at the moment, but this may change in the future.
If the text is a string, there is no automated hiding. It is intended that dialogue is stored in tables.