Title here
Summary here
The Story package contains methods to control the interactive environment through programmable components.
Methods that return the context of interactive environment.
StoryAsync
object representing the context.import story
ctx = story.get_context()
Simulate an asynchronous delay to synchronize operations.
time (float)
: Delay duration in seconds.import story
ctx = story.get_context()
await ctx.sleep_async(10)
Returns an internal Text object for creating and managing interactive text elements.
Text
object.import story
ctx = story.get_context()
text = ctx.text()
Initialize the Text component.
Text
object.import story
ctx = story.get_context()
text = ctx.text()
text = await text.init_async()
Write text in component.
markdown (float)
: The KaTeX-compatible Markdown code to be rendered in the component.Text
object.import story
ctx = story.get_context()
text = ctx.text()
text = await text.init_async()
text = text.write("""
# Example
The example formula is as follows:
$$
E = mc^2
$$
You can also use mixed text with inline math, for example: "Einstein's famous equation $E = mc^2$ describes the relationship between energy and mass."
""")