じ☆ve冰风 发表于 2026-8-2 19:22:30

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)               
Click to expand...


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.               
Click to expand...


Screenshot(s)



Click to expand...


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.               
Click to expand...


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               
Click to expand...




本贴来自国际rpgmaker官方论坛作者:FG7处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/fg7-simple-playtime.144515/
页: [1]
查看完整版本: FG7 - Simple PlayTime