Page 1 of 1

Custom Textboxes

Posted: Tue Jul 13, 2021 2:47 pm
by 9thCore
Hey!

You! Yes, you! Have you ever wanted to use a slightly fancier-looking textbox than the default one?
Well now you can!
With my library you can have fancy-ish textboxes!
It uses textplus.lua which means that the default <tags> should work!
Besides that there's a few more custom tags, all documented in the library itself.

NOTE
Its not multiplayer compatible.

Using tags and stuff can get ugly really quickly especially with the Talk Message field in the editor. Unless I make a separate editor just for this (which I will not do) or the x2 devs make another editor themselves (which isn't gonna happen any time soon as the game needs to be finished first) it's gonna remain that way.

I cannot promise good performance with this. It works fine on my computer, but it's also not the worst in the world. If you do experience slowdowns, my apologies.


A gif showing it in action (more to come, probably): show
Image
How to use

1. In your luna.lua file put

Code: Select all

local textbox = require("customTextbox")
at the top.
2. Now you're ready to make your own textboxes and stuff! Check the example level bundled with the library for more information. (the library is inside the level folder)

Downloads
Downloads: show

And here is the changelog in case you're curious:


Changelog
Changelog: show
V1.4: show
Fixed a problem with coloring text that I didn't think about. Thanks Eulous for discovering it!
V1.3.1: show
Really small hotfix (1 line change) because Apparently Misc.isPaused() returns nil if not paused when playing from the launcher, creating problems.
V1.3: show
You can actually modify the properties from outside the library now

yeah i dont know why i didnt do this earlier
V1.2: show
Fixed a small oversight which should make the textboxes compatible with events, oops
V1.1: show
Added padding for the textboxes if you want to use that
Also you can manipulate textboxes created by Talk Messages easier by modifying talkMessageProperties (line 173)
yeah thats it; its not major changes or anything so levels using older versions should still be compatible hopefully
V1: show
The library has been released


Any bugs should be reported, either here or on discord: 9thCore#5404.

since i got featured on the starboard ive been working on this i need to go to sleep

Re: Custom Textboxes

Posted: Wed Jul 14, 2021 4:17 am
by Suckerman7 GM
It's about time! I cannot wait to use this in places that need dialogue!

Re: Custom Textboxes

Posted: Wed Jul 14, 2021 7:25 am
by Marioman2007
Nice! but I have a question-
any way to increase the size and position of the textbox? (the text's length also)

Re: Custom Textboxes

Posted: Wed Jul 14, 2021 8:19 am
by 9thCore
marioman2007 wrote:
Wed Jul 14, 2021 7:25 am
Nice! but I have a question-
any way to increase the size and position of the textbox? (the text's length also)
If you make a textbox yourself you can change its position (x and y arguments), scaling for the text (xscale and yscale arguments) and the box's width (boxWidth argument, which also impacts the text's maximum length if that's what you're asking)
So you can have a textbox with very big letters, that's 500px long and that's in a random position on the screen.

Though you can't really do that easily with 1.3 textboxes (the Talk Message field in the editor) since they just use some default variables. If you want to change the box's/text's width for the Talk Message you'll need to go into the library itself, at the bottom. There you'll find the arguments used for the Talk Messages.

I might make it a bit more user-friendly when it comes to the Talk Messages and customization regarding them. Won't promise anything though.

Re: Custom Textboxes

Posted: Thu Jul 15, 2021 10:01 am
by Marioman2007
9thCore wrote:
Wed Jul 14, 2021 8:19 am
marioman2007 wrote:
Wed Jul 14, 2021 7:25 am
Nice! but I have a question-
any way to increase the size and position of the textbox? (the text's length also)
If you make a textbox yourself you can change its position (x and y arguments), scaling for the text (xscale and yscale arguments) and the box's width (boxWidth argument, which also impacts the text's maximum length if that's what you're asking)
So you can have a textbox with very big letters, that's 500px long and that's in a random position on the screen.

Though you can't really do that easily with 1.3 textboxes (the Talk Message field in the editor) since they just use some default variables. If you want to change the box's/text's width for the Talk Message you'll need to go into the library itself, at the bottom. There you'll find the arguments used for the Talk Messages.

I might make it a bit more user-friendly when it comes to the Talk Messages and customization regarding them. Won't promise anything though.
ok, I will try that. Thanks!

Re: Custom Textboxes

Posted: Wed Sep 22, 2021 10:38 pm
by MrCool422
why is it on bottom right?
Image

Re: Custom Textboxes

Posted: Thu Sep 23, 2021 7:06 am
by Wiimeiser
MrCool422 wrote:
Wed Sep 22, 2021 10:38 pm
why is it on bottom right?
Image
Looks like the text boxes called by events just spawn there for some reason. Probably a bug.

Re: Custom Textboxes

Posted: Thu Sep 23, 2021 7:58 am
by 9thCore
MrCool422 wrote:
Wed Sep 22, 2021 10:38 pm
why is it on bottom right?
Image
Hey sorry for the delayed reply but it looks like the library is snapping the textbox to the bounds of the camera which happens if the textbox is outside of the camera (so the player can read the textbox). Are you creating a textbox from code? If so, care to share the code for a sec?

If you aren't creating them from code then it's probably a bug like Wiimeiser said

Re: Custom Textboxes

Posted: Thu Sep 23, 2021 8:42 pm
by MrCool422
all i did is just put on this code. local textbox = require("customTextbox")

Re: Custom Textboxes

Posted: Fri Sep 24, 2021 5:40 am
by 9thCore
MrCool422 wrote:
Thu Sep 23, 2021 8:42 pm
all i did is just put on this code. local textbox = require("customTextbox")
so the textbox is created by a npc or a block with a text message set from the editor? if it's fine with you could you send over the level so i can take a look? (preferably through private messages so others can't take it)
of course its your decision and you don't need to share it if you don't want to; i'll still try to figure it out without it

Re: Custom Textboxes

Posted: Sat Sep 25, 2021 1:47 am
by 9thCore
Alright new 1.2 update is out, fixed a small oversight where textboxes created with level events like Level - Start wouldn't spawn in the right place.

Thanks MrCool422 for reporting!

Re: Custom Textboxes

Posted: Sat Sep 25, 2021 3:59 pm
by MrCool422
9thCore wrote:
Sat Sep 25, 2021 1:47 am
Alright new 1.2 update is out, fixed a small oversight where textboxes created with level events like Level - Start wouldn't spawn in the right place.

Thanks MrCool422 for reporting!
you're welcome

Re: Custom Textboxes

Posted: Mon Oct 04, 2021 8:29 am
by 9thCore
Hello hello small bump because a bad bug has been discovered: the textbox wouldn't work if the episode was played from the launcher.
I released a hotfix for it so like. download it if you dont want that bug to be present

thanks to Pixelated Perfection for reporting it!

Re: Custom Textboxes

Posted: Sat Dec 11, 2021 3:48 pm
by 9thCore
New update (well actually it's just went from 1.3.1 to 1.4) because I fixed a problem with coloring text

Thanks to Eulous for discovering it!