Custom Textboxes

Share and discuss custom LunaLua code and content packs for SMBX2.

Moderator: Userbase Moderators

9thCore
2025 Egg Hunter
2025 Egg Hunter
Posts: 41
Joined: Tue Mar 10, 2015 1:46 pm
Flair: hewo
Pronouns: he/him

Custom Textboxes

Postby 9thCore » Tue Jul 13, 2021 2:47 pm

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
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
Last edited by 9thCore on Sat Dec 11, 2021 3:48 pm, edited 8 times in total.

Suckerman7 GM
Eerie
Eerie
Posts: 706
Joined: Fri Jun 19, 2015 9:42 am
Flair: Multiversal Traveller/Prismverse's God of Creation
Pronouns: he/him

Re: Custom Textboxes

Postby Suckerman7 GM » Wed Jul 14, 2021 4:17 am

It's about time! I cannot wait to use this in places that need dialogue!

Marioman2007
2025 Egg Hunter
2025 Egg Hunter
Posts: 530
Joined: Tue Aug 25, 2020 3:19 am
Flair: Dr. Bones
Pronouns: He/Him

Re: Custom Textboxes

Postby Marioman2007 » 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)

9thCore
2025 Egg Hunter
2025 Egg Hunter
Posts: 41
Joined: Tue Mar 10, 2015 1:46 pm
Flair: hewo
Pronouns: he/him

Re: Custom Textboxes

Postby 9thCore » 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.

Marioman2007
2025 Egg Hunter
2025 Egg Hunter
Posts: 530
Joined: Tue Aug 25, 2020 3:19 am
Flair: Dr. Bones
Pronouns: He/Him

Re: Custom Textboxes

Postby Marioman2007 » Thu Jul 15, 2021 10:01 am

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!

MrCool422
Fighter Fly
Fighter Fly
Posts: 35
Joined: Sun Jan 24, 2021 12:26 am
Flair: Autistic
Pronouns: He/Him
Contact:

Re: Custom Textboxes

Postby MrCool422 » Wed Sep 22, 2021 10:38 pm

why is it on bottom right?
Image

Wiimeiser
Snifit
Snifit
Posts: 215
Joined: Mon Jun 24, 2019 4:36 am
Flair: What?

Re: Custom Textboxes

Postby Wiimeiser » Thu Sep 23, 2021 7:06 am

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.

9thCore
2025 Egg Hunter
2025 Egg Hunter
Posts: 41
Joined: Tue Mar 10, 2015 1:46 pm
Flair: hewo
Pronouns: he/him

Re: Custom Textboxes

Postby 9thCore » Thu Sep 23, 2021 7:58 am

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

MrCool422
Fighter Fly
Fighter Fly
Posts: 35
Joined: Sun Jan 24, 2021 12:26 am
Flair: Autistic
Pronouns: He/Him
Contact:

Re: Custom Textboxes

Postby MrCool422 » Thu Sep 23, 2021 8:42 pm

all i did is just put on this code. local textbox = require("customTextbox")

9thCore
2025 Egg Hunter
2025 Egg Hunter
Posts: 41
Joined: Tue Mar 10, 2015 1:46 pm
Flair: hewo
Pronouns: he/him

Re: Custom Textboxes

Postby 9thCore » Fri Sep 24, 2021 5:40 am

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

9thCore
2025 Egg Hunter
2025 Egg Hunter
Posts: 41
Joined: Tue Mar 10, 2015 1:46 pm
Flair: hewo
Pronouns: he/him

Re: Custom Textboxes

Postby 9thCore » 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!

MrCool422
Fighter Fly
Fighter Fly
Posts: 35
Joined: Sun Jan 24, 2021 12:26 am
Flair: Autistic
Pronouns: He/Him
Contact:

Re: Custom Textboxes

Postby MrCool422 » Sat Sep 25, 2021 3:59 pm

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

9thCore
2025 Egg Hunter
2025 Egg Hunter
Posts: 41
Joined: Tue Mar 10, 2015 1:46 pm
Flair: hewo
Pronouns: he/him

Re: Custom Textboxes

Postby 9thCore » Mon Oct 04, 2021 8:29 am

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!

9thCore
2025 Egg Hunter
2025 Egg Hunter
Posts: 41
Joined: Tue Mar 10, 2015 1:46 pm
Flair: hewo
Pronouns: he/him

Re: Custom Textboxes

Postby 9thCore » Sat Dec 11, 2021 3:48 pm

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!


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 2 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari