[Request][XP] Version number in Title Screen?

Started by Elyssia, September 02, 2010, 11:15:44 am

Previous topic - Next topic

stripe103

Yea you were right. It was $game_system and $data_system that were not initsiated.
Here is the working code.
PLACEMENT = ([456, 436])
#           || X || Y ||
# Preset to the lower right corner.

# BACKGROUND COLOR
COLOR = ([0, 0, 0, 200])
# (RED, GREEN, BLUE, OPACITY)

# Text to be shown
TEXT = "1.0"

class Window_TitleVersion < Window_Base
  def initialize
    super(PLACEMENT[0], PLACEMENT[1], 200, 60)
    self.contents = Bitmap.new(self.width - 32, self.height - 32)
    self.opacity = 0
    refresh
  end
 
  def refresh
    self.contents.clear
    self.contents.fill_rect(0, 0, self.width, self.height, Color.new(COLOR[0],COLOR[1],COLOR[2],COLOR[3]))
    self.contents.font.size = 28
    self.contents.font.color = text_color(0)
    self.contents.draw_text(0, -20, 168, 68, TEXT, 2)
  end
end

class Scene_Title
  alias :ori_main :main
  def main
    $data_system = load_data("Data/System.rxdata")
    $game_system = Game_System.new
    @window_version = Window_TitleVersion.new
    ori_main
    @window_version.dispose
  end
end

Taiine

Real nice, works very well. I thought of poking it in my game but sadly guess cause using MogHunters 'Animated Title Celia' it don't do a darn thing. Shame, be nice to not have to change it on each image. But meh.

Dweller

I usually work with a project on 3 different computers. This script help me a lot with that project cause sometimes I forget what version is on each computer  :).
Dwellercoc
Spoiler: ShowHide

ForeverZer0

Quote from: Taiine on September 09, 2010, 01:55:16 am
Real nice, works very well. I thought of poking it in my game but sadly guess cause using MogHunters 'Animated Title Celia' it don't do a darn thing. Shame, be nice to not have to change it on each image. But meh.


You don't need to change it on all th images. Just create a new sprite. Not familiar with the script you are talking about with the Title, but in it somewhere you will find where the sprite is created for the background. AFTER that, put something like this:

@version_number = Sprite.new
@version_number.x, @version_number.y = X, Y # You will have to define X and Y
bitmap = Bitmap.new(WIDTH, HEIGHT) # You must define width and height
bitmap.draw_text(0, 0, WIDTH, HEIGHT, "WHATEVER VERSION NUMBER IS", 1)
@version_number.bitmap = bitmap


You are gonna have to add this after the loop as well
@version_number.dispose
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Blizzard

Good values for WIDTH and HEIGHT are 128 and 32.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.