Text Box Vertical Reposition?

coticka

Veteran
Veteran
Joined
May 30, 2015
Messages
74
Reaction score
10
First Language
English
Primarily Uses
RMMV
I'm using Yanfly's Text Script which works fine and all, the only thing is I'm looking for a way to reposition the y-coordinate of how the text box defaults to when at the bottom of the screen. Here's an image for reference of what I'm trying to do.
Is there any way do accomplish this through the default database? I was too scared to mess something up.
.
 

cyanic

Veteran
Veteran
Joined
Nov 16, 2015
Messages
106
Reaction score
71
Primarily Uses
Assuming you're talking about about the Ace Message System, there isn't a built-in method for it. You'll have to patch Window_Message#update_placement. For example, add the following after the self.y assignment:
Code:
self.y -= <your offset here> if @position == 2
 
Last edited:

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,660
Reaction score
563
First Language
English
Primarily Uses
RMVXA
Add one line after line 865
Code:
    self.y = (Graphics.height - self.height) - 16
so it looks like this
Code:
  def adjust_message_window_size
    self.height = window_height
    self.width = window_width
    create_contents
    update_placement
    self.x = (Graphics.width - self.width) / 2
    self.y = (Graphics.height - self.height) - 16
    start_name_window
  end
just change the value of 16 to whatever you want the box to be raised up by.

Question do you want the box to be adjustable? So that you can change the height whenever you want?
 

cyanic

Veteran
Veteran
Joined
Nov 16, 2015
Messages
106
Reaction score
71
Primarily Uses
Add one line after line 865
Code:
    self.y = (Graphics.height - self.height) - 16
That doesn't account for window position at all, so it'll always be stuck at the bottom.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,660
Reaction score
563
First Language
English
Primarily Uses
RMVXA
That doesn't account for window position at all, so it'll always be stuck at the bottom.
It did adjust the top and middle windows. but worked in my tests for the bottom.
However this is a better code to use:

Code:
    case $game_message.position
    when 2
    self.y = (Graphics.height - self.height) - 16
    end
Or with a variable labeled at the top
VARIABLE_HEIGHT = 23 # whatever variable used to adjust height
Code:
    case $game_message.position
    when 2
    self.y = (Graphics.height - self.height) - $game_variables[YEA::MESSAGE::VARIABLE_HEIGHT]
    end
 

cyanic

Veteran
Veteran
Joined
Nov 16, 2015
Messages
106
Reaction score
71
Primarily Uses
What about the gold window position? That seems to be updated inside #update_placement.
 

coticka

Veteran
Veteran
Joined
May 30, 2015
Messages
74
Reaction score
10
First Language
English
Primarily Uses
RMMV
It worked like a charm! Thanks guys for helping me out. :cutesmile:
 
Last edited:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
[move]RGSSx Script Support[/move]
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,045
Members
137,569
Latest member
Shtelsky
Top