Simple PlayTime
By: FamilyGamer7
IntroductionBy: FamilyGamer7
Features
Screenshot(s)
Script
Ruby:
#==============================================================================
# Title: Simple PlayTime
# Author: FamilyGamer7 (FG7)
# Version: 1.0
# Engine: RPG Maker VX Ace
#==============================================================================
# ** Change Log |
# ---------------
# 1.0 => Created Script
#==============================================================================
# ** Description |
# ----------------
# This script displays the playtime within a window on the Menu screen.
# (This window will only display when on the menu screen - Scene_Menu)
#==============================================================================
# ** Terms of Use |
# -----------------
# * Free to use in non-commercial projects and commercial projects
# * Feel free to modify and improve the script. Credit is still required.
# * Credit FamilyGamer7
#==============================================================================
# ** Usage |
# ----------
# * Plug & Play (See Module area to fine tune the playtime window)
#==============================================================================
#==============================================================================
# ** Module: FG7::Simple_PlayTime
#------------------------------------------------------------------------------
# This modules creates a static variable to be used within the script.
#==============================================================================
module FG7
module Simple_PlayTime
#==============================================================================
# -------------------- ALLOWED TO EDIT BELOW THIS LINE ---------------------- #
#==============================================================================
# Sets the "X" horizontal location on the screen
X_Horizontal = 0
# Sets the "Y" vertical location on the screen
Y_Vertical = 192
# Sets the "Width" of the window on the screen
Width = 160
# Sets the "Height" of the window on the screen
Height = 48
#==============================================================================
# ---------- DO NOT EDIT BELOW THIS LINE (FOR ADVANCED USERS) --------------- #
#==============================================================================
end
end
#==============================================================================
# ** Window_PlayTime
#------------------------------------------------------------------------------
# Display Game Time - Active Count Timer
#==============================================================================
class Window_PlayTime < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(x, y, width, height)
super
refresh
end
#--------------------------------------------------------------------------
# * Refresh - For the Game Timer
#--------------------------------------------------------------------------
def refresh
self.contents.clear
# Draws the playtime (numbers) on the window
draw_text_ex(28, 0, $game_system.playtime_s)
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
def update
refresh
end
end
#==============================================================================
# ** Scene_Base
#------------------------------------------------------------------------------
# This is a super class of all scenes within the game.
#==============================================================================
class Scene_Base
#--------------------------------------------------------------------------
# * Alias Method: Start Processing
#--------------------------------------------------------------------------
alias :fg7_simple_playtime_window_start :start
def start
fg7_simple_playtime_window_start
create_playtime_window
end
#--------------------------------------------------------------------------
# * Added/New Window: Create Playtime Window
#--------------------------------------------------------------------------
def create_playtime_window
# Sets the module variable into static variables to read easier
x = FG7::Simple_PlayTime::X_Horizontal
y = FG7::Simple_PlayTime::Y_Vertical
width = FG7::Simple_PlayTime::Width
height = FG7::Simple_PlayTime::Height
# Creates the playtime window (Will only show on the Scene_Menu)
@playtime_window = Window_PlayTime.new(x, y, width, height)
if SceneManager.scene_is?(Scene_Menu)
@playtime_window.show
else
@playtime_window.hide
end
end
end
How to Use
Terms of Use