GameMaker Another textbox question

NOTE: Sorry I did not realize this question was going to be so long. Don't waste time answering each sub-question it was more of a broad stroke thing just wanted to get some general advice. (It's not just a print keyboard string to screen and I'm done, there's a bit more to it than that.)

For some reason, I'm having a real hard time with a scaleable multi-line textbox model that pleases me.

I hate to harp on about this one but this seems to be a real rabbit hole for me.

This is not a problem that I can solve as such but it's getting super messy. There are a million and one ways to solve this problem, especially in GMS.

I'm ending up with a ton of issues.

# Having to use a whole raft of insert, copy, string_width, string height issues.

# Using draw_text_ext_transformed_color() has been a problem because I don't want to use the separation or the width functions within because it doesn't produce the desired result. But at the same time, I need them because the simpler draw text functions don't scale. I have to add a magic number to the separation variable just so it doesn't error. It's either that or I start to ask questions like will adding this potential character to exceed the limits of that line.

# When inserting a letter inside a string (Using arrow keys to set position) I have to copy, insert, delete, and check the validity of strings.

# Ensure that any text entered will not break the formatting rules.

# There are two functions that are useful keyboard_string and keyboard_laschar but both of these have there owned rabbit wholes and require two completely different thought processes to implement them.

# I end up with 100 odd variables E.g. What is the x1, y1, x2, y2 boundaries of the bounding box, what are the x1, y1, x2, y2 coordinates of the text, what is the gap between the bounding box and the text. What color is the text, what is the limit of the text line length, is the length of the text defined by the number of characters or the width in pixels, what is the gap between one line and the next, which variable do I need to connect this text field too, what kind of data structure is that (avoid incorrect data type errors) It just goes on and on.

I don't mind this in itself because that's basically what programming is I just want to make sure I'm not overthinking this.

I can fix it always. But I don't want to fudge it. That's my curse.

I will probably have to upload some code but I'll see what the suggestions are first. I have searched and found many questions and many forum responses in regards to textboxes. This tells me this is an issue that may need to be worked on. I do not ensure why game maker turns fonts into textures.

This seems to be a neglected area in Gamemaker. That being font's and just form controls in general. I can understand this to some degree because Gamemaker is obviously not for designing backend POS / DB type software but it seems to be giving me a grand headache compared to everything else I have done up to now.

It just seems like a really fiddly type of task.

I like to keep my code as tight as ducks a** but this doesn't seem to be happening for me. Any advice would be gratefully received.
 
Last edited:

TailBit

Member
What I ended up doing was splitting it into lines, every line would list its formating changes that it had applied at the end of the line (from custom BB code), that way I could start from a spesific line if I had scrolling and fetch the formating it should start with.

Have tried to make a gml editor too (first big attempt, was trash, but it did tab spacing, function and font highlighting)

I trashed all my old projects when GMC changed forum, can try see if I put something together later, because I do need something like this too.
 
Top