Render Anything Engine: tell your AI what to make. Videos, motion graphics, 3D and games as React and TypeScript, rendered on your own GPU. Rust + Bevy, macOS, Linux and Windows.
Example
"Deals **{blue:{damage_number}}** {red:fire} damage to the enemy."
Syntax
Style
{style:value}
This is equivalent to <style>value</style> in html.
The left hand side is the name of the style, it will be passed to the stylesheet function.
value will be trimmed of whitespace, so the correct syntax is to add whitespace outside of the braces:
Hello {style:World}! // Hello World!
Hello{style: World}! // HelloWorld!
Style commands also can be chained:
Deals {red, s-black, s-10: 10} damage!
Standard Styles
These will be parsed regardless of the stylesheet function:
redParses Css color names as fill color.#ff00ffParses hex color (accepts 3, 4, 6, 8 digits) as fill color.s-4Sets stroke to a number.s-redParses color names as stroke color.v-4.0Sets themagic_numberfield.f-RobotoSets the font to Roboto.$18Sets font size to18.*1.5Sets font size to1.5times the original.h1-h4Sets font size to2,1.75,1.5,1.25times the original.
Dynamic value
{ value }
Without : values in brackets are treated as dynamic values and passed to the fetch_string function.
The result should either be a string fetched from the world
or an Entity with a FetchedTextSegment component.
Conditions
{ ?condition : value }
{ ?!condition : value } // flips the condition
Displays value only when condition is true (or false with ?!).
The result should either be a boolean value fetched from the world
or an Entity with a FetchedCondition component.
Markdown
A subset of markdown features are supported:
*emphasis***strong**__underline__~~strikethrough~~\*escape character
Whitespace Rule
Consecutive whitespaces are rendered either as one whitespace or multiple linebreaks.
Inputs
- [
ParseValueFn]- [
Text3dSegment::String] should be returned for static values. - [
Text3dSegment::Extract] should be returned after spawning aFetchedTextfor dynamic values. - Since an index is provided, it is possible to return an empty segment and manually update it.
- [
- [
ParseStyleFn] Parses strings as [SegmentStyle]. - [
ParseConditionFn]- [
ConditionOutput::Constant] should be returned for static condition. - [
ConditionOutput::Dynamic] should be returned after spawning aFetchedConditionfor dynamic values.
- [
We trim whitespaces before passing arguments to these functions.