How do I move text box by scripting?

Im wondering.
How do you want to move it? The Window_Message.update_position method would probably be what you need to be looking at, but unless you're more specific, we can't help you further.


Also, you didn't state whether you're using Ace (which is the most common one, and what I'm assuming), or VX as in your profile. VX probably has different requirements, because I believe the scripts were significantly reorganized between VX and Ace.
Ok, What I am trying to do is to temporary move the window message box in X position in an event and resize it. The RMVXace.

For example, I know the script below are wrong but I just want to give you an idea what I am trying to do.

class Window_Message_Box < Window_Base 

@Message_Box = Window_Message.update_position (0, 0 ) # I can't seems to find the Window_Message_Update method

end

So, I will call that method inside an event via script.

Message_Box = 100, 200 # where X = 100 and Y = 200
Yeah, it doesn't really work that way. The position of the window is updated BY the message window script, so that doesn't get called until you use the Show Text command. However, using Show Text also halts all other processing until after the window is removed, so your script call in the event will not get run until after the window goes away.


Anywhoo ... the message window, by default, takes up the full width of the game screen. Changing its x position is only going to move it to the right or left a bit, leaving a blank space on the opposite side. If you actually have a BOX with 4 sides, that is not the entire width of the screen, then you must be using a script that already alters the behaviour of the window.


Are you? Do you have a link to it? If you aren't using a message script, maybe you should take a screenshot of what it's doing now, then draw on it to indicate what you'd LIKE it to do, to give a better understanding.
I just want to move the Text Box upward (Y position) about two squares in certain event. I need simple script to do that. I can't find any, so I am trying to write one for myself but dont know how to do it.
Can you not just tell it to position to the middle?

If you add the following script into a new slot:

class Game_Message attr_accessor 😮y # override window y positionendclass Window_Message < Window_Base def update_placement @position = $game_message.position p $game_message.oy self.y = $game_message.oy.nil? ? @position * (Graphics.height - height) / 2 : $game_message.oy @gold_window.y = y > 0 ? 0 : Graphics.height - @gold_window.height endendYou can do this in an event's Call Script command:
Code:
$game_message.oy = 50
and then execute a Show Text command, and it'll put the window at y=50.And afterwards, to reset it (so the rest of the messages go back to the default), do this in a Call Script command:

Code:
$game_message.oy = nil
Problem is, if you have several text boxes in a row, the setting won't update - you need a brief pause between them. So add a Wait 1 Frame before the script call, and that should do it.
Here's an alternative for you 🙂
That's a bit easier 🙂
Cool thanks
I look at it and I can't understand how it works.

So, I add below class Scene_Map < Scene_Base

#————————————————————————–

# ● This is to script call Show Message on the Map.

# ● SceneManager.scene.message_window.move(x, y, w, h)

#————————————————————————–

attr_reader :message_window

Then I call this script in event 

x=SceneManager.scene.message_window.x

y=SceneManager.scene.message_window.y

w=SceneManager.scene.message_window.width

h=SceneManager.scene.message_window.height

$game_variables[88] = x

$game_variables[89] = y

$game_variables[90] = w

$game_variables[91] = h

SceneManager.scene.message_window.move(x, y, w, h)

Where do I put the value to adjust window message? 

SceneManager.scene.message_window.move(x, y, w, h)
XinChao, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.
I made the second post 4 hours after the previous one pal. Look at the time I posted. Btw, thanks for the script.  I am using yours and it works.
Forum Rules said:
4. Do NOT post disruptively. This includes, but is not limited to, double posting (posting directly underneath yourself, this is only allowed if 72 hours have passed since your last post), ...
Glad the script works 🙂


This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-move-text-box-by-scripting.19541/