HyperText v2.0.2 | Easily add animations, effects & more to text with this rich text module

HyperText by @lopjoss

HyperText v2.0.2.rbxm (45.3 KB)

About


HyperText is an advanced rich text module which allows you to render text, which can be styled and manipulated using markup tags, in any GuiObject. It’s designed for customization and versatility, hence the big API for something this simple. Though I did try to make it as user friendly as possible. You can find it’s API in the module itself.

Any feedback is super appreciated :cowboy_hat_face:

Features


  • Altering text with markup tags:
    <size=40>Hi</size>, <color=red>apple</color>
  • A broad possibility for customization through attributes:
    <anim=wiggle dur=5 freq=10>, <img=1234567890 aspectratio=10 color=75,0,0>
  • Adding inline images
  • Adding effects to text, such as a shaking, shiny, foggy, or a rainbow effect, with more to come
  • Aligning the text horizontally (left, center, right) and vertically (top, center, bottom)
  • Adding fonts by asset ID
  • Adding a typewriter effect and typewriter sound effect
  • Amazing debugging support
  • Full control over the rendering process. Pausing, resuming, etc
  • Pre-rendering text (for more info check the module’s API)
    And quite some more…

Demonstration


(included in the module)

Basic Usage


Setting things up is pretty easy, first of all, you can optionally define the default markup and attributes you want any rendered text to have when there’s no external markup applied to it.

local HyperText = require(game.ReplicatedStorage.HyperText)

local markup = HyperText.newMarkup()
markup.anim = "wiggle"
markup.size = 100
markup.weight = Enum.FontWeight.Bold
markup.font = "rbxassetid://12187364648"
markup.shiny = true
markup.xalign = Enum.HorizontalAlignment.Center
markup.yalign = Enum.VerticalAlignment.Center

local attrs = HyperText.newAttributes()
attrs.anim.loop = true
attrs.anim.dur = 5

Now you can create a HyperText object by calling the constructor, you must give it the GuiObject in which you want to render any text and optionally the markup and attributes you defined earlier.

local container = script.Parent
local obj = HyperText.new(container, markup, attrs)

Once you’ve made the object, you can render any given text containing markup.

local text = "Today I crashed into a <fog=true color=75,0,0>garbage truck</fog>."
    .. "<br=1><wait=2><anim=wiggle freq=2 loop=true>The driver was not happy.</anim>"

obj:Render(text)

60 Likes

Dude. Thank you so much for making this! I’ve been in search for a rich text module that supported characters instead of just text, most of them were broken or had some very interesting bugs, but yours definetly saved the day! This is an AWESOME module and I hope to see more updates to this masterpiece!!

2 Likes

I’m glad, also I’m definitely planning on adding some more features to this, first thing on the list is the possibility to add attributes to tags

1 Like

Sounds good! I’ll be waiting and keeping an eye out for any updates that come in the near future :eyes:

man i can’t wait for the inline image feature.

(i did it to Text+)

I’ll include it in the next version

2 Likes

W module right there, nice job bro

1 Like

Hi! This module is extremely well done and saves a lot of development time, great work.

While testing it, I ran into a small usability issue that I wanted to share. I spent around 15+ minutes trying to understand why nothing was rendering, even though the setup was correct. The root cause turned out to be a ZIndex issue: the text was rendering, but behind other UI elements.

On my side, I made a small adjustment that resolves this by deriving the effective ZIndex from the container, ensuring the rendered text appears as expected.

If anyone runs into the same issue, I’m happy to share the updated version.

:round_pushpin: Changes in the updated version

  • RichText.newProperties() now includes a ZIndexOffset property.
    When not provided, it defaults to 1 (Roblox’s default ZIndex).
  • RichText.newProperties() now includes an EffectZIndexOffset property.
    When not provided, it also defaults to 1.

The file below does not include the original “DEMO” subfolder..
RichText.rbxm (24.0 KB)

2 Likes

This is AMAZING! I’m using this and thank you for the example!

1 Like

Thank you for addressing this issue! I’ll be sure to include this fix in the upcoming version with credits to you

2 Likes

Really good, tried using Text+, but the character spacing was always super off compared to the font I wanted to use, this module I guess you automatically do the spacing yourself and its identical to the original font.

Added Stroke and some other capabilities to it myself, but those things are really easy and I’m sure will be included in the next update

Love this! Is there any feature for the TextScaled property?

EDIT: I notice it scales per object, nevermind!

pushed out version 2.0.0; a ton has changed, plenty of new features, and lots of bug fixes. I STRONGLY recommend using this over the old version.

I added an update log in the module where it’s possible to see everything that has changed.

DId you change the API?
I don’t really like how it’s abbreviated and in camelcase
compared to roblox’s API where its PascalCase

do you mean .newMarkup() and .newAttributes()?
If so my intention was to make their types similar to the actual tags and values to avoid any confusion further on

as for the tags and values inside a render’s text the capitalization doesn’t matter, so emitimg, EmitImg, or EMITIMG would all work

though how would you change the abbreviation?

In your example:

local HyperText = require(game.ReplicatedStorage.HyperText)

local markup = HyperText.newMarkup()
markup.anim = "wiggle"
markup.size = 100
markup.weight = Enum.FontWeight.Bold
markup.font = "rbxassetid://12187364648"
markup.shiny = true
markup.xalign = Enum.HorizontalAlignment.Center
markup.yalign = Enum.VerticalAlignment.Center

local attrs = HyperText.newAttributes()
attrs.anim.loop = true
attrs.anim.dur = 5

this can get confusing in my opinion

local HyperText = require(game.ReplicatedStorage.HyperText)

local Markup = HyperText.newMarkup()
Markup.Animation = "wiggle"
markup.Size = 100
markup.Weight = Enum.FontWeight.Bold
markup.Font = "rbxassetid://12187364648"
markup.Shiny = true
markup.AlignmentX = Enum.HorizontalAlignment.Center
markup.AlignmentY = Enum.VerticalAlignment.Center

local Attributess = HyperText.newAttributes()
Attributess.Animation.Looped = true
Attributess.Animation.Duration = 5