Change position/location of text box

T

Tenten2016

Guest
For the next game I'm working on, I'm using text boxes. As of right now, the text box appears in the center of the room/level. What do I change to get the box to be in the right hand corner; in other words, do I change the Script, do I change the Object: Create or Draw Event, or do I change the Code Creation within that specific room/level? I know I'm looking for X and Y (I'm assuming), I just don't know what event to focus on.

Thank you. =D

This image shows the text box at the bottom of the screen; yet I need the text box at the top of the screen.
 
Last edited by a moderator:

obscene

Member
Whatever x and y you tell it to draw at, it will draw at. There's not much more to say about it than that. I assume you are using some kind of script you found somewhere to draw a text box?
 
T

Tenten2016

Guest
Whatever x and y you tell it to draw at, it will draw at. There's not much more to say about it than that. I assume you are using some kind of script you found somewhere to draw a text box?
I'm asking where I do this; do I do it in the script...do I do it in the Object: Create or Draw Event?
 
T

Tenten2016

Guest
Heres the code...well part of it:

draw_set_font(font0);
draw_set_color(c_blue);
draw_rectangle(x,y,x+boxwidth,y+boxheight,0);
draw_set_color(c_black);
draw_rectangle(x,y,x+boxwidth,y+boxheight,1);

What exactly do I edit? I know I'm editing the draw_rectangle x and y....but still.
 

obscene

Member
The object is drawing relative to it's own x and y.

So easiest fix is to just move the object to the bottom right corner.

Or you take out x and y and substitute in some other number thats near the bottom right of your screen.
 
T

Tenten2016

Guest
The object is drawing relative to it's own x and y.

So easiest fix is to just move the object to the bottom right corner.

Or you take out x and y and substitute in some other number thats near the bottom right of your screen.
So how do I move it to the bottom or the left or the top? That's what I'm asking lol how do I move the text box? I'm trying to be clear but I really don't know how clear I need to be to say 'How do I move the text box'? I know what I need to do, but I don't know how to do it. Does that make sense?
 
T

Tenten2016

Guest
For instance are you telling me to do this:

draw_set_font(font0);
draw_set_color(c_blue);
draw_rectangle(16,24,x+boxwidth,y+boxheight,0);
draw_set_color(c_black);
draw_rectangle(16,24,x+boxwidth,y+boxheight,1);

?
 
T

Tenten2016

Guest
Nope, that doesn't work; that only makes the box bigger.
 
T

Tenten2016

Guest
Am I suppose to be using an view code such as:
draw_text(view_xview[0] + view_yview[0] + 0, 0, "hello");

Where would I put that though? hmmm
 
T

Tenten2016

Guest
Anybody.....anybody know how to change the location of an text box? I just want it at the top left corner....my text box....anyone?
 

obscene

Member
If you want your text box in the top left corner... that would be 0,0.

If you using a normal draw event, that's 0,0 in the room.

If you are using the draw GUI event, that's 0,0 on the screen.

You probably need to spend a little more time learning the basics of GM before you copy someone's text box script.
 
T

Tenten2016

Guest
If you want your text box in the top left corner... that would be 0,0.

If you using a normal draw event, that's 0,0 in the room.

If you are using the draw GUI event, that's 0,0 on the screen.

You probably need to spend a little more time learning the basics of GM before you copy someone's text box script.
I do...and 0,0 isn't working. The reason why I'm hardly on here is because I know a lot of this already but this is really messing me up. However, I started another thread on this same topic that's giving me better input since all you want to do is berate. Thanks but no thanks.
 

obscene

Member
Sorry if you think I was berating, but asking "how do I move something" is kind of GM 101. If you don't understand X and Y coordinates then you don't understand how to draw a text box on a screen. By doing things backwards and using someone's script you are skipping the learning process and doing yourself no favors. But if you want to make 2 threads on every basic topic and bump then a dozen times in a row breaking all the forum rules waiting for other poeple to write your code, you'll soon find that my berating was actually very polite.

And you're welcome either way.
 
Top