Text+|Custom fonts & advanced control

Makes sense, for me I can’t figure it out on how to have automatic line breaks…
It would be nice if you could kind of explain how beccause in the Fundamentals section, I can only find the “manual” way of doing it… Sorry for the hassle though ;-;.
If you want the font’s properties you can tell me.

My code for getting the text (client-sided):

local invLabel = textplus.Create(
	script.Parent.Inventory.ItemName,
--	"Energy Flavored Zesty\nBar", testing
	"Very Long Text Very Long Text Very Long Text Very Long Text Very Long Text Very Long Text",
	{
		Font = textplus.CustomFonts.MyFont,
		Size = 25,
		Dynamic = true,
		XAlignment = "Right",
		YAlignment = "Top",
		Color = Color3.fromRGB(255, 255, 255),
		WordSorting = true,
		LineSorting = true,
	}
)
1 Like

It clearly states that the frame you provide serves as the bounding box. If the text exceeds the frame boundaries, it will automatically create line breaks.

Please let me know if you still can’t get it to work!

I apologize, because it seems I have messed up the automatic line breaking.
I will be fixing it shortly, thanks for noticing!

No problem! This module will be excellent for my game!!!
10/10 for sure!

1 Like

have you considered releasing the place files for the showcases? it would provide some much needed insight regarding proper ui manipulation

Yes, I have actually. I’m working on it.

Alexander, I found another bug where you can’t overwrite/update the text.
Let’s say I have my main script with the customization and everything,
but when I want to overwrite it or update it, it won’t.

Example:

textplus.Create(
	script.Parent.EventFrame,
	"Nothing to see here.",
	{
		Font = textplus.CustomFonts.MyFont,
		Size = 25,
		Dynamic = true,
		XAlignment = "Center",
		YAlignment = "Center",
		Color = Color3.fromRGB(255, 255, 255),
		WordSorting = true,
		LineSorting = true,
	}
)

task.wait(5) -- Or you can do it instantly it doesn't matter

textplus.Create(
	script.Parent.EventFrame,
	"Changed!" -- Didn't work..
)
1 Like

Thanks for reporting this bug, I will look into it!

1 Like

Hi there everyone, finally an update fixing many issues.

:package: Version 1.7.0

:sparkles: New features:

  • Added Truncate feature. Clear and Cut variants.
  • Added GetText function, that returns a frame’s text as a string.

:hammer_and_wrench: Changes & improvements:

  • Changed creation structure, fixing a few Dynamic bugs.
  • Fixed and improved automatic line breaks / line wrapping.
  • Now warns about invalid fonts being replaced with default.
  • Doesn’t warn about invalid font when no font at all is passed.
  • Now removes the frame size cache on resize when Dynamic is disabled.
  • Now cleans up all Dynamic connections when a frame is destroyed.
  • Changed AbsoluteSize changed connection to Size, removing the 1 frame delay.
  • Now caches customization after Dynamic handling, ensuring that the customization is verified in the cached customization too.
  • Now caches frame sizes, avoiding unnecessary expensive absolute size calculations.
  • Split currentLine variable up into two, avoiding some table indexing.
  • Custom font verification now doesn’t check the type for table, as it’s not necessary.
  • Got rid of unnecessary multiplication in the internal createCharacter function when using custom fonts.
  • Avoided self-assignment when no customization is provided, but one is already present.
  • Changed a few > to == for optimization.
  • Comment changes and additions.
  • Changed module description.
  • Additional changes, that I didn’t keep track of.



Please let me know about any other issues or ideas below!

1 Like

Both of your reported bugs should now be fixed in v1.7.0.

1 Like

Alexander, sadly sadly I found a bug already, it’s something to do with the positions. So let’s say I have my text rendered on a screen, and then I resize my screen to another size, well the positions would get messed up.

I have an example of the before and after:

Before:

After (resizing the player’s screen & the Dynamic boolean set to true):

(Also it would also be nice if had an option/boolean for the text size to be the same for every device because you can see the difference between the two screens being different sizes. This isn’t really needed but it was just to have an idea.)

1 Like

Also at weird times the text would go somewhere way far which is unusual, and I don’t even know how this happens:

They won’t get messed up, they just won’t update.
It’s simply caused by the fact that Dynamic doesn’t detect screen size change, and only size change from GUI elements.
This will be updated and fixed soon. Thanks for reporting this.

I have an idea for this, and it will be in the next update. Thanks for mentioning.

That’s weird.
It’d be nice if you could try to find when exactly this happens, and what exactly happens.

1 Like

:package: Version 1.8.0

:sparkles: New features:

  • New ScaleSize feature. “X”, “Y” and “XY” variants.

:hammer_and_wrench: Changes & improvements:

  • Dynamic updates now also account for viewports and parts.
  • Fixed Dynamic destroy & ancestry-change handling.
  • With an invalidly placed container, it will know clear all connections that were made before detection — for the Dynamic feature.
  • Simplified boolean customization confirmation logic.
  • Cached player camera.
  • Minor comment changes and additions.
  • Minor spacing and order adjustments.



For more information on new features and changes, remember to always check the guide at the very top of this topic, as it is always up-to-date.

If there’s anything else, please reply here.

1 Like

Alexander I got an error code in line 1030, I’m assuming you’re checking when the property “Size” changes in a ScreenGui although that property doesn’t exist.
Code:

if instance:IsA("ScreenGui") then
	if not camera then break end
						
		local viewportSize = camera.ViewportSize
		if instance.IgnoreGuiInset then
			rootSizeX = viewportSize.X
			rootSizeY = viewportSize.Y
		else
			local inset = GuiService:GetGuiInset()
			rootSizeX = viewportSize.X - inset.X
			rootSizeY = viewportSize.Y - inset.Y
		end
						
			table.insert(instance:GetPropertyChangedSignal("Size"):Connect(update)) -- Error occures
						
		break

That’s a stupid mistake from me. It’s fixed now.

Don’t call it stupid!!! I am impressed from what you can do Alexander.

1 Like

Wait Alexander, you forgot to add a table when you have the table.insert code lol…
Plus that also goes for line 1057, with the SurfaceGui version.

Oopsies. Update.
Btw the reason I’m rushing is because I gotta go in a few minutes.

1 Like