- Joined
- Mar 31, 2013
- Messages
- 259
- Reaction score
- 117
- First Language
- English
- Primarily Uses
- RMMZ
So I'm trying to spread my wings and get away from the more common object functions (actors, events, maps, etc.) and try my hand into making my own windows/scenes. Might help me develop other more complicated scenes in the future...
I have looked up via Google and search functions, and although helpful in their own right, I believe I understand enough to -create- the basic window. However, I am lacking in the more advanced methods that I feel are necessary to proceed with this project.
What am I trying to make:
- A window centered in the middle of the screen for x,y
- text at the top (but inside) of the window "Choose a nation to sail for:" with enough room in between that and the flags
- Text for the nation appear when "highlighted" (either through arrow keys or hover with mouse)
- Long enough to fit 4 small-ish images (these will be the nation flags the player can choose from)
- If using keyboard = left/right will select and change the highlighter, instead of like most menus (up/down)
- opacity of highlighter changes (to be "flashing" on the selected option).
Alright now that you know what I'm trying to do, I am -NOT- trying to get you to make the plugin for me. I just need assistance along the way. I have the bare bones window coded (not tested yet)
So what am I asking for?
- Positioning of box, text, Icons (I'll make the flags into icons) regardless of resolution (does the window x,y look good?)
- How to update the positioning of the curse upon input (update? refresh? Both?)
- (Optional, but not required): Mouse Support (change highlighter based on cursor position, selection, etc)
Mostly the first two... the Scene_* I can work out for myself mostly. Might need help understanding the "setHandlers" if those are required for this window... not sure.
EDIT: Added a "mock-up":
I have looked up via Google and search functions, and although helpful in their own right, I believe I understand enough to -create- the basic window. However, I am lacking in the more advanced methods that I feel are necessary to proceed with this project.
What am I trying to make:
- A window centered in the middle of the screen for x,y
- text at the top (but inside) of the window "Choose a nation to sail for:" with enough room in between that and the flags
- Text for the nation appear when "highlighted" (either through arrow keys or hover with mouse)
- Long enough to fit 4 small-ish images (these will be the nation flags the player can choose from)
- If using keyboard = left/right will select and change the highlighter, instead of like most menus (up/down)
- opacity of highlighter changes (to be "flashing" on the selected option).
Alright now that you know what I'm trying to do, I am -NOT- trying to get you to make the plugin for me. I just need assistance along the way. I have the bare bones window coded (not tested yet)
Code:
function Window_NationSelect() {
this.initialize.apply(this, arguments);
}
Window_NationSelect.prototype = Object.create(Window_Selectable.prototype);
Window_NationSelect.prototype.constructor = Window_NationSelect;
Window_NationSelect.prototype.initialize = function(actor) {
var width = this.windowWidth();
var height = this.windowHeight();
var x = (Graphics.boxWidth - width) / 2;
var y = (Graphics.boxHeight - height) / 2;
Window_Selectable.prototype.initialize.call(this, x, y, width, height);
// TODO: Setup initial actor faction and reputation based on class
// TODO: Setup an update? refresh?
};
Window_NationSelect.prototype.windowWidth = function() {
return 300;
};
Window_NationSelect.prototype.windowHeight = function() {
return this.fittingHeight(2) + this.flagHeight();
};
Window_NationSelect.prototype.flagHeight = function() {
return 35;
};
Window_NationSelect.prototype.update = function() {
Window_Selectable.prototype.update.call(this);
};
So what am I asking for?
- Positioning of box, text, Icons (I'll make the flags into icons) regardless of resolution (does the window x,y look good?)
- How to update the positioning of the curse upon input (update? refresh? Both?)
- (Optional, but not required): Mouse Support (change highlighter based on cursor position, selection, etc)
Mostly the first two... the Scene_* I can work out for myself mostly. Might need help understanding the "setHandlers" if those are required for this window... not sure.
EDIT: Added a "mock-up":
Last edited:

