Add Variables on Main Menu (LUNA)

Halfmoon Media

Illustrator, Eventer, Writer
Veteran
Joined
Aug 17, 2014
Messages
61
Reaction score
9
First Language
English
Primarily Uses
I'm trying to display 3 variables (18, 19, and 20) on the Main Menu, but I can't figure out how to do it. I want the variables to display strings (ex, $game_variables[18] = "Chapter 1"), they don't need icons or anything. I am trying to get them to display in that box on the right (attached picture), but I can't get them to show up at all.


Help?


((ignore the poor drawings - they were just place-holder images while I edited the menu layout))


Code I was using:

class Window_Gold < Window_Base
  def initialize
    super(0, 0, window_width, fitting_height(3))
    refresh
  end
  
  def refresh
    contents.clear
    draw_chapter(4,0,contents.width - 8)
    draw_objective(8,0,contents.width - 8)
    draw_location(12,0,contents.width - 8)
  end
  
  def draw_chapter(x,y,width)
    change_color(system_color)
    draw_text(x,y,width,line_height,"Chapter")
    change_color(normal_color)
    draw_text(x, y, width - 2, line_height, $game_variables[18], 2)
  end
  
  def draw_objective(x,y,width)
    change_color(system_color)
    draw_text(x,y,width,line_height,"Objective")
    change_color(normal_color)
    draw_text(x, y, width - 2, line_height, $game_variables[19], 2)
  end
  
  def draw_location(x,y,width)
    change_color(system_color)
    draw_text(x,y,width,line_height,"Location")
    change_color(normal_color)
    draw_text(x, y, width - 2, line_height, $game_variables[20], 2)
  end
end


Capture.PNG
 

Archeia

Level 99 Demi-fiend
Staff member
Developer
Joined
Mar 1, 2012
Messages
15,168
Reaction score
15,509
First Language
Filipino
Primarily Uses
RMMZ
Have you tried using Lunatic Mode?


We have example snippets there that should allow you to display variables without having to do what you were doing.
 
Last edited by a moderator:

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

Latest Profile Posts

A part of me wants to return back to the beginning and first two chapters and remake them with parallax map. But I have decided not to. Every chapter is just another step in the journey. No need to walk back unless I have to revise dialouge.
Hey guys! Good news!
I just released the Games from Brazil - Part 2 on my Youtube Channel! I am really happy that part 1 had 100 views and I hope more people will be interested to see the potencial of Brazilian Game Devs!
Effervesce Fallacy™ - Attract Mode (proto)

Forum statistics

Threads
107,572
Messages
1,030,647
Members
139,671
Latest member
WDRS
Top