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!!
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.
Sheeeeeeeeeeeeeeit. I saw this on the side window and didn't see it was for VX Ace.
I've moved this thread to Learning Ruby/RGSS. Please be sure to post your threads in the correct forum next time. Thank you.
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.
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).