The 0 indicates that nothing was painted, so the screen does not need to be updated by FireAlpaca. In this very simple script, function main does not do anything, but reports ( return) immediately back to FireAlpaca. Main, the cursor is at x, y, the pressure is at p, do something about it! Main, the cursor is now at new x, y, and the pressure is now new p, do something. The x, y, and p are the cursor location and pressure that FireAlpaca always passes along to main (100 times per second, remember). If FireAlpaca is the supervillain (what, you didn’t think the flames in the background and the snazzy bow tie meant anything?), main is its chief minion or functionary. What is happening? The function main is the official main part of the brush script.
That is also return zero, not return letter O. Every comma, every round bracket (official name: parenthesis, plural parentheses) is important. OK, it does not actually draw or do anything, but hopefully it loads without errors, if you did not make any typing mistakes. Write that inside a text file, save it as mybrush.bs, and load it into FireAlpaca (or…), then select the new brush in the brush list. Here is the most basic brush script you can write: Leaving out the technobable, you too can write brush scripts, and in this series of posts we will look at how. It is written in the Lua programming language with special added bits, called an API, that let it talk to FireAlpaca (or …). Meeting the chief minion: The littlest brush scriptĪ brush script is a small program that FireAlpaca (or MediBang Paint, or MangaLabo/ ComiLabo, or MDIapp) runs 100 times every second.