This index lists the functions built into Sugar. Some give a value back to your code. Others add something to the JOI result or change an Item. Follow a category link for exact arguments, restrictions, and examples.
You can also create your own functions to reuse code in an Item, Boop, or App.
Strings and values
format() · upper() · lower() · pluralize() · ordinal() · contains() · join() · concat() · showIf() · empty() · exists()
Math
abs() · ceil() · floor() · round() · sqrt() · log() · log2() · log10() · min() · max() · clamp()
Randomness, IDs, and time
Rand::pick() · Rand::weighted() · Rand::chance() · Rand::roll() · Id::new() · Id::short() · Date · Duration · timeOfDay()
Collections
len() · list.len() · list.push() · list.pop() · list.insert() · list.remove() · list.clear() · list.contains() · list.first() · list.last() · list.filter() · list.find() · list.map() · list.any() · list.all() · list.take()
Participants and identity
gender() · genitals() · sexuality() · anySexuality() · genderIdentity() · anyGenderIdentity() · woman() · man() · nonbinary() · pussy() · cock() · straight() · gay() · lesbian() · bi() · trans() · Pronoun::fromGender() · Pronoun::of() · Pronoun.agree() · they() · them() · their() · theirs() · themselves() · count() · any()
Output and media
show media · mediaExists() · show variables · show chip · show embed · show button · show select · show toast
Sessions
Session::start(session) · Session::start(session, invitees) · Session::end()
Memory and Items
reset() · HOST · Item::setImage() · Item::setQuality() · Item::mutate() · Item::use()
Lore
Lore::get() · Lore::charge() · Lore::transfer() · Lore::earn()
NOTE
reset() requires the variable itself. Write reset(charges), not reset("charges").