Text Glitcher - For text glitching using Tweens

Text-Glitcher

Text-Glitcher is a Roblox module which handles text glitching effects with symbols. Great use for horror type games or perhaps to give a cool effect to text.

Features

  • Uses TweenService for simple and multiple tweening options
  • Reverse option to have the effect in reverse
  • You can customize your array easily for the unknown symbols section
  • This module provides different glitching styles

ezgif-2-ab923b990e8b
3M75PUZhkU

With the utilisation of TweenService, I have brought to you this module which permits text tweens almost the same way you would do for normal tweening.

The idea to open source this module and add more features came to me just by having a chat with my girlfriend on open sourced scripts.

Usage

local TextGlitcher = require(THEMODULE)

local Glitcher = TextGlitcher.new('The end text should be this', HereIsTheTextLabel,{
  TweenInfo = TweenInfo.new(2, Enum.EasingStyle.Quart, Enum.EasingDirection.InOut),
  Reversed = true, SingleGlitch = false
})
Glitcher:GlitchText()

We initialize the Glitcher with the .new function and pass the end text as the first argument, and the 2nd one would be the GuiObject and the 3rd one is the options.

After that, we call the GlitchText method to start glitching the text.

The options table isn’t necessary although it’s good to add it for a neat and appealing animation. If nothing is provided, it will default (see table below).

API


TextGlitcher.new(EndString: string, TextObject: TextLabel | TextButton | TextBox, {Dictionary options})

Note: TextObject would be thee UI the text would be transmitted onto

Options

Option name Description Default value Type
Reversed Whether the style should play in reverse (Example: Linear; from last to first). false Boolean
SingleGlitch Should it only create one glitched text for the whole glitching? false Boolean
Suffix (If using the custom Suffix style) Text suffix Empty string String
MaintainEndTextAfterGlitch Maintain the current text when the animation finishes false Boolean
UpdateRate The rate at which the glitch effect is updated onto the label nil Number
TweenInfo Classic TweenInfo created with TweenInfo.new() nil TweenInfo
GlitchCharacters List of characters to grab for the glitch efffect {…} Table
UnglitchedEvent BindableEvent that gets fired when a character is changed nil BindableEvent

Glitcher:GlitchText(style: string?)

Starts the glitching with the options passed into TextGlitcher.new()
styles are listed at the bottom of the post.

Glitcher:IsCompleted(): boolean

If the glitching has been completed.

  • Returns a boolean.

Glitcher:GlitchOnce(customCharacters: {string}?)

Glitches the GUI’s text directly. You can call this multiple times.

Glitcher:Cancel()

Cancels and ends the glitching tween.

Glitcher:Pause()

Pauses the current tween until it’s been called again by Glitcher:Play() or until it has been cancelled.

Glitcher:Resume()

Resumes the paused tween.

Glitcher:GetState(): Enum.PlaybackState

Gets the PlaybackState of the playing tween on the glitcher.
See more here: PlaybackState | Documentation - Roblox Creator Hub

You can also grab the current tween with Glitcher.tween. This could be used to bind events such Glitcher.tween.Completed which is an event for TweenBase.


Current styles are:

  • Suffix: Where the text typewrites itself with an optional character at the end
    Pass in the Suffix index as string in the information when creating the glitcher.

  • IndexUpdate: The current index character will be the on which will ONLY have a weird character. Example: TEST (Index 2) → T*ST (depending on the randomized character selected)

Test place with samples

Text Glitcher - Test Place.rbxl (53.4 KB)


Github: GitHub - string-dot-byte/Text-Glitcher-Lua
Module: TextGlitcher - Roblox

61 Likes

Can you add the example video from the github here too, please?

4 Likes

what would you put in (themodule) sorry for my stupidity

1 Like

The path to your module.

Example;

local TextGlitcher = require(game.ReplicatedStorage.TextGlitcher)

Considering the module is directly placed in ReplicatedStorage

yea i figured it out im a pretty dumb person ngl

1 Like

Haha, that’s fine. I made the same mistake as you when I was just surfing other’s modules and did not understand what most of the stuff they put meant.

Update

Improvements

  • Added Int Value cleanup which the tweens were using to reference off the index.
  • Fixed Yielding not working

Implementations

  • Glitcher:Cancel
  • Glitcher:Pause
  • Glitcher:Resume
  • Glitcher:GetState
2 Likes

Update

Added Suffix typewriting method.

Sample: ezgif-2-ab923b990e8b

Glitcher:Glitch() now requires the glitch style. If none is passed then it will use the default Tweening method with weird characters.

Really late post, this modules really cool! However, one issue though, what does Glitcher:Hash() do exactly? It wasn’t clearly explained on what it does, thanks.

:heart: :heart: :heart:

Glitcher:Hash() gets the current glitcher and just hashes it.

Not sure how to explain, here

local TextGlitcher = require(THEMODULE)

local Glitcher = TextGlitcher.new('The end text should be this', HereIsTheTextLabel,{
  TweenInfo = TweenInfo.new(2, Enum.EasingStyle.Quart, Enum.EasingDirection.InOut),
  Reversed = true, SingleHash = false
})

Glitcher:Hash()

So we basically just hashed it. So the text would be random characters (see table with random characters) and each character would be a random of that table of characters.

So The end text should be this would be something like <~?()$%*-=,.*?"!.'+-/&!).&?. Notice how they both have the same character length, but the only difference is that one is completely “ungliched” (first one) and the other is “glitched”.

Hope that’s enough to answer the question. Didn’t know what to put as name so I just put straight up “Hash”.

Possible weird characters (editable in main module)
Possible = {
		'-','+','*','/','|','}','{','[',']','~','\\','"',
		':',';','?','.','>','<','=','+','-','_',')',
		'(','*','&','%','$','#','@','!'
	}
1 Like

You are a w e s o m e :slightly_smiling_face: Its really simple to use!

1 Like

Okay so the module is no longer in a folder, idke why I even did that :roll_eyes:

image

Just simply require the TextGlitcher module instead obviously.

cc: @fl_xed


Also added index update style and I’m open for contributions :slight_smile:

1 Like

how would I glitch the text of the same text label again after doing it one time already from the same script

You can call :GlitchText() again on it? Unless you think it would be a good idea to add a feature to loop for x amount of times?

(Edit: This should be done by LocalScript btw)

Absolute life saver! I know I’m a bit late haha, but you might want to add a sort of text unglitched event, which fires whenever a character has been unglitched, adding even more customizability

2 Likes

Thank you! I’m glad this resource has served useful to you.

I will certainly work out more features on this module soon considering it’s gaining more attention.

I have a few plans for this module, although I’m unsure when I’ll be able to put in time to implement them along with improving the code. I will certainly consider your suggestion and update you whenever I push a new change.

2 Likes

This module appeared for me in such good timing, I’m working on a project where I will need this.

Thanks!

2 Likes

I’ve updated the module.

Removed a few options and added a few more. Neatened up the code and fixed a small bug. Renamed the cringey Hash to Glitch.

Current options table

Option name Description Default value Type
Reversed Whether the style should play in reverse (Example: Linear; from last to first). false Boolean
SingleGlitch Should it only create one glitched text for the whole glitching? false Boolean
Suffix (If using the custom Suffix style) Text suffix Empty string String
MaintainEndTextAfterGlitch Maintain the current text when the animation finishes false Boolean
UpdateRate The rate at which the glitch effect is updated onto the label nil Number
TweenInfo Classic TweenInfo created with TweenInfo.new() nil TweenInfo
GlitchCharacters List of characters to grab for the glitch efffect {…} Table

@HeadBloxx I’m unsure if I’d like to add that option you suggested. I don’t think I’ll be doing it.


Thanks everyone for the support on this module :+1:

3 Likes

Hi,
Do you have an .rbxl file with some samples of it working?

Thanks

Yep, I do. I just updated the main post and attached this below.

Text Glitcher - Test Place.rbxl (53.4 KB)

1 Like