Question about displaying variables in a window

Discussion in 'Javascript/Plugin Support' started by rpgmaker20221, Dec 16, 2016.

  1. rpgmaker20221

    rpgmaker20221 Veteran Veteran

    Messages:
    83
    Likes Received:
    32
    First Language:
    Swedish
    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: Dec 16, 2016
    #1
  2. Zalerinian

    Zalerinian Jack of all Errors Veteran

    Messages:
    4,691
    Likes Received:
    918
    Location:
    The Internet.
    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: Dec 16, 2016
    #2
  3. rpgmaker20221

    rpgmaker20221 Veteran Veteran

    Messages:
    83
    Likes Received:
    32
    First Language:
    Swedish
    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)
     
    #3
  4. Shaz

    Shaz Veteran Veteran

    Messages:
    36,911
    Likes Received:
    10,849
    Location:
    Australia
    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: Dec 16, 2016
    #4
  5. Kes

    Kes Global Moderators Global Mod

    Messages:
    19,154
    Likes Received:
    9,820
    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.
     
    #5
  6. rpgmaker20221

    rpgmaker20221 Veteran Veteran

    Messages:
    83
    Likes Received:
    32
    First Language:
    Swedish
    Variables only seem to work with the drawText method. 

    It is working now though thanks :)
     
    #6
  7. Shaz

    Shaz Veteran Veteran

    Messages:
    36,911
    Likes Received:
    10,849
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV


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

    rpgmaker20221 Veteran Veteran

    Messages:
    83
    Likes Received:
    32
    First Language:
    Swedish
    Oh I didn't know that. Thank you :)
     
    #8

Share This Page