Question about displaying variables in a window

rpgmaker20221

Veteran
Veteran
Joined
Feb 25, 2014
Messages
83
Reaction score
32
First Language
Swedish
Primarily Uses
Hi! I am trying to get variables to display their values in a custom window. I can't get it to work, does anyone have any ideas what is a wrong?
 


EDIT: look at line 28. That is the one I need help with.


help variables.png
 
Last edited by a moderator:

Zalerinian

Jack of all Errors
Veteran
Joined
Dec 17, 2012
Messages
4,695
Reaction score
928
First Language
English
Primarily Uses
N/A
No, I have no idea what's wrong, because you don't show me what it does. I can guess what it's supposed to look like, though.


Do you ever call refresh on the window so that is actually draws? You can easily find out by putting  


console.log("Hello!")


into the function and then seeing if "Hello!" is ever printed to the console when the window is open.


Also, can I ask why you're attempting to drawn nothing on line 29? I don't get it, what's the point of drawing nothing? That'll just waste a little bit of performance.


EDIT: Also, while this probably isn't why it's not working, why are you drawing all the text at the same point? That probably isn't going to go over well once it actually starts drawing things.
 
Last edited by a moderator:

rpgmaker20221

Veteran
Veteran
Joined
Feb 25, 2014
Messages
83
Reaction score
32
First Language
Swedish
Primarily Uses
My window is a custom window on the in game menu.


It is drawing all lines except line 28.


I was wondering if you must use another function to draw variables's value.


Like in rpg vx ace you used to write it like " drawtext ($game_variables[8])


Line 29 is blank because I was editing what were supposed to be there (it is irrelevant though as it have nothing to do with the question i am asking)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,163
Reaction score
12,436
First Language
English
Primarily Uses
RMMV
Have you confirmed that variable 8 actually has something in it?


You're drawing it at exactly the same position as the last line.  What if you change the x or y values so they're not overlapping?


drawText is also an MV function, that takes more arguments.  The difference between the two is that drawTextEx allows you to use escape codes, while drawText doesn't.
 
Last edited by a moderator:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
21,868
Reaction score
11,081
First Language
English
Primarily Uses
RMVXA
I've moved this thread to Javascript/Plugin Support. Please be sure to post your threads in the correct forum next time. Thank you.
 

rpgmaker20221

Veteran
Veteran
Joined
Feb 25, 2014
Messages
83
Reaction score
32
First Language
Swedish
Primarily Uses
Have you confirmed that variable 8 actually has something in it?


You're drawing it at exactly the same position as the last line.  What if you change the x or y values so they're not overlapping?


drawText is also an MV function, that takes more arguments.  The difference between the two is that drawTextEx allows you to use escape codes, while drawText doesn't.
Variables only seem to work with the drawText method. 

It is working now though thanks :)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,163
Reaction score
12,436
First Language
English
Primarily Uses
RMMV
Variables only seem to work with the drawText method. 


Yes, because variables use escape codes.  As I said, one method processes escape codes, the other doesn't.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Are there any vocalists on RPG Maker Forums that would want to sing together in a group, duet or make a whole channel together?
Here it is in all its leggy glory! I apologize in advance.
Suggestion for the name for the new RM, RPG Maker Re-MV (Re-Mastered Version)
A guide on Furry Potatoes.

Forum statistics

Threads
98,175
Messages
950,087
Members
129,473
Latest member
Soulbanana
Top