How do I change the width and position of the message window?

Joh

Villager
Member
Joined
Dec 6, 2013
Messages
15
Reaction score
0
First Language
English
Primarily Uses
By default, the message window's width spans the entire screen, and can be set to appear in one of three fixed positions: Bottom, Middle or Top. For my game, I need the message window located in a very specific place, and to have a very specific width. I've been poking around in the Window_Message script, but the only relevant sections looks like this:

 #--------------------------------------------------------------------------
  # * Get Window Width
  #--------------------------------------------------------------------------
  def window_width
    Graphics.width
  end

I was expecting to see something like  "self.x = (some number)" but, instead, it looks like it just goes off the width of the screen. As for where to change the position of the message window itself, I haven't found anything.

If possible, I would like to solve this issue without the use of user-made scripts. I'd much rather just change values within the script editor!

If you need any further clarification, just ask! Thanks!!
 

TheSourceCode

Villager
Member
Joined
Dec 15, 2015
Messages
16
Reaction score
3
First Language
Spanish
Primarily Uses
Hello Joh!

Yanfly has a perfect script to achieve this. =) 

https://yanflychannel.wordpress.com/rmvxa/core-scripts/ace-message-system/

There's also instructions on how to use it as well, but if you still got any questions, feel free to message me! =3

EDIT: Sorry, didn't realize you didn't want to use a pre-made script by someone 'till now. So sorry about that. xd 
 
Last edited by a moderator:

Gyldstrand

Veteran
Veteran
Joined
Oct 16, 2014
Messages
76
Reaction score
4
Window_Message.prototype.initialize = function() { var width = this.windowWidth(); var height = this.windowHeight(); //var x = (Graphics.boxWidth - width) / 2; var x = 300; <------------------------------------------------------------------------------------------------------- Window_Base.prototype.initialize.call(this, x, 0, width, height); this.openness = 0; this.initMembers(); this.createSubWindows(); this.updatePlacement();};Window_Message.prototype.windowWidth = function() { return 200;<------------------------------------------------------------------------------------------------------- //return Graphics.boxWidth;};Window_Message.prototype.windowHeight = function() { return 200;<------------------------------------------------------------------------------------------------------- //return this.fittingHeight(this.numVisibleRows());};Window_Message.prototype.updatePlacement = function() { this._positionType = $gameMessage.positionType(); this.y = 200;<------------------------------------------------------------------------------------------------------- //this.y = this._positionType * (Graphics.boxHeight - this.height) / 2; this._goldWindow.y = this.y > 0 ? 0 : Graphics.boxHeight - this._goldWindow.height;};I don't know if that will mess up anything or not but it will change the message window.
 

Joh

Villager
Member
Joined
Dec 6, 2013
Messages
15
Reaction score
0
First Language
English
Primarily Uses
EDIT: Sorry, didn't realize you didn't want to use a pre-made script by someone 'till now. So sorry about that. xd 
Hey, that's totally fine!! Yanfly does great work, so this is actually a spot-on suggestion. I'm just stubborn and want to cut down on the amount of people I'll need to credit once my game's done, haha.

Thanks!! :D

I don't know if that will mess up anything or not but it will change the message window.
I'm actually not entirely certain on how to use this! It doesn't look like a standalone script, and it seems a little big to be a script call.

Either way, if you wrote this on my behalf, thanks a ton! Just tell me where it goes, and I'll gladly give it a shot!
 
Last edited by a moderator:

Gyldstrand

Veteran
Veteran
Joined
Oct 16, 2014
Messages
76
Reaction score
4
Sheeeeeeeeeeeeeeit.  I saw this on the side window and didn't see it was for VX Ace. 
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,370
Reaction score
7,678
First Language
German
Primarily Uses
RMMV
I've moved this thread to Learning Ruby/RGSS. Please be sure to post your threads in the correct forum next time. Thank you.
 
Last edited by a moderator:

Joh

Villager
Member
Joined
Dec 6, 2013
Messages
15
Reaction score
0
First Language
English
Primarily Uses
Is it possible for this topic to be deleted? I doubt it'll get answered.

That is, unless someone knows how to adjust the height position of the message window by normal means, or with Yanfly's Ace Message Script. I caved, and am currently trying it out.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,370
Reaction score
7,678
First Language
German
Primarily Uses
RMMV
Is it possible for this topic to be deleted? I doubt it'll get answered.
No, only closed - but why do you think it won't get answers?
The forum rules say no bumping unless 72 hours has passed, exactly because we know that it will take days to get a more complex answer.


Your topic is less than 48 hours old...
 

reno385

Veteran
Veteran
Joined
May 2, 2013
Messages
31
Reaction score
8
First Language
English
Primarily Uses
I'm not a great scripter so there may be a better way to do this, but you could try putting this under the materials section.

class Window_Message < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize unless SceneManager.scene_is?(Scene_Battle) super(0, 0, 100, 100) else super(0, 0, window_width, window_height) end self.z = 200 self.openness = 0 create_all_windows create_back_bitmap create_back_sprite clear_instance_variables end #-------------------------------------------------------------------------- # * Update Window Position #-------------------------------------------------------------------------- def update_placement if SceneManager.scene_is?(Scene_Battle) @position = $game_message.position self.y = @position * (Graphics.height - height) / 2 end @gold_window.y = y > 0 ? 0 : Graphics.height - @gold_window.height endendThe arguments for super are x, y, width, height measured in pixels. x and y start at 0 at the top left and increase as you go right and down. You can write these in terms of the edge of the screen plus or minus other window sizes so that if you change one window the others should move with it, or just write in the pixel amount itself. I didn't know if you wanted the message window in battles to change as well but if so just cut out the if/unless statements. Note that you won't be able to set the window placement from the event editor, though.

If you stick with Yanfly's script or decide to use other message window-altering scripts this snippet will probably mess things up, so as long as you keep it in materials and don't directly rewrite the original script you could always delete it later (you shouldn't touch the original script anyway).
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Are we allowed to post about non-RPG Maker games? And, if so, would any of you be interested in a short, proof of concept type non-euclidian puzzle game?
I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

A bit of a "sparkle" update to the lower portion of the world map. :LZSexcite:

Forum statistics

Threads
105,883
Messages
1,017,232
Members
137,607
Latest member
Maddo
Top