Adding a new window in main menu.

AJAJAJ

Villager
Member
Joined
Sep 9, 2015
Messages
26
Reaction score
3
First Language
English
Primarily Uses
  I'm trying to learn how to add windows to menu screens. Right now my goal is just to make a new window in the middle of the main menu screen, what is in it, and what size it is doesn't really matter, about the size of the gold window would be fine. I've tried just copying over what i saw in another window and doing it that way but i didn't have any luck. If anyone could point me towards some information to get started on it i'd appreciate it. This is just a practice exercise to learn how to make new windows, the window doesn't have any purpose.
 

mjshi

Jack of Most Trades
Veteran
Joined
Feb 16, 2013
Messages
969
Reaction score
807
First Language
English
Primarily Uses
N/A
Last edited by a moderator:

AJAJAJ

Villager
Member
Joined
Sep 9, 2015
Messages
26
Reaction score
3
First Language
English
Primarily Uses
mjshi i don't understand what in that link you posted shows me how to make a new window, it looks like a lot of stuff to modify existing windows, i just want to know how to put a new empty window on the main menu, i was hoping for something more simple, there seems to be ALOT of custom stuff in there that doesn't pertain to what i'm trying to do
 
Last edited by a moderator:

Celianna

Tileset artist
Veteran
Joined
Mar 1, 2012
Messages
10,557
Reaction score
5,592
First Language
Dutch
Primarily Uses
RMMV
I've moved this thread to learning Ruby. Please be sure to post your threads in the correct forum next time. Thank you.
 

mjshi

Jack of Most Trades
Veteran
Joined
Feb 16, 2013
Messages
969
Reaction score
807
First Language
English
Primarily Uses
N/A
The second part of what I said--  this is how you add a window to a scene:

In the initialization part of your scene, put

@insertHandler = Window_WindowName.new

then you can further customize it with

@insertHandler.x = blah

@insertHandler.y = blah

@insertHandler.viewport = @viewport

etc. 
 

AJAJAJ

Villager
Member
Joined
Sep 9, 2015
Messages
26
Reaction score
3
First Language
English
Primarily Uses
O.k. great, i was messing around with that stuff earlear but i couldn't figure it out, i'll try again and post what i have so maybe you or someone else can tell me what i'm doing wrong.
 

AJAJAJ

Villager
Member
Joined
Sep 9, 2015
Messages
26
Reaction score
3
First Language
English
Primarily Uses
Alright i'm sure i'm not even close to doing this right but maybe one of you can tell explain this better to me. So i created a window at the bottom of the "windows" list in the script editor and named it Window_New just below DebugRight. I'll show the script that is inside of it, i tried to copy what was inside the Gold window but remove anything that had to do with the contents of the gold window. It seemed like the window with the least stuff in it and would an easy one to look at to reproduce.

#==============================================================================# ** Window_New#------------------------------------------------------------------------------# This window is a new window.#==============================================================================class Window_New < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, window_width, fitting_height(4)) refresh end #-------------------------------------------------------------------------- # * Get Window Width #-------------------------------------------------------------------------- def window_width return 160 end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh contents.clear end #-------------------------------------------------------------------------- # * Open Window #-------------------------------------------------------------------------- def open refresh super endendI then went to the Menu Scene, this is the scene i want the window to appear on. I tried to again reproduce what it looked like was there for the gold window but to make it apply to the Window_New, i changed to X, Y to get it closer to the middle of the screen. I put in the define create_new_window area, below it i didnt touch, i only copied down far enough so you could see the create gold_window that i was looking at.

Code:
#==============================================================================# ** Scene_Menu#------------------------------------------------------------------------------#  This class performs the menu screen processing.#==============================================================================class Scene_Menu < Scene_MenuBase  #--------------------------------------------------------------------------  # * Start Processing  #--------------------------------------------------------------------------  def start    super    create_new_window    create_command_window    create_gold_window    create_status_window  end  #--------------------------------------------------------------------------  # * Create New Window  #--------------------------------------------------------------------------  def create_new_window    @new_window = Window_New.new    @new_window.x = 320    @new_window.y = 240  end  #--------------------------------------------------------------------------  # * Create Command Window  #--------------------------------------------------------------------------  def create_command_window    @command_window = Window_MenuCommand.new    @command_window.set_handler(:item,      method(:command_item))    @command_window.set_handler(:skill,     method(:command_personal))    @command_window.set_handler(:equip,     method(:command_personal))    @command_window.set_handler(:status,    method(:command_personal))    @command_window.set_handler(:formation, method(:command_formation))    @command_window.set_handler(:save,      method(:command_save))    @command_window.set_handler(:game_end,  method(:command_game_end))    @command_window.set_handler(:cancel,    method(:return_scene))  end  #--------------------------------------------------------------------------  # * Create Gold Window  #--------------------------------------------------------------------------  def create_gold_window    @gold_window = Window_Gold.new    @gold_window.x = 0    @gold_window.y = Graphics.height - @gold_window.height  end
 
Last edited by a moderator:

mjshi

Jack of Most Trades
Veteran
Joined
Feb 16, 2013
Messages
969
Reaction score
807
First Language
English
Primarily Uses
N/A
Are there any problems when you run it? It looks fine at the moment.
 

AJAJAJ

Villager
Member
Joined
Sep 9, 2015
Messages
26
Reaction score
3
First Language
English
Primarily Uses
No errors but no new windows appear on the main menu.
 

AJAJAJ

Villager
Member
Joined
Sep 9, 2015
Messages
26
Reaction score
3
First Language
English
Primarily Uses
Oh it worked! I changed the height of the MenuStatus window down to 100 just to make sure it wasnt hiding behind it, and low and behold there it was. Thank you so much for your help Mjshi i've been working on that off and on for the last eight hours. 
 

AJAJAJ

Villager
Member
Joined
Sep 9, 2015
Messages
26
Reaction score
3
First Language
English
Primarily Uses
Messed up part is, that's exactly what i did this morning like eight or more hours ago and assumed it was wrong because i couldn't see the window because it was obscured. DOH!
 

Rikifive

Bringer of Happiness
Veteran
Joined
Jun 21, 2015
Messages
1,441
Reaction score
680
First Language
Polish
Primarily Uses
Other
I'm making windows like this:

Code:
#=========[ Custom Window ]=====================================================#-----------< Change position, opacity and font >-------------------------------CUSTOM_WINDOW_POSITION_X = 40CUSTOM_WINDOW_POSITION_Y = 215CUSTOM_WINDOW_WIDTH = 400CUSTOM_WINDOW_HEIGHT = 200CUSTOM_WINDOW_OPACITY = 50  #---------< Initialize >--------------------------------------------------------class Window_CustomWindow < Window_Base  def initialize(x, y)    super(x, y, CUSTOM_WINDOW_WIDTH, CUSTOM_WINDOW_HEIGHT)    self.opacity = CUSTOM_WINDOW_OPACITY    refresh    end   #-------< Draw Content >------------------------------------------------------  def refresh    self.contents.clear   #The you can put stuff (Text, Icons etc.)    self.contents.font.color = Color.new(25,125,255) # Change text below to blueish    self.contents.draw_text(50, 0, 300, 24, "Hello in blue color", 0) # draw text    self.contents.font.color = normal_color # change color back to normal    self.contents.draw_text(0, 50, 50, 24, "#{$game_party.gold}", 2) #draw current gold value    draw_icon(5, 200, 50) # draw some icon    end # Refreshend # class  #---------< Create window >---------------------------------------------------#~ e.g.  class Scene_Menu < Scene_MenuBase # This would draw that window in menu    class Scene_Item < Scene_ItemBase # This will draw window in Item Scene    # You can change that to scene, where you want to put that window in.    # Take a look on default Scene scripts to see the classes etc.     #---------< Start >---------------------------------------------------------    alias customwindow_start start    def start    customwindow_start    create_customwindow_window    end     #---------< Create >--------------------------------------------------------    def create_customwindow_window    @customwindow_window = Window_CustomWindow.new(    CUSTOM_WINDOW_POSITION_X, CUSTOM_WINDOW_POSITION_Y)    end  end#=========[ END ]===============================================================
So it has its own script slot and you can remove that easily anytime...
I hope it's not done badly, because I know my scripting skills can be rally funny.
@everybody go ahead, tell me how bad it is.
 
Last edited by a moderator:

mjshi

Jack of Most Trades
Veteran
Joined
Feb 16, 2013
Messages
969
Reaction score
807
First Language
English
Primarily Uses
N/A
Your indentation towards the end is kinda strange, but otherwise it looks fine. I'm curious as to why you choose to use variables instead of editing position directly, though (I've always been taught that the fewer the variables, the better), is there a specific reason for that?
 

Rikifive

Bringer of Happiness
Veteran
Joined
Jun 21, 2015
Messages
1,441
Reaction score
680
First Language
Polish
Primarily Uses
Other
Yup, I also think if there's less stuff, then it's better, though I don't think it does matter that much -  in my case, it can, because I should put these in a module... Right? I'm still learning. The reason of this is, that I changed some stuff to make it more for public use, the comments and such are just for anybody else rather than me.. Personally, I'm getting rid of these and putting them directly to save space and such.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.
time for a new avatar :)

Forum statistics

Threads
106,018
Messages
1,018,357
Members
137,803
Latest member
andrewcole
Top