Releases: JujuAdams/Scribble
8.0.1 Beta 1
7.2.0pre003
This is a beta version and should not be used in production.
Typewriter behaviour is now controlled using a "typist". A typist is a unique (non-cached) machine that controls how your text is revealed and how events are executed as text is revealed. For example, you should create one typist per textbox. Typists are created by calling scribble_typist()
and are garbage collected automatically. Typists can be used with a text element by targetting the typist with the text element's .draw()
method. For example:
typist = scribble_typist();
typist.in(1, 0);
///Draw
scribble("Here's some typewriter text!").draw(x, y, typist);
Note that we called the .in()
method. This is analogous to the old .typewriter_in()
method that was available on text elements in previous versions. Here's a list of methods for typists, and they follow the same basic rules as the old typewriter functions.
.reset()
.in(speed, smoothness)
.out(speed, smoothness, [backwards])
.skip()
.sound(soundArray, overlapMS, pitchMin, pitchMax)
.sound_per_char(soundArray, pitchMin, pitchMax)
.function_per_char(function)
.pause()
.unpause()
.ease(easeMethod, dX, dY, xScale, yScale, rotation, alphaDuration)
.associate(textElement) <-- You'll probably never need to use this
A typist should only be used to control text reveal for one text element at a time. Changing text element, or changing the page for that text element, will cause the typist to automatically be reset.
Typists are automatically associated with a text element when targetted using that text element's .draw()
method. If you want to manually associate a typist with a text element you'll need to use .associate()
method (on the typist).
Additionally, two methods have been added to text elements. .reveal()
sets how many characters are visible in the text element (including spaces), and .reveal_get()
returns that value. Using a typist will override any value set with .reveal()
. Revealling characters using .reveal()
will also not execute any events whatsoever - you'll need to use a typist for that.
Finally, in light of above, .typewriter*()
methods have been deprecated for text elements returned by scribble()
. You will get a warning when trying to use these functions. If you don't want to transition across to using the new typist system then set SCRIBBLE_WARNING_LEGACY_TYPEWRITER
to false
. Existing behaviour should be unaffected if you use legacy methods, but try to migrate your code if you can as the old featureset will be fully removed in the next major version (later this year probably).
7.1.2
Addresses:
#176 #194 - MSDF fonts should now work properly cross-platform
#192 - .msdf_border()
can now be proportional to the scale of the text if PROPORTIONAL_BORDER_SCALE
constant is set to true
in the fragment shader for __shd_scribble_msdf
#197 - Text no longer flips when characters get too large (including for Bezier curves)
#199 - MSDF fonts no longer perform pre-multiplied alpha blending. N.B. This is a breaking change - if you'd like to turn on pre-multiplied alpha, please set the PREMULTIPLY_ALPHA
to true
in __shd_scribble
and/or __shd_scribble_msdf
#202 - Added scribble_font_has_character()
Additionally:
- Speed tags now work properly when skipping text
- Adds optional
executeOnlyOnChange
argument to.template()
method - Fixes
obj_example_big_textbox
- Fixes typos causing failure to compile on YYC
- Updates project to GMS2.3.2 (stable)
- Fixes a crash in an edge case when calling
.flush()
- Removes forced period call to
gc_collect()
7.1.1
Amongst other changes, this version deprecates SCRIBBLE_SKIP_SPEED_THRESHOLD
. Please use .typewriter_skip()
to skip text.
The following issues have been addressed:
#183 - Fixed strange animation behaviour by finding a workaround for limited floating point accuracy on certain graphics chipsets
#185 - .align()
can now use "pin_left"
"pin_center"
"pin_right"
in addition to the standard GameMaker alignment constants
#186 - .typewriter_skip()
now properly resets skip behaviour when changing page
Additonally:
- Substantial improvement to performance, doubling performance in most situations
- Fixes crash when trying to draw a null model
- Fixes line wrapping when multiple vertex buffers have been generated
7.1.0
One contribution by Faulty:
- Adds
.get_page_width()
and.get_page_height()
methods
The following issues have been addressed:
#171 - Fix for weird offset issues when certain fonts natural wrap to a new line
#177 - .draw()
, .build()
, and .flush()
now return undefined
. This is a breaking change to prevent misuse of these methods.
#178 - Datestamp no longer says 2020 🙂
#179 - Fixes various MSDF issues based on experience with a commercial project. y-alignment of MSDF fonts has been altered slightly and you may need to reposition text.
#180 - Fonts can now be added on boot rather than requiring the game to enter to first room
Additonally:
- Adds
SCRIBBLE_WARNING_REDEFINITION
macro to turn off exceptions when re-adding an already added font - Fixes crash when getting the bounding box of a null text element
- Adds
scribble_font_scale()
.typewriter_sound_per_char()
will no longer play a sound one extra time when a string finishes being typed out.typewriter_in()
will now respect state set by.typewriter_skip()
7.0.3
The following issues have been addressed:
#174 - .get_typewriter_pos()
now has proper documentation
#175 - Added .typewriter_skip()
as an alternative to setting the typewriter speed very high
Additonally:
- The documentation in the package has been cleaned up so it's easier to read.
.align()
now affects vertical alignment properly- Scribble will now throw an error when text is drawn but no fonts have been added
- Fixes a left-hand side spacing issue when text wraps around to a new line
- Fixes a crash when getting the bounding box of an empty string
Scribble 7
Welcome to Scribble 7!
Developing Scribble 7 has been a long road, and I'm proud to finally put it out as a stable library for use in projects big and small, for hobbyists and for gamedev professionals.
This version introduces many new features:
- A struct-based object-orientated API that makes Scribble easier to understand and use
- Custom typewriter animations
- MSDF fonts for resolution-independent UI
- Animation synchronisation across text elements
Scribble 7 is a total rethink of the API that you use to interact with the core technology that drives Scribble and, as a result, the documentation has been revamped to reflect Scribble's new API and featureset. I hope it's easier to navigate and understand.
Due to the scope of the changes, upgrading from v6 to v7 will require a substantial refactor of any existing Scribble code. The behaviour of standard fonts and spritefonts should not have changed so your resources themselves will not need to be adjusted.
Please note that Scribble 7 requires the use of GameMaker Studio 2.3.1.
Thanks again and have fun!
Odds And Ends
This release adds a handful of small feature requests to flesh out Scribble's capabilities.
Issues addressed:
#120 - Added scribble_set_ignore_command_tags()
so you can turn command tag parsing on and off whenever you want
#125 - Audio playback using the autotyper no longer requires the use of a custom function. Simply drop [<audio asset name>]
into a string and Scribble will play that audio asset when the autotyper reaches that point in the string
#128 - In-line surfaces are now supported. Use [surface,<surface ID>]
to draw a surface in-line like you would with a sprite (this'll probably take the form of "[surface," + string(surface_id) + "]"
since surface IDs are volatile)
#129 - Added scribble_set_fog()
to replicate the classic flashing text trick using gpu_set_fog()
(or d3d_set_fog()
if you're ancient like me)
#130 - scribble_get_bbox()
now returns the correct bounding box when using in-line vertical alignment tags
#132 - Some fonts behave weirdly due to how GM parses the source font file. There's not a lot I can do to fix this automatically, but scribble_set_glyph_property()
now supports all
as a keyword (instead of the character) to adjust a glyph property across all glyphs in a font
#140 - Fixes failure to compile shaders on MacOS
Additionally:
- Scribble deltatimes text by default now
- Pagination is more reliable with line widths and fixed line heights behaving appropriately
SCRIBBLE_NEWLINES_TRIM_LEFT_SPACE
has been added to allow you to control how newlines behave. Normally this should be set totrue
but for certain games that use monospaced spritefonts you'll want to set this tofalse
Bézier Curves
This release adds Bézier curve transforms for your text!
scribble_set_bezier()
defines a cubic Bézier curve to shape text to. The four x/y coordinate pairs provide a smooth curve that Scribble uses as a guide to position and rotate glyphs.
The curve is positioned relative to the coordinate specified when calling scribble_draw()
so that the first Bézier coordinate is at the draw coordinate. This enables you to move a curve without re-adjusting the values set in scribble_set_bezier()
(which would regenerate the text element, likely causing performance problems).
If used in conjunction with scribble_set_wrap()
, the total length of the curve is used to wrap text horizontally and overrides the value specified in scribble_set_wrap()
. scribble_set_bezier()
will not work with [fa_right]
or [fa_center]
alignment. Instead, you should use [pin_right]
and [pin_center]
.
Issues addressed:
#115 - [delay]
and [pause]
now stop the text in the correct place for all autotype speed values
#121 - [rainbow]
now respects SCRIBBLE_COLORIZE_SPRITES
when colouring sprites
#123 - Fixed horizontal alignment
How do I import Scribble into my game?
GameMaker Studio 2.3.0 allows you to import assets (including scripts and shaders) directly into your project via the "Local Package" system. From the resources below, download the .yymp file. In the GameMaker IDE, load up your project and click on "Tools" on the main window toolbar. Select "Import Local Package" from the drop-down menu then import all scripts and shaders from the Scribble package. Now you're all set up to use Scribble!
More Bug Fixes!
This is a smaller release to fix some minor issues. Please read the patch notes for the prior release for more information.
Issues addressed:
#116 - Functions can now be used for scribble_add_autotype_event()
and scribble_autotype_function()
#117 - scribble_add_font()
will now show appropriate error messages when using an asset index rather than an asset name
Additionally:
[scaleStack]
is now available as a command tag, allow for scaling to be applied multiplicatively rather than resetting the scaling value- Fixed a crash in
scribble_bake_shader()