Skip to content

Commit

Permalink
Fixes new docs being added to 9.0 lmao
Browse files Browse the repository at this point in the history
  • Loading branch information
JujuAdams committed Aug 13, 2024
1 parent 953f565 commit 26bf0c6
Show file tree
Hide file tree
Showing 14 changed files with 383 additions and 383 deletions.
24 changes: 0 additions & 24 deletions 9.0/animation-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,6 @@ Restores animation properties to the defaults set in [`__scribble_config_animati

 

## `scribble_anim_disabled(state)`

**Returns**: N/A (`undefined`)

|Name |Datatype|Purpose |
|-------|--------|-------------------------------------------|
|`state`|boolean |Whether to enable or disable text animation|

Disabling text animations is a common accessibility requirement and is useful for people who have diminished eyesight or find it disorientating to read rapidly moving text.

?> Disabling text animations will **not** disable typist animations.

 

## `scribble_anim_get_disabled()`

**Returns**: Boolean, whether text animations are disabled

|Name|Datatype|Purpose|
|----|--------|-------|
|None| | |

 

## `scribble_anim_wave(size, frequency, speed)`

**Returns**: The text element
Expand Down
4 changes: 0 additions & 4 deletions 9.0/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ This script holds a number of macros that customise the behaviour of Scribble. `
|`SCRIBBLE_USE_KERNING` |`true` |Whether to adjust the horizontal distance between glyphs depending on special per-font rules. Set to `false` for legacy pre-8.2 behaviour |
|`SCRIBBLE_SPRITE_BILINEAR_FILTERING` |`undefined` |Bilinear filtering state to force for inline sprite (and surfaces too). Set to `undefined` to use the current global bilinear filtering state |
|`SCRIBBLE_DELAY_LAST_CHARACTER` |`false` |Whether the last character in a string should trigger a per-character delay |
|`SCRIBBLE_USE_ASCENDER_OFFSET` |`true` |Whether to use ascender offsets when calculating glyph y-offsets. Set this macro to `false` for compatibility with legacy codebases |
|`SCRIBBLE_USE_FONT_ALIGNMENT_OFFSETS` |`true` |Whether to allow use of `scribble_font_set_*align_offset()`. Set this macro to `false` for a slight performance improvement |
|`SCRIBBLE_USE_SPRITE_WHITELIST` |`false` |Whether to require explicit whitelisting of sprites (via `scribble_whitelist_sprite()`) |
|`SCRIBBLE_USE_SOUND_WHITELIST` |`false` |Whether to require explicit whitelisting of sounds (via `scribble_whitelist_sound()`) |
|**Advanced Features** | | |
|`SCRIBBLE_TICK_SIZE` |`1` |Animation tick size per step. The default value for this macro (`delta_time / 16666`) ensures that animations are smooth and consistent at all framerates |
|`SCRIBBLE_DEFAULT_UNIQUE_ID` |`"default"` |Default value to use for text element unique IDs. This is used when no unique ID is specified |
Expand Down
125 changes: 57 additions & 68 deletions 9.0/fonts.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,56 +86,6 @@ Scales every glyph in a font (including the space character) by the given factor

 

## `scribble_font_set_halign_offset(fontName, hAlign, offset)`

**Returns:** N/A (`undefined`)

|Name |Datatype|Purpose |
|----------|--------|-----------------------------------------|
|`fontName`|string |Name of the font to modify, as a string |
|`hAlign` |constant|Horizontal alignment to target, see below|
|`offset` |number |x-axis offset to apply |

This function sets up a fixed offset for a font when used with a particular alignment. Valid constants for the `hAlign` argument are:

- `fa_left`
- `fa_center`
- `fa_right`
- `fa_justify`
- `"pin_left"`
- `"pin_centre"`
- `"pin_center"`
- `"pin_right"`
- `"fa_justify"`

?> The macro `SCRIBBLE_USE_FONT_ALIGNMENT_OFFSETS` must be set to `true` to use this function. This will incur a slight performance penalty when building text elements.

?> Existing text elements that use the targetted font will not be immediately updated - you will need to refresh those text elements.

 

## `scribble_font_set_valign_offset(fontName, vAlign, offset)`

**Returns:** N/A (`undefined`)

|Name |Datatype|Purpose |
|----------|--------|---------------------------------------|
|`fontName`|string |Name of the font to modify, as a string|
|`vAlign` |constant|Vertical alignment to target, see below|
|`offset` |number |x-axis offset to apply |

This function sets up a fixed offset for a font when used with a particular alignment. Valid constants for the `vAlign` argument are:

- `fa_top`
- `fa_middle`
- `fa_bottom`

?> The macro `SCRIBBLE_USE_FONT_ALIGNMENT_OFFSETS` must be set to `true` to use this function. This will incur a slight performance penalty when building text elements.

?> Existing text elements that use the targetted font will not be immediately updated - you will need to refresh those text elements.

 

## `scribble_glyph_set(fontName, character, property, value, [relative])`

**Returns:** N/A (`undefined`)
Expand Down Expand Up @@ -213,35 +163,74 @@ If there is no kerning offset defined for the given pair of characters (either s

 

## `scribble_font_bake_outline_and_shadow(sourceFontName, newFontName, shadowX, shadowY, outlineMode, separation, smooth, [textureSize=2048])`
## `scribble_font_bake_outline_4dir(sourceFontName, newFontName, color, smooth)`

**Returns:** N/A (`undefined`)

|Name |Datatype|Purpose |
|----------------|--------|---------------------------------------------------------------------------------------------------------------|
|`sourceFontName`|string |Name of the source font, as a string |
|`newFontName` |string |Name of the new font to create, as a string |
|`outlineColor` |integer |Colour of the outline |
|`smooth` |boolean |Whether or not to interpolate the outline. Set to `false` for pixel fonts, set to `true` for anti-aliased fonts|
|`[surfaceSize]` |integer |Size of the surface to use. Defaults to 2048x2048 |

`scribble_bake_outline_4dir()` creates a new font using a source font. The new font will include a one-pixel thick border in the 4 cardinal directions around each input glyph.

 

## `scribble_font_bake_outline_8dir(sourceFontName, newFontName, color, smooth)`

**Returns:** N/A (`undefined`)

|Name |Datatype|Purpose |
|----------------|--------|---------------------------------------------------------------------------------------------------------------|
|`sourceFontName`|string |Name of the source font, as a string |
|`newFontName` |string |Name of the new font to create, as a string |
|`outlineColor` |integer |Colour of the outline |
|`smooth` |boolean |Whether or not to interpolate the outline. Set to `false` for pixel fonts, set to `true` for anti-aliased fonts|
|`[surfaceSize]` |integer |Size of the surface to use. Defaults to 2048x2048 |

`scribble_bake_outline_8dir()` creates a new font using a source font. The new font will include a 1-pixel thick border in the 8 compass directions around each input glyph. For a thicker variation on this shader, try `scribble_font_bake_outline_8dir_2px()`.

 

## `scribble_font_bake_outline_8dir_2px(sourceFontName, newFontName, color, smooth)`

**Returns:** N/A (`undefined`)

|Name |Datatype|Purpose |
|----------------|--------|---------------------------------------------------------------------------------------------------------------|
|`sourceFontName`|string |Name of the source font, as a string |
|`newFontName` |string |Name of the new font to create, as a string |
|`outlineColor` |integer |Colour of the outline |
|`smooth` |boolean |Whether or not to interpolate the outline. Set to `false` for pixel fonts, set to `true` for anti-aliased fonts|
|`[surfaceSize]` |integer |Size of the surface to use. Defaults to 2048x2048 |

`scribble_bake_outline_8dir()` creates a new font using a source font. The new font will include a 2-pixel thick border in the 8 compass directions around each input glyph. This is useful for more cartoony text, especially high resolution anti-aliased text.

 

## `scribble_font_bake_shadow(sourceFontName, newFontName, dX, dY, shadowColor, shadowAlpha, separation, smooth)`

**Returns:** N/A (`undefined`)

|Name |Datatype|Purpose |
|----------------|--------|--------------------------------------------------------------------------------------------------------------|
|`sourceFontName`|string |Name of the source font, as a string |
|`newFontName` |string |Name of the new font to create, as a string |
|`shadowX` |number |x-axis displacement for the shadow |
|`shadowY` |number |y-axis displacement for the shadow |
|`outlineMode` |integer |Type of outline to create, a member of the `SCRIBBLE_OUTLINE` enum |
|`separation` |integer |Change in every glyph's `SCRIBBLE_GLYPH.SEPARATION` value |
|`dX` |number |x-axis displacement for the shadow |
|`dY` |number |y-axis displacement for the shadow |
|`shadowColor` |integer |Colour of the shadow |
|`shadowAlpha` |number |Alpha of the shadow from `0.0` to `1.0` |
|`separation` |integer |Change in every glyph's [`SCRIBBLE_GLYPH.SEPARATION`](scribble_set_glyph_property) value |
|`smooth` |boolean |Whether or not to interpolate the shadow. Set to `false` for pixel fonts, set to `true` for anti-aliased fonts|
|`[textureSize]` |integer |Size of the texture to use. Defaults to 2048x2048 |

`scribble_font_bake_outline_and_shadow()` creates a new font using a source font. The new font will include a drop shadow with the given displacement and will include an outline based on one of the following modes:

|Mode | |
|------------------|----------------------------------------------------|
|`.NO_OUTLINE` |No outline is added |
|`.FOUR_DIR` |One-pixel thick outline in the 4 cardinal directions|
|`.EIGHT_DIR` |One-pixel thick outline in the 8 compass directions |
|`.EIGHT_DIR_THICK`|Two-pixel thick outline in the 8 compass directions |

You can change the colour of the outline by using the `.outline()` text element method. You can change the colour and alpha of the shadow by using the `.shadow()` text element method.
`scribble_font_bake_shadow()` creates a new font using a source font. The new font will include a drop shadow with the given displacement, and using the given colour and alpha.

 

## `scribble_font_bake_shader(sourceFontName, newFontName, shader, leftPad, topPad, rightPad, bottomPad, separationDelta, smooth, [textureSize=2048])`
## `scribble_font_bake_shader(sourceFontName, newFontName, shader, leftPad, topPad, rightPad, bottomPad, separationDelta, smooth, [surfaceSize])`

**Returns:** N/A (`undefined`)

Expand All @@ -257,7 +246,7 @@ You can change the colour of the outline by using the `.outline()` text element
|`bottomPad` |integer |Bottom padding |
|`separationDelta`|integer |Change in every glyph's [`SCRIBBLE_GLYPH.SEPARATION`](scribble_set_glyph_property) value. For a shader that adds a border of 2px around the entire glyph, this value should be 4px|
|`smooth` |boolean |Whether or not to interpolate the output texture. Set to `false` for pixel fonts, set to `true` for anti-aliased fonts|
|`[textureSize]` |integer |Size of the texture to use. Defaults to 2048x2048 |
|`[surfaceSize]` |integer |Size of the surface to use. Defaults to 2048x2048 |

`scribble_bake_shader()` creates a new font using a source font. The source font is rendered to a surface, then passed through the given shader using whatever uniforms that have been set for that shader.

Expand Down
116 changes: 33 additions & 83 deletions 9.0/misc-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,89 +102,6 @@ The final string that Scribble will draw is equivalent to `"You find [spr_coin][
 
## `scribble_default_preprocessor_set(function)`
**Returns:** N/A (`undefined`)
|Name |Datatype|Purpose |
|----------|--------|-----------------------------------------------|
|`function`|function|Function to execute as the default preprocessor|
Please see `.preprocessor()` in the Scribble text element method documentation.
 
## `scribble_default_preprocessor_get()`
**Returns:** Function, the default processor set by `scribble_default_preprocessor_set()`
|Name|Datatype|Purpose|
|----|--------|-------|
|None| | |
 
## `scribble_whitelist_sound(sound)`
**Returns:** N/A (`undefined`)
|Name |Datatype |Purpose |
|-------|------------------------------------------------------------------|-------------------|
|`sound`|[sound](https://manual.yoyogames.com/The_Asset_Editors/Sounds.htm)|The sound to target|
Adds a sound to the global whitelist, permitting it to be played by Scribble.
?> You must also set `SCRIBBLE_USE_SOUND_WHITELIST` to `true` to use this function (otherwise all sounds are whitelisted by default).
 
## `scribble_whitelist_sprite(sprite)`
**Returns:** N/A (`undefined`)
|Name |Datatype |Purpose |
|--------|--------------------------------------------------------------------|--------------------|
|`sprite`|[sprite](https://manual.yoyogames.com/The_Asset_Editors/Sprites.htm)|The sprite to target|
Adds a sprite to the global whitelist, permitting it to be displayed by Scribble.
?> You must also set `SCRIBBLE_USE_SPRITE_WHITELIST` to `true` to use this function (otherwise all sprite are whitelisted by default).
 
## `scribble_external_sound_add(soundID, alias)`
**Returns:** N/A (`undefined`)
|Name |Datatype |Purpose |
|---------|------------------------------------------------------------------|--------------------------------------------------------------|
|`soundID`|[sound](https://manual.yoyogames.com/The_Asset_Editors/Sounds.htm)|The sound to target |
|`alias` |string |A string to use to refer to the sound ID in Scribble functions|
Adds a sound that can be referenced in Scribble functions using the given alias. This is intended for use with externally added sounds via `audio_create_stream()` or `audio_create_buffer_sound()`.
 
## `scribble_external_sound_remove(alias)`
**Returns:** N/A (`undefined`)
|Name |Datatype|Purpose |
|---------|--------|------------------------------------------------|
|`alias` |string |The external sound alias to remove from Scribble|
 
## `scribble_external_sound_exists(alias)`
**Returns:** Boolean, whether the alias has been added by `scribble_external_sound_add()`
|Name |Datatype|Purpose |
|---------|--------|-------------------------------------|
|`alias` |string |The external sound alias to check for|
 
## `scribble_markdown_format(string)`
**Returns:** String, the modified string containing Scribble formatting tags
Expand Down Expand Up @@ -310,6 +227,39 @@ The following struct is what Scribble uses by default. Note that no font is spec

 

## `scribble_external_sound_add(soundID, alias)`

**Returns:** N/A (`undefined`)

|Name |Datatype |Purpose |
|---------|------------------------------------------------------------------|--------------------------------------------------------------|
|`soundID`|[sound](https://manual.yoyogames.com/The_Asset_Editors/Sounds.htm)|The sound to target |
|`alias` |string |A string to use to refer to the sound ID in Scribble functions|

Adds a sound that can be referenced in Scribble functions using the given alias. This is intended for use with externally added sounds via `audio_create_stream()` or `audio_create_buffer_sound()`.

 

## `scribble_external_sound_remove(alias)`

**Returns:** N/A (`undefined`)

|Name |Datatype|Purpose |
|---------|--------|------------------------------------------------|
|`alias` |string |The external sound alias to remove from Scribble|

 

## `scribble_external_sound_exists(alias)`

**Returns:** Boolean, whether the alias has been added by `scribble_external_sound_add()`

|Name |Datatype|Purpose |
|---------|--------|-------------------------------------|
|`alias` |string |The external sound alias to check for|

 

## `scribble_flush_everything()`

**Returns:** N/A (`undefined`)
Expand Down
Loading

0 comments on commit 26bf0c6

Please sign in to comment.