Welcome to the Forums!
Join thousands of other Roblox members with a free account.
Create Forum Account

how do i change the text box size in a script?

  • This website was created by Roblox members to replace the official forums (because Roblox shut them down) Join us if you like Roblox!
Status
Not open for further replies.

wolfGuardian

New Member
Reputation: 0 / 0 / 0
Feb 13, 2021
25
1
3
Roblox
neko_boi11
Instance.new("ScreenGui",game.StarterGui)



local textBOX = Instance.new("TextBox",game.StarterGui.ScreenGui)



textBOX.Visible = true



textBOX.Text = "timer"

(but how do i change the size of the text box? i tried change it like this: textBOX.Size = {blah,blah},{blah blah}, obviously i didnt put blah blah in the brackets, but you know what i mean, when i use the brackets it doesnt work? please help)
 

ElHomburgerGuy

If you won't let yourself fail, you won't improve
Reputation: 5 / 0 / 1
Apr 24, 2019
6,190
20
2,073
113
Anonymous in the USA
Roblox
PieroWasTaking
Discord
Piero#5261
Here's a small example of how TextBox.TextSize would work there's also more info here.

LocalScript:
Instance.new("ScreenGui",game.StarterGui)

local textBOX = Instance.new("TextBox",game.StarterGui.ScreenGui)

textBOX.Visible = true

textBOX.Text = "timer"

textBOX.TextSize = 5, 25, 5 --Just an example


Unless you're changing the box and not the text so instead you'll need to tween the box size.
LocalScriptTweening:
textBOX:TweenSize(Udim2.new(0, 20, 0, 20), "Out", "Back", 1)
 
  • Like
Reactions: wolfGuardian

wolfGuardian

New Member
Reputation: 0 / 0 / 0
Feb 13, 2021
25
1
3
Roblox
neko_boi11
Here's a small example of how TextBox.TextSize would work there's also more info here.

LocalScript:
Instance.new("ScreenGui",game.StarterGui)

local textBOX = Instance.new("TextBox",game.StarterGui.ScreenGui)

textBOX.Visible = true

textBOX.Text = "timer"

textBOX.TextSize = 5, 25, 5 --Just an example


Unless you're changing the box and not the text so instead you'll need to tween the box size.
LocalScriptTweening:
textBOX:TweenSize(Udim2.new(0, 20, 0, 20), "Out", "Back", 1)

hey this worked perfectly, but could you please explain this tweensize command? and is there an easier way to do change the text box size the way im doing it?
 

ElHomburgerGuy

If you won't let yourself fail, you won't improve
Reputation: 5 / 0 / 1
Apr 24, 2019
6,190
20
2,073
113
Anonymous in the USA
Roblox
PieroWasTaking
Discord
Piero#5261
Here's a small example of how TextBox.TextSize would work there's also more info here.

LocalScript:
Instance.new("ScreenGui",game.StarterGui)

local textBOX = Instance.new("TextBox",game.StarterGui.ScreenGui)

textBOX.Visible = true

textBOX.Text = "timer"

textBOX.TextSize = 5, 25, 5 --Just an example


Unless you're changing the box and not the text so instead you'll need to tween the box size.
LocalScriptTweening:
textBOX:TweenSize(Udim2.new(0, 20, 0, 20), "Out", "Back", 1)

hey this worked perfectly, but could you please explain this tweensize command? and is there an easier way to do change the text box size the way im doing it?
TweenService is basically giving the ability to move your GUI on a player’s screen. Not much else I can say at the moment but I do know a good video explaining TweenService pretty well.
 
  • Like
Reactions: wolfGuardian
Status
Not open for further replies.