Jump to content
SharkerrBlue

SB - Simple Title Screen :3

Recommended Posts

SB - Simple Title Screen

 

This is a simple title screen. Too simple to make. :P

Also, my very first script.  :D

 

Screenshots:

 

 

5UPKMXq.png

 

 

 

Get it at here!

 

Script: [updated]

 

 

#------------------------------------------------------------------------------# 
# Simple Animated Title Screen - SB                                            #
# Author : SharkerrBlue(SB)                                                    #
#------------------------------------------------------------------------------# 
# -Free for any use because this script is too simple :3                       #   
#------------------------------------------------------------------------------#
# -P/S Credit goes to: SharkerrBlue(SB)   No need to pay just credit me!       #
#------------------------------------------------------------------------------#
 
class Scene_Title < Scene_Base
#------------------------------------------------------------------------------#   
    def start
    super
    SceneManager.clear     #Don't change the order please! #
    Graphics.freeze
    create_background
    create_foreground
    font
    create_command_window
    create_fog
    play_title_music
  end
#------------------------------------------------------------------------------#
  module SB_Menu
    NUMBER_OF_PARTICLES = 20
  end  
#------------------------------------------------------------------------------#
  def create_background
    @sprite1 = Plane.new
    @sprite1.bitmap = Cache.system("background")
  end
#------------------------------------------------------------------------------#  
  def create_command_window
    @command_window = Window_TitleCommand.new
    @command_window.set_handler(:new_game, method(:command_new_game))
    @command_window.set_handler(:continue, method(:command_continue))
    @command_window.set_handler(:shutdown, method(:command_shutdown))
    @command_window.opacity=0
    @command_window.x=10
    @command_window.y=200
  end
#------------------------------------------------------------------------------#
  def create_foreground
    @foreground_sprite = Sprite.new
    @foreground_sprite.bitmap = Cache.system("Title")
    @foreground_sprite.y=100
  end
#------------------------------------------------------------------------------#
  def create_fog
    @fog = Plane.new
    @fog.bitmap = Cache.system("fog")
  end  
#------------------------------------------------------------------------------#
  def update
    super
    @fog.ox += 2
    @sprite1.ox += 1
  end
#------------------------------------------------------------------------------#  
  def font
    Font.default_name = ["Letter Gothic Std"] # The font you want.
    Font.default_size = 22 # The Font's Size you want.  
  end
#------------------------------------------------------------------------------# 
  def dispose_background
    @sprite1.bitmap.dispose
    @sprite1.dispose
  end
#------------------------------------------------------------------------------#
  def dispose_fog
    @fog.bitmap.dispose
    @fog.dispose
  end 
end
 

 
Pictures(Graphics/System):
You need:
*background
*Title
*fog
 
e.g:
post-55382-0-70823100-1447940002_thumb.pngpost-55382-0-91496400-1447940010_thumb.pngpost-55382-0-73314100-1447940008_thumb.png
Edited by SharkerrBlue
  • Like 1

Share this post


Link to post
Share on other sites

It's simple, and still fairly visually appealing! I kinda think the images move to quickly but they're easy enough to slow down.

Wicked.

Share this post


Link to post
Share on other sites

You created a memory leak by not disposing the @fog plane in your script.

You need to dispose any new sprites/planes created when the scene changes or else you get a memory leak which will slow down your game or even crash your game in specific cases.

 

I see the title of the project is "Learning Scripting", so I thought this is a good thing to learn, since sprites are used everywhere.

In case you need a good debugger tool for finding any non-disposed sprites/planes, you should check out this script: http://forums.rpgmakerweb.com/index.php?/topic/17400-hidden-gameexe-crash-debugger-graphical-object-global-reference-ace/

 

Nice little script otherwise.

Share this post


Link to post
Share on other sites

You created a memory leak by not disposing the @fog plane in your script.

You need to dispose any new sprites/planes created when the scene changes or else you get a memory leak which will slow down your game or even crash your game in specific cases.

 

I see the title of the project is "Learning Scripting", so I thought this is a good thing to learn, since sprites are used everywhere.

In case you need a good debugger tool for finding any non-disposed sprites/planes, you should check out this script: http://forums.rpgmakerweb.com/index.php?/topic/17400-hidden-gameexe-crash-debugger-graphical-object-global-reference-ace/

 

Nice little script otherwise.

What is memory leak?  :P

And yeah I just start learning scripting.

And now I understand, I just need to dispose the fog. ^_^

Anyway thanks.  :D

Edited by SharkerrBlue

Share this post


Link to post
Share on other sites

Memory leak is basically anything which is stuck in your memory without a way to get rid of it, because it can not be reached to be disposed anymore.

This means your memory will get filled with not used garbage sooner or later, which leads to slowdowns if left untreated.

 

And yeah, you did get it, the fog needs to be disposed. The code you wrote for it is good, but the method it's in is never called, the code in the method is never executed, so the memory leak is still there.

If you run the method you created from the already existing 'dispose_background' method (just above the new method in your script), it will be executed, and the memory leak will be fixed.

Share this post


Link to post
Share on other sites

I also recommend that you learn a bit about Arrays. When you do know how they work, you can actually remove that command window that you use and represent images based on the index of the command window, slapped on the array of images you work at :D

Share this post


Link to post
Share on other sites

You forgot to provide the "Title" pic.

He provided that picture - it is the second one at the end of his post.

Anyway it is just an example picture, you can make one by yourself.

 

Also on a side note: OP will be not accessible until November 12, 2016.

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