Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Generic Credits Script

Alright while scripting I found an easy way to make a cool looking Credits Script that looks like it's part of the title graphic. Look at in in action...

creditsscriptth7.png

Script ~

[rgss] 
#===============================================================================
# * Credits Menu
#-------------------------------------------------------------------------------
# A credits menu that scrolls up the Title Screen. Useful for a professional
# looking game.
#===============================================================================
class Window_Scroll < Window_Base
  attr_accessor :credits
  def initialize
    super(0,0,640,480)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.opacity = 0
    self.back_opacity = 0
    initcredit
    refresh
  end
  def initcredit
    #PUT Credits HERE
    @credits = Hash.new("")
    @credits[0] = "~Script by:"
    @credits[1] = "SASUKE89"
  end
  def refresh
    self.contents.clear
    self.contents.font.color = Color.new(38,38,38)
    self.contents.font.size = 12
    self.contents.font.name = 'PT Taj Mahal'
    for i in 0...@credits.size
      self.contents.draw_text(0, 0, 480, (i * 32) + 32, @credits.to_s)
    end
  end
end
class Scene_Title
  alias s89main main
  alias s89update update
  def main
    s89main
    @scroll_window.dispose
  end
  def update
    @scroll_window.update
    s89update
  end
end
 
[/rgss]


Instructions ~

Error says "undefined method `update' for nil:NilClass"":24as5vq4 said:
To fix this error go to the original Scene_Title and add this after line 43 :"@scroll_window = Window_Scroll.new"
To add credits to the script all you have to do is find the part of the script that says:

Code:
 

#PUT Credits HERE

@credits = Hash.new("")

@credits[0] = "~Script by:"

@credits[1] = "SASUKE89"

 

After :"@credits[1] = "SASUKE89"" add a new line and insert :"@credits[Following #] = "Credits Name"". Where "Following #" is put the number that follows the credit number thats on the line before the line you are on.
Does that current font clash with your title graphic? Here's your tutorial on how to fix that.
Changing Font Size":24as5vq4 said:
To change the font size find the following line :"self.contents.font.size =" and change the number that follows.
self.contents.font.color = Color.new(38,38,38)
self.contents.font.size = 12
self.contents.font.name = 'PT Taj Mahal'
Changing Font Color":24as5vq4 said:
To change the font color find the following line :"self.contents.font.color = Color.new" and change the three numbers that follow. To find a new color go in Paint or any other photo editing software and copy the Red Green and Blue values and put them in the script.
Changing Font":24as5vq4 said:
To change the font find the following line :"self.contents.font.name = " and change the name of the font that follows
 
this script doesn't seem to do anything.... I want to get it working first, but then i'm gonna have it run in my Scene_Gameover...

does anyone know how to get the credits to actually show?

Never mind, the default font color was the same as my background, i feel like an idiot.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top