Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> Pre Title Splash Screen, or, what have I done wrong?
rabidmoogle
post Dec 9 2012, 04:01 PM
Post #1



Group Icon

Group: Member
Posts: 2
Type: Writer
RM Skill: Undisclosed




Hello!

I tried to make a script that puts a splash screen before the title screen, and it works, except for one little detail. I can't seem to get it to skip to the title screen by pressing the specified button (C in this case) confused.gif . Some help would be appreciated.

Here is the script
CODE
class Scene_Splash < Scene_Base

  def start
    super
    SceneManager.clear
    Graphics.freeze
    create_background
  end
  
  def create_background
    @sprite = Sprite.new
    @sprite.bitmap = Cache.picture("Untitled")
  end
  
  def update
    if Input.press?(:C)
      Graphics.fadeout(20)
      SceneManager.call(Scene_Title)
    else
      Graphics.wait(320)
      Graphics.fadeout(20)
      SceneManager.call(Scene_Title)
    end
  end
  
  def dispose_background
    @sprite.bitmap.dispose
    @sprite.dispose
  end
end

module SceneManager
  def self.first_scene_class
    $BTEST ? Scene_Battle : Scene_Splash
  end
end
Go to the top of the page
 
+Quote Post
   
 
Start new topic
Replies
Thallion
post Dec 9 2012, 04:19 PM
Post #2


Level 5
Group Icon

Group: Member
Posts: 68
Type: Scripter
RM Skill: Skilled
Rev Points: 10




Try this:
CODE
class Scene_Splash < Scene_Base

  def start
    super
    SceneManager.clear
    Graphics.freeze
    create_background
    @frames = 0
  end
  
  def create_background
    @sprite = Sprite.new
    @sprite.bitmap = Cache.picture("Untitled")
  end
  
  def update
    if Input.press?(:C) or @frames > 320
      Graphics.fadeout(20)
      SceneManager.call(Scene_Title)
    end
    @frames += 1
  end
  
  def dispose_background
    @sprite.bitmap.dispose
    @sprite.dispose
  end
end

module SceneManager
  def self.first_scene_class
    $BTEST ? Scene_Battle : Scene_Splash
  end
end


What you were doing was starting the scene, then every time the scene updated checking if the C button was pressed. If it was, you would skip the splash screen and go to Scene_Title. Else, you would wait 320 frames and then go to Scene_Title. What I did was increment a variable every frame and if the C button was pressed or the variable was greater that 320 it would go to Scene_Title.
Go to the top of the page
 
+Quote Post
   



Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 25th May 2013 - 10:42 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker