[SOLVED] Why my text label clipping?

I’m making a game but my textlabel is clipping when i put into a string, for some reason it only does that when i put strings, but if i change to normal, it just be normal again!!!
so, can anyone help me?

Code:


local TweenService = game:GetService("TweenService") --gets tweenService
local tweenInstance = script.Parent --the gui you want to move/resize
local Event = game.ReplicatedStorage:WaitForChild("DialogueEvent")

local tweenInfo = TweenInfo.new(0.4,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0) -- creates the tweens info (if you want it to repeat, change the 0 to how many times it should repeat.)

local tween = TweenService:Create(tweenInstance, tweenInfo, {Position = UDim2.new(0.513, 0,0.783, 0)}) --creates the tween
local tween2 = TweenService:Create(tweenInstance, tweenInfo, {Position = UDim2.new(0.513, 0, 1, 0)}) --creates the tween
local tween3 = TweenService:Create(
	script.Parent.InitialPrompt, 
	TweenInfo.new(2, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut),
	{MaxVisibleGraphemes = string.len(script.Parent.InitialPrompt.Text)})

tweenInstance.Position = UDim2.new(0.513, 0, 1, 0)

Event.OnClientEvent:Connect(function(Message)
	script.Parent.Parent.Enabled = true
	tween:Play() --plays the tween
	script.Parent.InitialPrompt.MaxVisibleGraphemes = 0
	script.Parent.InitialPrompt.Text = Message
	task.wait(1)
	tween3:Play()
	tween3.Completed:Wait()
	task.wait(3)
	tween2:Play()
end)
		

Here’s the print of what’s going on:
e

9 Likes

Could you explain your issue again, normally? I don’t understand what you want to do, and what is happening.

7 Likes

bruh, what? bro, i’m trying to be the most normally possible. ok, ok, look:

It’s not supposed to be “m” it’s supposed to be “mim” But for some reason, it just clips and he removes the “im” and it turns to “m”, understand now?

5 Likes

Perhaps the textlabel is too small? Try printing the Message before setting the textlabel’s Text to it, see if the Message is even correct

4 Likes

ok, thanks for the tip, i’m gonna try late

3 Likes

hi, have you tried disabling the TextWrapped property?

4 Likes

nope, didn’t worked

chars, you know that, right?

1 Like

And, yeah, the message is correct, and i even enabled textscaled, but it still didn’t work

1 Like

what if you type the text in there manually when the game isn’t started, does it still cut the message off?

2 Likes

nope, only if i put it in the script for some reason. Weird, right?

2 Likes

But i need this for some dialogues, so i need to put a string, you know? I won’t use the same dialogue for all the npcs.

1 Like

What if you start the game, enable the gui manually in explorer and type in it?

2 Likes

Ok, later, i’m gonna try a canvas group and see if it works or not.

Edit: well, as i expected, it didn’t worked.

1 Like

What the f- Bro, for some reason, it works, it only does the clip thing when i’m typing in a string, what’s the SENSE???

1 Like

I need to sleep, tomorrow i talk to you. Bye!

1 Like

Change
script.Parent.InitialPrompt.MaxVisibleGraphemes = 0
to
script.Parent.InitialPrompt.MaxVisibleGraphemes = -1

Or just remove that line entirely, that’s what is causing it.

1 Like

well, your didn’t solved it, but i already solved it. i just changed a line of code of the function.

here’s the updated code:

--place this script INSIDE the gui instance you want to move/resize

local TweenService = game:GetService("TweenService") --gets tweenService
local tweenInstance = script.Parent --the gui you want to move/resize
local Event = game.ReplicatedStorage:WaitForChild("DialogueEvent")
local DB = false

local tweenInfo = TweenInfo.new(0.4,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0) -- creates the tweens info (if you want it to repeat, change the 0 to how many times it should repeat.)

local tween = TweenService:Create(tweenInstance, tweenInfo, {Position = UDim2.new(0.513, 0,0.783, 0)}) --creates the tween
local tween2 = TweenService:Create(tweenInstance, tweenInfo, {Position = UDim2.new(0.513, 0, 1, 0)}) --creates the tween

tweenInstance.Position = UDim2.new(0.513, 0, 1, 0)

Event.OnClientEvent:Connect(function(Message)
	if DB == false then
		local tween3 = TweenService:Create(
			script.Parent.InitialPrompt, 
			TweenInfo.new(2, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut),
			{MaxVisibleGraphemes = string.len(Message)})
		DB = true
		script.Parent.Parent.Enabled = true
		tween:Play() --plays the tween
		script.Parent.InitialPrompt.Text = Message
		print(Message)
		task.wait(1)
		tween3:Play()
		tween3.Completed:Wait()
		task.wait(3)
		tween2:Play()
		DB = false
	end
end)

--thanks for using My Tween Tool, leave a comment under this plugin if you have any questions or wanna report a bug. :)
		
1 Like

Glad you fixed it, but you just set it to the length of the Message, -1 would let it be any length. Both should have worked.

2 Likes

Actually, here’s the difference (it’s on the function):

New code:

Event.OnClientEvent:Connect(function(Message)
	if DB == false then
		local tween3 = TweenService:Create(
			script.Parent.InitialPrompt, 
			TweenInfo.new(2, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut),
			{MaxVisibleGraphemes = string.len(Message)})
		DB = true
		script.Parent.Parent.Enabled = true
		tween:Play() --plays the tween
		script.Parent.InitialPrompt.Text = Message
		print(Message)
		task.wait(1)
		tween3:Play()
		tween3.Completed:Wait()
		task.wait(3)
		tween2:Play()
		DB = false
	end
end)

Old code:

Event.OnClientEvent:Connect(function(Message)
	script.Parent.Parent.Enabled = true
	tween:Play() --plays the tween
	script.Parent.InitialPrompt.MaxVisibleGraphemes = 0
	script.Parent.InitialPrompt.Text = Message
	task.wait(1)
	tween3:Play()
	tween3.Completed:Wait()
	task.wait(3)
	tween2:Play()
end)

The difference it’s that i was sending the maxvisiblegraphemes to textlabel text, not to the message pass function

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.