UNPKG

@bitsy/hecks

Version:

a collection of re-usable scripts for bitsy game maker

46 lines (37 loc) • 1.65 kB
/** šŸ“ƒ @file paragraph-break @summary Adds paragraph breaks to the dialogue parser @license WTFPL (do WTF you want) @version 1.1.4 @requires Bitsy Version: 5.0, 5.1 @author Sean S. LeBlanc, David Mowatt @description Adds a (p) tag to the dialogue parser that forces the following text to start on a fresh dialogue screen, eliminating the need to spend hours testing line lengths or adding multiple line breaks that then have to be reviewed when you make edits or change the font size. Usage: (p) Example: I am a cat(p)and my dialogue contains multitudes HOW TO USE: 1. Copy-paste this script into a new script tag after the Bitsy source code. It should appear *before* any other mods that handle loading your game data so it executes *after* them (last-in first-out). NOTE: This uses parentheses "()" instead of curly braces "{}" around function calls because the Bitsy editor's fancy dialog window strips unrecognized curly-brace functions from dialog text. To keep from losing data, write these function calls with parentheses like the examples above. For full editor integration, you'd *probably* also need to paste this code at the end of the editor's `bitsy.js` file. Untested. */ 'use strict'; import { addDialogTag, } from "./helpers/kitsy-script-toolkit"; import "./helpers/addParagraphBreak"; //Adds the actual dialogue tag. No deferred version is required. addDialogTag('p', function(environment, parameters, onReturn){ environment.GetDialogBuffer().AddParagraphBreak(); onReturn(null); }); // End of (p) paragraph break mod