Jump to content
Zerbu

Zerbu Engine - Title Screen Window Options

Recommended Posts

Title Screen Window Options

Title1.pngTitle2.png

 

Introduction

This script allows you to set window options specifically for the title screen to customize its appearance.

 

Instructions

Edit the option near the top of the script to set the appearance of the title screen.

 

Script

 

 

#============================================================================
# Zerbu Engine - Title Screen Window Options
#----------------------------------------------------------------------------
# This script allows you to set window options specifically for the title
# screen to customize its appearance.
#============================================================================

#============================================================================
# (module) Title_Screen_Window_Options
#============================================================================
module Title_Screen_Window_Options
 ZE_TSWO = {
   #------------------------------------------------------------------------
   # Options
   #------------------------------------------------------------------------
   # What font should be used on the title screen?
   #------------------------------------------------------------------------
   :FONT_FACE => ["VL Gothic", "Verdana", "Arial", "Courier"],
   #------------------------------------------------------------------------
   # What size should the text be?
   #------------------------------------------------------------------------
   :FONT_SIZE => 24,
   #------------------------------------------------------------------------
   # Should the text on the title screen be bold?
   #------------------------------------------------------------------------
   :FONT_BOLD => false,
   #------------------------------------------------------------------------
   # Should the text on the title screen be italic?
   #------------------------------------------------------------------------
   :FONT_ITALIC => false,
   #------------------------------------------------------------------------
   # Should the text on the title screen have a shadow?
   #------------------------------------------------------------------------
   :FONT_SHADOW => false,
   #------------------------------------------------------------------------
   # Should the text on the title screen have an outline?
   #------------------------------------------------------------------------
   :FONT_OUTLINE => true,
   #------------------------------------------------------------------------
   # What colour should the outline be? The format to use is:
   # [red, green, blue, opacity]
   #------------------------------------------------------------------------
   :FONT_OUT_COL => [0, 0, 0],
   #------------------------------------------------------------------------
   # This is the Windowskin used on the title screen.
   #------------------------------------------------------------------------
   :WINDOWSKIN => "Window",
   #------------------------------------------------------------------------
   # This is the width of the title window. If this is set to 0, the
   # default width will be used.
   #------------------------------------------------------------------------
   :WINDOW_WIDTH => 200,
   #------------------------------------------------------------------------
   # This is the X position of the title window. If this is set to -1, the
   # default position will be used.
   #------------------------------------------------------------------------
   :WINDOW_X => 20,
   #------------------------------------------------------------------------
   # This is the Y position of the title window. If this is set to -1, the
   # default position will be used.
   #------------------------------------------------------------------------
   :WINDOW_Y => 20,
   #------------------------------------------------------------------------
   # This is the opacity of the window.
   #------------------------------------------------------------------------
   :OPACITY => 255,
   #------------------------------------------------------------------------
   # This is the back opacity of the window.
   #------------------------------------------------------------------------
   :BACK_OPACITY => 200,
 }
end

#============================================================================
# Window_TitleCommand
#============================================================================
class Window_TitleCommand < Window_Command
 include Title_Screen_Window_Options

 #--------------------------------------------------------------------------
 # alias method: initialize
 #--------------------------------------------------------------------------
 alias ze_tsto_initialize initialize
 def initialize
   #---
   ze_tsto_initialize
   #---
   self.windowskin = Cache.system(ZE_TSWO[:WINDOWSKIN])
   self.opacity = ZE_TSWO[:OPACITY]
   self.back_opacity = ZE_TSWO[:BACK_OPACITY]
   #---
 end

 #--------------------------------------------------------------------------
 # alias method: window_width
 #--------------------------------------------------------------------------
 alias ze_tswo_window_width window_width
 def window_width
   #---
   if ZE_TSWO[:WINDOW_WIDTH] != 0
     return ZE_TSWO[:WINDOW_WIDTH]
   else
     ze_tswo_window_width
   end
   #---
 end

 #--------------------------------------------------------------------------
 # alias method: draw_item
 #--------------------------------------------------------------------------
 alias ze_tswo_draw_item draw_item
 def draw_item(index)
   #---
   contents.font.name = ZE_TSWO[:FONT_FACE]
   contents.font.size = ZE_TSWO[:FONT_SIZE]
   contents.font.bold = ZE_TSWO[:FONT_BOLD]
   contents.font.italic = ZE_TSWO[:FONT_ITALIC]
   contents.font.shadow = ZE_TSWO[:FONT_SHADOW]
   contents.font.outline = ZE_TSWO[:FONT_OUTLINE]
   contents.font.out_color = Color.new(ZE_TSWO[:FONT_OUT_COL][0], ZE_TSWO[:FONT_OUT_COL][1], ZE_TSWO[:FONT_OUT_COL][2])
   #---
   ze_tswo_draw_item(index)
   #---
 end

 #--------------------------------------------------------------------------
 # overwrite method: update_placement
 #--------------------------------------------------------------------------
 def update_placement
   #---
   if ZE_TSWO[:WINDOW_X] != -1
     self.x = ZE_TSWO[:WINDOW_X]
   else
     self.x = (Graphics.width - width) / 2
   end
   #---
   if ZE_TSWO[:WINDOW_Y] != -1
     self.y = ZE_TSWO[:WINDOW_Y]
   else
     self.y = (Graphics.height * 1.6 - height) / 2
   end
   #---
 end
end

 

 

 

Extras

The Windowskin used in the second example is attached to this thread.

post-2376-0-93209700-1325815109_thumb.png

Edited by Zerbu

Share this post


Link to post
Share on other sites

How do I go about getting the text almost all the way to the left side like in the second screenshot?

 

Edit: Nevermind, I figured it out. Awesome script Zerbu!

Edited by Jaysynn

Share this post


Link to post
Share on other sites

Script 'Cache' line 106: RGSSError occurred.

failed to create bitmap

 

Whenever I use to second image's Windowskin. What should I do?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted