Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> Very Simple Question, I'm a script newb, just need a little help.
superafroboy
post Oct 15 2011, 07:12 AM
Post #1


Level 3
Group Icon

Group: Member
Posts: 39
Type: None
RM Skill: Skilled




Hey guys, I have next to no knowledge of scripting, and just wanted to make a quick little script that displays the current date after my hero rests / checks the calendar.

I have everything set up, but I don't know how to display the window only for a few seconds, and then remove it.

Currently it just displays for a short time and then is removed on its own (I assume after something is refreshed or whatever?)

Here is my pathetic little script, I assume there is something I could just throw in at the end to dispose the window after x frames or something?

CODE
class Calendar < Window_Base
  def initialize
    super(0, 0, 200, 120)
    self.contents = Bitmap.new(width - 32, height - 32)

    date = $game_variables[4]
    year = $game_variables[9]
    
    if $game_variables[18] == 1
      weekday = "Monday"
    elsif $game_variables[18] == 2
      weekday = "Tuesday"
    elsif $game_variables[18] == 3
      weekday = "Wednesday"
    elsif $game_variables[18] == 4
      weekday = "Thursday"
    elsif $game_variables[18] == 5
      weekday = "Friday"
    elsif $game_variables[18] == 6
      weekday = "Holiday"
    else
      weekday = "Nil"
    end    


   self.contents.font.size = 20
   self.contents.draw_text(0, 0, 200, 32, "Today's Date is:")
   self.contents.draw_text(0, 20, 200, 32, weekday)
   self.contents.draw_text(0, 40, 30, 32, "Day")
   self.contents.draw_text(35, 40, 25, 32, date.to_s)
   self.contents.draw_text(0, 60, 40, 32, "Year")
   self.contents.draw_text(45, 60, 25, 32, year.to_s)
  
  end

end



Any help would be much appreciated.

This post has been edited by superafroboy: Oct 15 2011, 07:14 AM


__________________________
Go to the top of the page
 
+Quote Post
   
 
Start new topic
Replies
superafroboy
post Oct 15 2011, 08:35 AM
Post #2


Level 3
Group Icon

Group: Member
Posts: 39
Type: None
RM Skill: Skilled




Works perfectly, thank you very much!


__________________________
Go to the top of the page
 
+Quote Post
   

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 24th May 2013 - 02:08 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker