Movatterモバイル変換


[0]ホーム

URL:


Contents

Fundamentals

Actions

Technical

Theory


Edit this page

< Overview

Scripting

Stipple Effect lets users write scripts for a wide range of potential uses and applications. Ascript is a short series of instructions for the program to execute.

DeltaScript

Stipple Effect scripts are written in ascripting language calledDeltaScript, which was also designed by the developer of the program.DeltaScript is described as alightweight scripting language skeleton. This means that theDeltaScript base language is easy to learn, with only essential functions in its standard library, and that it is intended to serve as a foundation and be extended upon.

The language was also designed to bepowerful,expressive, andconcise. The syntax is concise and devoid ofboilerplate, and has many shorthands to make scripts shorter without sacrificing readability. It should also be familiar to users with prior programming experience, as thesyntax is similar to otherC-family languages like C++, Java, JavaScript, and Go.

Do not be discouraged if you have little to no programming experience, or if you are hesitant about learning a new language. There are plenty of resources to familiarize yourself with scripting inStipple Effect, including:

API

DeltaScript is designed to be extended for the needs of the individual applications that utilize it. As the base language is quite bare, most of the powerful scripting functionality forStipple Effect is defined in thescripting API -Stipple Effect’s extension ofDeltaScript. You can read the API specificationhere.

Types of scripts

Scripts inStipple Effect scripts fall into the following categories:

Getting Started

Script files and text editor

Script files use the file extension.ses. They can be written in the text editor of your choosing. However,Visual Studio Code (VS Code) is recommended because of theDeltaScript for Stipple Effect syntax highlighting extension that is distributed on the VS Code Marketplace.

Script structure

Scripts consist of anameless header function, optionally followed bynamed helper functions. The type signature of the script is the type signature of its header function. Functions can optionally accept parameters and return a value of a specified return type,though neither are required.

Consider the following example script. Given a number of lettersn, the script spells a random “word” ofn letters. Ifn <= 0, the script returns the empty string. This script does not utilize any functions or types from the scripting API; it is written exclusively in theDeltaScript base language.

// header function - this is the entry point of the script's execution// * has a single parameter "n"// * returns a string(intn->string){stringword="";for(inti=0;i<n;i++)word+=random_letter();returnword;}// helper function "random_letter()"// * has no parameters// * returns a charrandom_letter(->char){~intMIN=(int)'a';~intMAX_EX=((int)'z')+1;// "rand" is a function defined by the DeltaScript standard libraryreturn(char)rand(MIN,MAX_EX);}

A full breakdown of the syntax and semantics ofDeltaScript can be found in thelanguage specification.


SEE ALSO


[8]ページ先頭

©2009-2025 Movatter.jp