how to change textbox position in xp??

glithch

Villager
Member
Joined
Jul 8, 2017
Messages
22
Reaction score
1
First Language
polish
Primarily Uses
RMXP
honest to god ive been looking for a tutorial and i just didnt find anything for xp. i used a script to change the resolution of the game (and i really need that script it really makes the game look 10x better) and now things arent aligned can enyone at least point me in the direction where i should look? which script is it? and yeah if anyone could help out with the menu that would be super cool too
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
14,153
Reaction score
7,804
First Language
English
Primarily Uses
RMMV

I've moved this thread to RGSS Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.

 

glithch

Villager
Member
Joined
Jul 8, 2017
Messages
22
Reaction score
1
First Language
polish
Primarily Uses
RMXP
[move]RGSS Script Requests[/move]
umm i dont really know why is this the right thread since im asking how to do this myself and not for someone to make me A WHOLE NEW SCRIPT since that seem just like a lot.
 

MobiusXVI

Game Maker
Veteran
Joined
Mar 20, 2013
Messages
363
Reaction score
85
First Language
English
Primarily Uses
If you're already familiar with scripting, look in the Window_Message area for how to move its position.
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
14,153
Reaction score
7,804
First Language
English
Primarily Uses
RMMV
umm i dont really know why is this the right thread since im asking how to do this myself and not for someone to make me A WHOLE NEW SCRIPT since that seem just like a lot.
If I'm reading correctly, you are looking for an existing script to help you do something. We still consider that requesting a script - you are just requesting an existing one, as opposed to requesting someone to create one for you.
 

glithch

Villager
Member
Joined
Jul 8, 2017
Messages
22
Reaction score
1
First Language
polish
Primarily Uses
RMXP
If you're already familiar with scripting, look in the Window_Message area for how to move its position.
thank you! i was so confused by the amound of scripts before but now i found this
Code:
 #--------------------------------------------------------------------------
  # * Set Window Position and Opacity Level
  #--------------------------------------------------------------------------
  def reset_window
    if $game_temp.in_battle
      self.y = 50
    else
      case $game_system.message_position
      when 0  # up
        self.y = 16
      when 1  # middle
        self.y = 300
      when 2  # down
        self.y = 500
      end
    end
and that fixes up the problem with position. but now i noticed i also need to change the width of the window. i didnt see anything like that in the script. could you point me at it?
and also while were at pointing me at stuff. what about position of main menu? i mean the little window with continue shutdown etc
 

glithch

Villager
Member
Joined
Jul 8, 2017
Messages
22
Reaction score
1
First Language
polish
Primarily Uses
RMXP
If I'm reading correctly, you are looking for an existing script to help you do something. We still consider that requesting a script - you are just requesting an existing one, as opposed to requesting someone to create one for you.
um i used words like 'tutorial' and 'doing it myself'. the confusion is probably because i used the wrong word. when i meant script i meant like what Mobius told me. i dont know how those are called. but yea i was just looking for a place to change the coordinates.
 

MobiusXVI

Game Maker
Veteran
Joined
Mar 20, 2013
Messages
363
Reaction score
85
First Language
English
Primarily Uses
but now i noticed i also need to change the width of the window. i didnt see anything like that in the script. could you point me at it?
and also while were at pointing me at stuff. what about position of main menu? i mean the little window with continue shutdown etc
The width is set at the very top. Look for the line marked 'super(80, 304, 480, 160)'. This sets the 'x' position, 'y' position, 'width', and 'height' all in one go and in that order, but nothing is labelled.

The other window you're talking about it is the 'Window_MenuCommand'. If you're looking to learn more, I'd recommend the Slip Into Ruby thread over here: https://forums.rpgmakerweb.com/index.php?threads/slip-into-ruby-an-introductory-guide-to-rgss-for-beginners.38900/
It's primarily about VX Ace, but it will help you understand XP as well.
 

glithch

Villager
Member
Joined
Jul 8, 2017
Messages
22
Reaction score
1
First Language
polish
Primarily Uses
RMXP
The width is set at the very top. Look for the line marked 'super(80, 304, 480, 160)'. This sets the 'x' position, 'y' position, 'width', and 'height' all in one go and in that order, but nothing is labelled.

The other window you're talking about it is the 'Window_MenuCommand'. If you're looking to learn more, I'd recommend the Slip Into Ruby thread over here: https://forums.rpgmakerweb.com/index.php?threads/slip-into-ruby-an-introductory-guide-to-rgss-for-beginners.38900/
It's primarily about VX Ace, but it will help you understand XP as well.
ooooooooooooh thank you <33 i got it all figured out now. one last question. do you maybe know how to change the text aligment? because the text lines are still aligned to the left and they dont fill the whole window. i dont know if its possible to even change much since they automatically split into lines in the event page but if i could at least center it it wouldnt look TOO bad
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
14,153
Reaction score
7,804
First Language
English
Primarily Uses
RMMV
Okay, I see now. I will move it to script support then. It needed to be moved at any rate, I just picked the wrong place as I misunderstood what you were asking.
 

MobiusXVI

Game Maker
Veteran
Joined
Mar 20, 2013
Messages
363
Reaction score
85
First Language
English
Primarily Uses
ooooooooooooh thank you <33 i got it all figured out now. one last question. do you maybe know how to change the text aligment? because the text lines are still aligned to the left and they dont fill the whole window. i dont know if its possible to even change much since they automatically split into lines in the event page but if i could at least center it it wouldnt look TOO bad
If you open the help menu, go to the RGSS Reference Manual, then 'Game Library', then 'RGSS Built-in Classes', then 'Bitmap', you will find the 'draw_text' method. I've copy/pasted it below.

draw_text(x, y, width, height, str[, align])
draw_text(rect, str[, align])


Draws a string str in the bitmap box (x, y, width, height) or rect (Rect).

If the text length exceeds the box's width, the text width will automatically be reduced by up to 60 percent.

Horizontal text is left-aligned by default; set align to 1 to center the text and to 2 to right-align it. Vertical text is always centered.

As this process is time-consuming, redrawing the text with every frame is not recommended.



So basically, look for this method in the Game_Message class, and set the 'align' option to 1 which will center the text.
 

glithch

Villager
Member
Joined
Jul 8, 2017
Messages
22
Reaction score
1
First Language
polish
Primarily Uses
RMXP
If you open the help menu, go to the RGSS Reference Manual, then 'Game Library', then 'RGSS Built-in Classes', then 'Bitmap', you will find the 'draw_text' method. I've copy/pasted it below.

draw_text(x, y, width, height, str[, align])
draw_text(rect, str[, align])


Draws a string str in the bitmap box (x, y, width, height) or rect (Rect).

If the text length exceeds the box's width, the text width will automatically be reduced by up to 60 percent.

Horizontal text is left-aligned by default; set align to 1 to center the text and to 2 to right-align it. Vertical text is always centered.

As this process is time-consuming, redrawing the text with every frame is not recommended.



So basically, look for this method in the Game_Message class, and set the 'align' option to 1 which will center the text.
do you mean Window_Message??? because i dont have Game_Message. and this is the only thing i found in it

the last one is c and changing it seems to just mess up the game as it wont open :/
 

MobiusXVI

Game Maker
Veteran
Joined
Mar 20, 2013
Messages
363
Reaction score
85
First Language
English
Primarily Uses
do you mean Window_Message??? because i dont have Game_Message. and this is the only thing i found in it the last one is c and changing it seems to just mess up the game as it wont open :/
Yea, Window_Message my bad. So notice how it's built. The options are x, y, width, height, str, and align.

So '4 + x' is the x value. '32 * y' is the y value. '40' is the width. '32' is the height. 'c' is the string (or the text that you want to show). The align option is excluded. If you don't include it the 'align' option, it defaults to right-aligned. So to center the text you should change it to:

self.contents.draw_text(4 + x, 32 * y, 40, 32, c, 1)
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Seems like people have stopped looking both ways before crossing the road nowadays. Blindly walking out into a into a road only ends in disaster.
Just finished planning out the skeleton of the main quest line of my new game. I'm so excited for it!
Integrating Jason Perry's japan tile set while listening to Murray Atkinson's Heaven and Earth background music.
I forgot I had an account on rpgmakercentral lol
"What do you think the best place to visit on this cold days?" "Hell..."

Forum statistics

Threads
94,539
Messages
921,735
Members
124,406
Latest member
keyboardjockey
Top