Proper way to make row window from window_selectable.

ougitou1

Invisible Black
Veteran
Joined
Dec 9, 2015
Messages
109
Reaction score
10
First Language
en-
Primarily Uses
N/A
<Hi guys, first here... um i was wondering if anyone knows of a way to properly make a row window using window_selectable. I've tried and succeeded but im getting weird errors and i'd like to know why. I figured that the errors must mean i've done it wrong, hence me asking. So if there is anyone who know knows anything on the matter pls, id appreciate any help.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,639
First Language
Czech
Primarily Uses
RMMV
What do you mean by a row window? A window that, instead of having one column and multiple rows, has one row and multiple column? In other words horizontal window? If that's the case, then it is easy.
Code:
function Window_Row ()  {
this.initialize.apply(this, arguments);
};

Window_Row.prototype = Object.create(Window_Selectable.prototype);
Window_Row.prototype.constructor = Window_Row;

Window_Row.prototype.initialize = function (x,y,width.height) {
Window_Selectable.prototype.initialize.call(this, x, y, width, height);
};

Window_Row.prototype.maxRows = function () {
return 1;
};

Window_Row.prototype.maxCols = function () {
return whatever amount of items visible on screen you need.
};
 

ougitou1

Invisible Black
Veteran
Joined
Dec 9, 2015
Messages
109
Reaction score
10
First Language
en-
Primarily Uses
N/A
What do you mean by a row window? A window that, instead of having one column and multiple rows, has one row and multiple column? In other words horizontal window? If that's the case, then it is easy.
Code:
function Window_Row ()  {
this.initialize.apply(this, arguments);
};

Window_Row.prototype = Object.create(Window_Selectable.prototype);
Window_Row.prototype.constructor = Window_Row;

Window_Row.prototype.initialize = function (x,y,width.height) {
Window_Selectable.prototype.initialize.call(this, x, y, width, height);
};

Window_Row.prototype.maxRows = function () {
return 1;
};

Window_Row.prototype.maxCols = function () {
return whatever amount of items visible on screen you need.
};
thanks a bunch. :kaocry:
 

ougitou1

Invisible Black
Veteran
Joined
Dec 9, 2015
Messages
109
Reaction score
10
First Language
en-
Primarily Uses
N/A
ok next question, how do you draw a character in such a window?
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,639
First Language
Czech
Primarily Uses
RMMV
Window_SavefileList.prototype.drawItem fires a function that draws a character, among other things.
 

ougitou1

Invisible Black
Veteran
Joined
Dec 9, 2015
Messages
109
Reaction score
10
First Language
en-
Primarily Uses
N/A
can it only be done from the window_savefilelist ?
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,639
First Language
Czech
Primarily Uses
RMMV
Of course not. It can be used in any window. But savefilelist does it, so you can find inspiration there. How much do you know about object oriented programming btw?
 

ougitou1

Invisible Black
Veteran
Joined
Dec 9, 2015
Messages
109
Reaction score
10
First Language
en-
Primarily Uses
N/A
not much really, but i do understand the structure of rmmv's main code and how to manipulate it. It just that i created a custom save_file window using a window by doing this,

Window_SavefileList.prototype.maxCols = function() {
return 3;
};

Window_SavefileList.prototype.maxItems = function() {
return 3; //DataManager.maxSavefiles();
};

Window_SavefileList.prototype.maxVisibleItems = function() {
return _max_save_slots; //5;
};

Window_SavefileList.prototype.itemHeight = function() {
var innerHeight = this.height - this.padding * 2;
return Graphics.boxHeight / 4 + 150; //Math.floor(innerHeight / this.maxVisibleItems());
};

but i keep getting an error where characters i draw are not shown. but when i close and reopen the menu they show up in the top right corner.
which is highly annoying. And i need to get pass this as ive been stuck on it for a while now. :kaocry:
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,639
First Language
Czech
Primarily Uses
RMMV
Well, from what you've shown I can't be any wiser. Because 1. I don't see the whole code, 2. I don't see your console (f8) reports if there are errors and 3. I don't know what _max_save_slots is and where it is defined.
 

ougitou1

Invisible Black
Veteran
Joined
Dec 9, 2015
Messages
109
Reaction score
10
First Language
en-
Primarily Uses
N/A
ok the code is extremely cluttered and unorganized i usually do that after im done so basically its unreadable for anyone else sorry also there are no reported errors in the console. which is why i thought i did something wrong in building the window leading to my current problem. :kaosigh: have you ever experienced such an error btdubs?
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,639
First Language
Czech
Primarily Uses
RMMV
No, never had this error. But even if I did experience such an error, there are a myriad of different possible reasons why certain thing is happening.
 

ougitou1

Invisible Black
Veteran
Joined
Dec 9, 2015
Messages
109
Reaction score
10
First Language
en-
Primarily Uses
N/A
No, never had this error. But even if I did experience such an error, there are a myriad of different possible reasons why certain thing is happening.
Ok thanks for your help. Ill try drawing the character in another window then placing it where i need it. not sure if it will work. then as a last resort ill recreate the window from bottm up.
 

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