FG7 - Simple PlayTime

Simple PlayTime
By: FamilyGamer7
​
Introduction
This script displays the playtime within a window on the Menu screen. (This window will only display when on the menu screen - Scene_Menu)

Features
An overall playtime window available for the player to see when accessing the menu screen. You have the ability to fine tune the playtime window to your liking at the top of the script.

Screenshot(s)

Script
Spoiler: FG7 - Simple PlayTime
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
Add this script in the script editor under in the "Materials" section and above "Main Process".
The instructions and setup for the script are held within the script header itself. No need to repeat here.

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

Original thread: https://forums.rpgmakerweb.com/threads/fg7-simple-playtime.144515/