Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Menu Font Changer Vx, Changes all font fast and easy!
THOMAS1
post Feb 8 2010, 02:24 AM
Post #1


Level 153 Hunter Pso 1&2
Group Icon

Group: Revolutionary
Posts: 183
Type: Event Designer
RM Skill: Advanced




This script is pretty easy to use, now first off the script must be placed under Materials like most other scripts.
Take note that a example font name is being used so please change the font name in the script before using or
it will not work and will pop up an error. After changing the font name to what ever font you have installed on your
PC 'Arial' being default, the script will change all fonts menu and message windows to the selected font. happy.gif

This script has compatibility with "NMS - Neo Message System". When used with the NMS, this
script will only change menu fronts letting you have duel fonts with no error. Just be sure to have NMS above this
script on your script list. NMS 3.0 was used, but 2.0 should work with no compatibility issues.

[Show/Hide] Screenshot of changed font!



=begin
~Menu Font Changer~
*Credit to Thomas1*

No credit needed for any use of this script, but if you want to go for it.
=end

module Menu_Config

# Change 'Knights Quest' below to 'Arial' for a default font.
# Anything else you enter in must be a font you have installed.
# This font will affect your main and battle menus and even message windows.
DEFAULT_FONT = 'Knights Quest'

# Set this to true to enable the font above for all windows,
# also sets the back_opacity to 255 for all windows and
# I recommend setting this to 'true' to maintain a consistent look.
USE_FOR_ALL = true

end

if Menu_Config::USE_FOR_ALL

Font.default_name = Menu_Config::DEFAULT_FONT

class Window_Base < Window

alias :eds_pre_menu_base_initialize :initialize
def initialize(*fats)
eds_pre_menu_base_initialize(*fats)

end

end

end

class Window_Base < Window

CAPTION_COLOR = Color.new(255,255,255)#(228, 228, 228)
CAPTION_HEIGHT = 12
X_OFFSET = 16
Y_OFFSET = -5

alias :eds_pre_window_caption_intialize :initialize
def initialize(*fats)
eds_pre_window_caption_intialize(*fats)
@caption_sprite = Sprite_Base.new(self.viewport)
create_caption_bitmap(1, CAPTION_HEIGHT)
@caption_sprite.x = self.x + X_OFFSET
@caption_sprite.y = self.y + Y_OFFSET
@caption_sprite.z = self.z + 1
end

def x=(value)
super
@caption_sprite.x = value + X_OFFSET unless @caption_sprite.nil?
end

def y=(value)
super
@caption_sprite.y = value + Y_OFFSET unless @caption_sprite.nil?
end

def z=(value)
super
@caption_sprite.z = value + 1 unless @caption_sprite.nil?
end

def caption=(text)
return unless text.is_a?(String)
return if text.empty?
@caption = text
width = @caption_sprite.bitmap.text_size(@caption).width
create_caption_bitmap(width, CAPTION_HEIGHT)
draw_caption
end

def create_caption_bitmap(w, h)
@caption_sprite.bitmap = Bitmap.new(w, h)
@caption_sprite.bitmap.font.size = 12
@caption_sprite.bitmap.font.color = CAPTION_COLOR
@caption_sprite.bitmap.font.bold = true
end

def draw_caption
unless @caption.nil?
h = @caption_sprite.bitmap.height
w = @caption_sprite.bitmap.width
rect = Rect.new( 0, h / 2, w, h / 4 )
@caption_sprite.bitmap.fill_rect(rect, Color.new(0, 0, 0, 96))
@caption_sprite.bitmap.draw_text(@caption_sprite.src_rect, @caption)
end
end

alias :eds_pre_caption_window_dispose :dispose
def dispose
eds_pre_caption_window_dispose
@caption_sprite.dispose
end

def find_window_width(text)
return Bitmap.new(544, 416).text_size(text).width + 32
end

end
Go to the top of the page
 
+Quote Post
   
Night5h4d3
post Feb 8 2010, 06:43 AM
Post #2


The past tense
Group Icon

Group: +Gold Member
Posts: 1,199
Type: Scripter
RM Skill: Undisclosed




tsk tsk tsk. This is a VERY roundabout way to change a font because RMVX already has a built-in font class.. in fact, your script even makes use of it. Instead of having a whole script to change the font, people can just call script with this code:

Font.default_name = "<font name here>"


__________________________
Got 30 minutes? Then you've enough time to play this awesome game:

- potentially promising project page
- thanks holder
My growing space of user-bars:

about me:







I made the following!





Go to the top of the page
 
+Quote Post
   
THOMAS1
post Feb 8 2010, 12:50 PM
Post #3


Level 153 Hunter Pso 1&2
Group Icon

Group: Revolutionary
Posts: 183
Type: Event Designer
RM Skill: Advanced




Yes, but not all noobs know how to do that. I set this up so if someone is starting out, they can have this script
and change the font and size of font with easy.
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: 19th May 2013 - 12:21 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker