Code Monkey home page Code Monkey logo

Comments (6)

britzl avatar britzl commented on June 30, 2024 1

For the repeat tag I was thinking like this:

<repeat=10>&zwsp;</repeat>

from defold-richtext.

subsoap avatar subsoap commented on June 30, 2024

If a wait tag is added similar to this then an action tag should be added too <action=sound:ding/> then these actions can be listened to within timer.delay(), and acted upon when using the truncate feature in games like visual novels. The action:name can be totally arbitrary and up to the project to deal with as it appears.

from defold-richtext.

britzl avatar britzl commented on June 30, 2024

The wait tag is interesting but feels a bit too game specific. Maybe a "repeat" tag that will repeat the enclosed text one or more times?

Or maybe it should be possible to specify a callback function which will be invoked when an unknown tag is encountered while parsing the text. This would allow developers to handle game specific tags while parsing text.

The "action" tag is also quite interesting. The tag could trigger a callback function which would allow developers to react to these actions/events when encountered.

from defold-richtext.

subsoap avatar subsoap commented on June 30, 2024

Callback function methods would be cool as a way to define custom tag behavior / react to action tags. What I am doing in my project is using Broadcast to signal the data that is then used elsewhere. Playing sounds / animations / screen effects as certain text passes by.

<repeat=text:times/> ?

from defold-richtext.

subsoap avatar subsoap commented on June 30, 2024

Another example of how I'm using action tag, when this text is truncated a particlefx is positioned on the char and plays to give an effect to make that text more special.

"<action=particles:text_emitter>Make this pretty</action>"

from defold-richtext.

subsoap avatar subsoap commented on June 30, 2024

That would work well. Then any tags that overlap would also be applied and repeat on the repeated text?

from defold-richtext.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.