Text+
DevForum Topic
  • Welcome
  • Installation
  • Fundamentals
    • Introduction
    • Line breaks
    • Customization
      • Fonts
      • Scale-size
      • Truncation
    • Modification
    • Text bounds
  • Fine-control
    • Introduction
    • Full iteration
  • Specific indexing and iteration
  • Transform and style
  • Custom fonts
    • Introduction
    • Font to XML
    • XML to Lua
    • Upload font image
    • Import to Text+
Powered by GitBook
On this page
  • Visualizing & calculating size
  • ScreenGui
  • SurfaceGui
  1. Fundamentals
  2. Customization

Scale-size

There are three scale-size options, which are inputted in the customization:

  • "X"

  • "Y"

  • "XY"

Enabling scale-size will take Size as a percentage of the screen size instead of a pixel amount. It will use the specified axis — for XY it will get the in-between of the two axis sizes.

Visualizing & calculating size

You can easily find the Size that maintains the ratio you are seeing in studio using the code snippets I've made for you.

Run the code for your GUI root in the command bar:

ScreenGui

local scaleSize = "X" local textLabelSize = 14										local viewportSize = workspace.CurrentCamera.ViewportSize if scaleSize == "XY" then viewportSize = (viewportSize.X + viewportSize.Y)/2 else viewportSize = viewportSize[scaleSize] end warn(math.round(textLabelSize/viewportSize*100*1000)/1000)

SurfaceGui

Make sure to select your SurfaceGui before running.

local scaleSize = "X" local textLabelSize = 14										local surfaceGui = game.Selection:Get()[1] local adornee = surfaceGui.Adornee if not adornee then adornee = surfaceGui.Parent end local viewportSize = nil local face = surfaceGui.Face local pixelsPerStud = surfaceGui.PixelsPerStud local partSize = adornee.Size if face == Enum.NormalId.Front or face == Enum.NormalId.Back then viewportSize = Vector2.new(partSize.X*pixelsPerStud, partSize.Y*pixelsPerStud) elseif face == Enum.NormalId.Left or face == Enum.NormalId.Right then viewportSize = Vector2.new(partSize.Z*pixelsPerStud, partSize.Y*pixelsPerStud) else viewportSize = Vector2.new(partSize.X*pixelsPerStud, partSize.Z*pixelsPerStud) end if scaleSize == "XY" then viewportSize = (viewportSize.X + viewportSize.Y)/2 else viewportSize = viewportSize[scaleSize] end warn(math.round(textLabelSize/viewportSize*100*1000)/1000)

Make sure to input your desired ScaleSize type/axis and the TextLabel's size.

It should print out a number. This is what you want to input for the Size to maintain the ratio you are seeing in studio.

PreviousFontsNextTruncation

Last updated 6 days ago