skrypt godziny
Aktualny czas: 28-04-26, 19:43 Witaj! Przejdź do zakładki Logowanie lub Rejestracja


Wątek zamknięty 
[VX] skrypt godziny
szevaa Offline
*


Liczba postów: 24
Dołączył: 28-11-13

Pomógł: 3



Post: #1
skrypt godziny

Hej!

Na innym forum znalazłem taki skrypt godziny i kroki chciałem go oddzieli i da tylko godzinę ale mi nie wyszło jak by stok go oddzielił to bym był wdzięczny a jeszcze jakby dal go wyżej (tam gdzie kroki) to już w ogolę wielki podziw

z góry dziękuje wam za pomoc :)

===
#------------------------------------------------------------------------------
# Author : Modern-Day-Pirate
#   How to use:
#               Just place above main
#------------------------------------------------------------------------------

#==============================================================================
# ** Window_PlayTime
#------------------------------------------------------------------------------
#  This window displays play time on the menu screen.
#==============================================================================

class Window_PlayTime < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(x, y)
    super(x, y, 160, 80)
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(-18, -10, self.width-40, 32, "Play Time",1)
    @total_sec = Graphics.frame_count / Graphics.frame_rate
    hour = @total_sec / 60 / 60
    min = @total_sec / 60 % 60
    sec = @total_sec % 60
    text = sprintf("%02d:%02d:%02d", hour, min, sec)
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 20, 120, 36, text, 2)
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    if Graphics.frame_count / Graphics.frame_rate != @total_sec
      refresh
    end
  end
end
#==============================================================================
# ** Window_Steps
#------------------------------------------------------------------------------
#  This window displays step count on the menu screen.
#==============================================================================

class Window_Steps < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(x, y)
    super(x, y, 160, 80)
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(0, -10, self.width-40, 32, "Step Count")
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 20, 120, 32, $game_party.steps.to_s, 2)
  end
end
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  This class performs the menu screen processing.
#==============================================================================

class Scene_Menu < Scene_Base
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias pirate_playtime_start start
  alias pirate_playtime_terminate terminate
  alias pirate_playtime_update update
  #--------------------------------------------------------------------------
  # * Start processing
  #--------------------------------------------------------------------------
  def start
    # The usual
    pirate_playtime_start
    # Create @play_window
    @play_window = Window_PlayTime.new(@gold_window.x, @gold_window.y - 80)
    # Create @steps_window
    @steps_window = Window_Steps.new(@gold_window.x, @gold_window.y - 160)
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate
    # The usual
    pirate_playtime_terminate
    # Dispose @play_window
    @play_window.dispose
    # Dispose @steps_window
    @steps_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # The usual
    pirate_playtime_update
    # Update @play_window
    @play_window.update
    # Update @steps_window
    @steps_window.update
  end
end
===
28-11-13 16:27
Znajdź wszystkie posty użytkownika
"Pomógł" przyznał(a):
Ayene Offline
*


Liczba postów: 758
Dołączył: 09-04-13

Pomógł: 112



Post: #2
RE: skrypt godziny

Łapaj:
#------------------------------------------------------------------------------
# Author : Modern-Day-Pirate
#   How to use:
#               Just place above main
#------------------------------------------------------------------------------

#==============================================================================
# ** Window_PlayTime
#------------------------------------------------------------------------------
#  This window displays play time on the menu screen.
#==============================================================================

class Window_PlayTime < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(x, y)
    super(x, y, 160, 80)
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(-18, -10, self.width-40, 32, "Play Time",1)
    @total_sec = Graphics.frame_count / Graphics.frame_rate
    hour = @total_sec / 60 / 60
    min = @total_sec / 60 % 60
    sec = @total_sec % 60
    text = sprintf("%02d:%02d:%02d", hour, min, sec)
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 20, 120, 36, text, 2)
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    if Graphics.frame_count / Graphics.frame_rate != @total_sec
      refresh
    end
  end
end
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  This class performs the menu screen processing.
#==============================================================================

class Scene_Menu < Scene_Base
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias pirate_playtime_start start
  alias pirate_playtime_terminate terminate
  alias pirate_playtime_update update
  #--------------------------------------------------------------------------
  # * Start processing
  #--------------------------------------------------------------------------
  def start
    # The usual
    pirate_playtime_start
    # Create @play_window
    @play_window = Window_PlayTime.new(@command_window.x, @command_window.y + @command_window.height)
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate
    # The usual
    pirate_playtime_terminate
    # Dispose @play_window
    @play_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # The usual
    pirate_playtime_update
    # Update @play_window
    @play_window.update
  end
end

[Obrazek: aye_furniture_pres.png]
28-11-13 19:02
Znajdź wszystkie posty użytkownika
"Pomógł" przyznał(a): szevaa
Wątek zamknięty 


Skocz do:


Użytkownicy przeglądający ten wątek: 1 gości

Kontakt | Ultima Forum | Wróć do góry | Wróć do forów | Wersja bez grafiki | RSS
Powered By MyBB. © 2013 MyBB Group. All Rights Reserved.
Skórka by Ayene.