Text Bar

Death10

;D
Member
Joined
Jul 18, 2012
Messages
29
Reaction score
5
First Language
Vietnamese
Primarily Uses
Text Bar




Author: Death10




Introduction




Running text




Script




*Call script:




-On: $game_system.ads_option = 1




-Off: $game_system.ads_option = 2




-Change:




+Text: $game_system.ads_x = "Text"




+Background: $game_system.ads_back = "Back.png"


Code:
#==============================================================================
# ** Text Bar
#==============================================================================
# Author: Death10
# http://gamesvts.com
# http://taotrochoi.com
#==============================================================================
# *Call script:
# -On: $game_system.ads_option = 1
# -Off: $game_system.ads_option = 2
# -Change:
# +Text: $game_system.ads_x = "Text"
# +Background: $game_system.ads_back = "Back.png"
#==============================================================================

$game_system = Game_System.new #DataManager.load_normal_database

module Cache
def self.load_bitmap2(file, hue = 0)
	@cache ||= {}
	if file.empty?
	 empty_bitmap
	elsif hue == 0
	 normal_bitmap(file)
	else
	 hue_changed_bitmap(file, hue)
	end
end
end

class Game_System
attr_accessor :ads
attr_accessor :ads_on
attr_accessor :ads_x
attr_accessor :ads_option
attr_accessor :ads_back
alias initialize_ads initialize
def initialize
	initialize_ads
	@ads = "Text Bar"
	@ads_back = "Graphics/Titles1/#{$data_system.title1_name}"
	@ads_option = 1
	@ads_on = 1
	@ads_x = 0
end
end
class TB < Window_Base
def initialize
	super(0, 0, 544, 64)
	self.opacity = 0
	#$game_system = Game_System.new
	check
	refresh
end
def check
	case $game_system.ads_option
	when 1
	$game_system.ads_on = 1
	$game_system.ads_x = -contents.text_size($game_system.ads).width
	$game_system.ads_option = 0
	when 2
	$game_system.ads_on = 0
	$game_system.ads_option = 0
end
end
def refresh
	check
	contents.clear
	cx = contents.text_size($game_system.ads).width
	if $game_system.ads_x == -cx
	$game_system.ads_x = 544
	else
	$game_system.ads_x -= 0.5
	end
	if $game_system.ads_on == 1
	contents.blt(0, 0, Cache.load_bitmap2($game_system.ads_back), Rect.new(0, 0, 544, 32), 160)
	contents.draw_text($game_system.ads_x, 0, cx, 32, $game_system.ads, 2)
	end
end
def open
	super
	refresh
end
end

class Scene_Map < Scene_Base
alias caw create_all_windows
def create_all_windows
	caw
	@ads = TB.new
end
alias update_ads update
def update
	update_ads
	@ads.open
end
alias utp update_transfer_player
def update_transfer_player
	utp
	case $game_system.ads_on
	when 0
	@map_name_window.y = 0
	when 1
	@map_name_window.y = 44
	end
end
end

Screenshot




 

Camupins

Villager
Member
Joined
Mar 31, 2012
Messages
17
Reaction score
0
First Language
English
Primarily Uses
I actually love this! I can use this for updates and such. Good job~!
 

rawr.chuckc

Warper
Member
Joined
Jun 8, 2013
Messages
1
Reaction score
0
First Language
English
Primarily Uses
Error found...

Script 'Text Bar' line 73: NoMethodOccured

undefined methods `-'  for nil:NilClass

Help Please?
 

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
Your screenshot isn't working by the way. Might want to re-upload it somewhere. Well then again this is from 2012, lol.
 
Last edited by a moderator:

Silent Darkness

Robomage
Veteran
Joined
Nov 28, 2013
Messages
2,283
Reaction score
324
First Language
English
Needs a reupload. Also, this doesn't come with a back.png, so it's not useful unless you provide your own thing...
 

Latest Threads

Latest Posts

Latest Profile Posts

First steps on an interior castle map
The self-righteous indignation of family when you expect them to pay back money you've leant to them never ceases to amaze me.
Gamedev for relaxing? yes or no?
I've been having a rough couple of months and as such let down some friends of mine in the RPG Maker community. I still need time to get back to my normal self, but it's nice to be back, to read articles, and to design again (albeit at a slow pace). Hope to give updates on Kid Crescent soon.
Friendly reminder that you don't have to be able to do absolutely everything. It's okay to scale back features or assets if things are too much - especially if you're the only one working on the game! And you can always add things in later. <3

Forum statistics

Threads
107,735
Messages
1,031,740
Members
139,870
Latest member
Berserk94
Top