Examples
The library contains 5 examples of increasing complexity that show most of what the library has to offer.
It's recommended that you read through the Getting Started page before exploring the examples. This will walk you through installing the library, show you a trivial example, and explain a bit more about how the library works.
Access the examples
The examples can either be accessed via the Processing IDE or viewed on the GitHub page
Note
I haven't included the example code here simply because I want to minimise the places I have to maintain them. What IS included in this page is a high-level explanation of what each example contains. The comments in the example should be sufficient to explain what's going on. If you have any questions, please just reach out!
To access via the Processing IDE:
1. Navigate to File
> click on Examples...
to open the Java Examples
window.
2. Expand the Contributed Libraries
category
3. Expand the SpicyText
sub-category
4. Double-click the desired example to open it in the Processing IDE
Example 1: Hello World
Goes over the basic usage of the library:
- Tag basics
- Simple text wrapping
- Displaying Spicy Text with alignment
Example 2: Dynamic Text
Covers some slightly more advanced usage
- Using
setText
to update text - Using
setText
to update the text wrapping width - Using
width()
andheight()
to get the bounding box of the SpicyText
Example 3: Custom Theme
Covers the basics of creating and using a custom theme.
Check out Using Custom Themes for more detailed information.
Example 4: Custom Effects
Covers the basics of creating and using custom effects.
Check out Creating Custom Effects for more detailed information.
Example 5: Graphics Target
Shows how to draw SpicyText to a different PGraphics
object.