-
1. Тень под буквами в сообщениях можно сделать c помощью указанного скрипта UMS (смотри хелп).
2. Шрифт во всей игре можно изменить правкой одной строки в cкрипте Main (он самый нижний в списке скриптов):
Font.default_name = 'your font name' -тут надо укзать имя файла шрифта, а не его название.
Ещё его можно изменить в скрипте Window_Base:
class Window_Base < Window
def initialize(x, y, width, height)
....
self.contents.font.name = 'your font name'
....
(чтобы найти нужную строку используй функцию поиска Ctrl+F).
3. Чтобы у пользователей отображался именно твой шрифт, нужно файл шрифта размещать в папку с игрой и указывать о необходимости его установки в каком-нибудь Readme.txt. Можно использовать и специальный скрипт-установщик шрифта, типа вот этого.
UPD: 4. Также я рекомендую тебе скачать из нашего Файлового архива третий номер Сороки - там есть отличные статьи Налии по UMS.
-
Спасибо! Почитал статью, нашёл русский перевод UMS, многое прояснилось! Только остаётся загадкой - как же сделать во всей игре шрифт толстым и с тенями? Получается, что нужно какой-то свой скрипт туда вписать?
-
"Во всей игре" - т.е. в меню тоже? А после выполнения пункта 2 моего прошлого сообщения он (шрифт) разве там (в меню) не изменяется? Ну и в меню шрифт с тенями не получиться. Это надо специальноый шрифт с тенями тогда искать.
-
Вот-вот, я имею в виду и в меню, и в боёвке, и на стартовом экране тоже.
-
Так, шрифта с тенями не существует, поэтому - только картинками. Но я бы реомендовал не заморачиваться на проблеме со шрифтами, а делать саму игру.
-
После изменения в Window_Base шрифт поменяется во всей игре(и в меню тоже). А вот с тенями посложнее.
вот метод
PHP код:
class Bitmap
def sh_draw_text(x,y,w,h,text,a = 0)
temp = font.color.clone
font.color = Color.new(0,0,0)
draw_text(x+1,y+1,w,h,text,a)
font.color = temp
draw_text(x,y,w,h,text,a)
end
end
но теперь нужно везде заменить draw_text на sh_draw_text
-
А, всё, я сделал.
Вставить в самое начало.
PHP код:
class Bitmap
def sh_draw_text(x,y,w,h,text,a = 0)
temp = font.color.clone
font.color = Color.new(0,0,0)
draw_text(x+1,y+1,w,h,text,a,false)
font.color = temp
draw_text(x,y,w,h,text,a,false)
end
alias andrew_draw_text draw_text
def draw_text(x,y,w,h,text,a = 0, sh = true)
if sh
sh_draw_text(x,y,w,h,text,a)
else
andrew_draw_text(x,y,w,h,text,a)
end
end
end
-
В наборе Tons of Addons есть скрипт Simple Shaded Text. Вот он отдельно:
Код:
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Simple Shaded Text by Blizzard
# Version: 2.0b
# Type: Text Readability Improvement
# Date: 2.7.2006
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#==============================================================================
# Game_System
#==============================================================================
class Game_System
alias init_tons_of_addons1_later initialize
def initialize
init_tons_of_addons1_later
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration 1-2, GRAPHIC add-ons
#
# You can enable/disable any add-on here if you wish. Set the value to false
# to disable it initially. To turn it on/off ingame, just use the Call script
# command with one of these syntaxes:
#
# $game_system.NAME_OF_THE_ADDON = true
# $game_system.NAME_OF_THE_ADDON = false
#
# where NAME_OF_THE_ADDON is the same variable as the one used below.
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@SHADED_TEXT = true
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration 1-2
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
end
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# It is recommended that you don't edit anything below this line except for
# the configurations for the add-ons.
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
attr_accessor :SHADED_TEXT
end
#==============================================================================
# Bitmap
#==============================================================================
class Bitmap
#----------------------------------------------------------------------------
# draw_text
# x2 - x coordinate or rectangle
# y2 - y coordinate or text
# w2 - width or align
# h2 - height
# text2 - the text to be drawn
# a2 - align
# Added additional drawing to make the text look like shaded.
#----------------------------------------------------------------------------
alias draw_text_shaded_later draw_text
def draw_text(x2, y2, w2 = 0, h2 = 0, text2 = '', a2 = 0)
# set coordinates whether x2 is rectangle
if x2.is_a?(Rect)
x, y, w, h, text, a = x2.x, x2.y, x2.width, x2.height, y2, w2
else
x, y, w, h, text, a = x2, y2, w2, h2, text2, a2
end
# if active
if $game_system != nil && $game_system.SHADED_TEXT
# store font color
save_color = self.font.color.clone
# set font color to black
self.font.color = Color.new(0, 0, 0)
# draw shade
draw_text_shaded_later(x+1, y+1, w, h, text, a)
# restore font color
self.font.color = save_color
end
# draw normal text
draw_text_shaded_later(x, y, w, h, text, a)
end
#----------------------------------------------------------------------------
# draw_text_full
# x2 - x coordinate or rectangle
# y2 - y coordinate or text
# w2 - width or align
# h2 - height
# text2 - the text to be drawn
# a2 - align
# Draws outlines text.
#----------------------------------------------------------------------------
def draw_text_full(x2, y2, w2 = 0, h2 = 0, text2 = '', a2 = 0)
# set coordinates whether x2 is rectangle
if x2.is_a?(Rect)
x, y, w, h, text, a = x2.x, x2.y, x2.width, x2.height, y2, w2
else
x, y, w, h, text, a = x2, y2, w2, h2, text2, a2
end
# store font color
save_color = self.font.color.clone
# set font color to black
self.font.color = Color.new(0, 0, 0)
# draw outline
draw_text_shaded_later(x+1, y+1, w, h, text, a)
draw_text_shaded_later(x-1, y+1, w, h, text, a)
draw_text_shaded_later(x-1, y-1, w, h, text, a)
draw_text_shaded_later(x+1, y-1, w, h, text, a)
# restore font color
self.font.color = save_color
# draw normal text
draw_text_shaded_later(x, y, w, h, text, a)
end
end
Просто копируется в отдельную категорию.
-
Мой меньше, а делает тоже самое.
У меня пишет: не найден метод SHADEST_TEXT для game_system'a
В новом проекте мой не идёт тоже.
-
Вот моя финальная версия:
вставлять в любое место
PHP код:
#Растояние от текста до тени
$shadow_power = 1
class Bitmap
alias andrew_draw_text draw_text
def draw_text(x2, y2, w2 = 0, h2 = 0, text2 = '', a2 = 0, sh = true)
if x2.is_a?(Rect)
x, y, w, h, text, a = x2.x, x2.y, x2.width, x2.height, y2, w2
else
x, y, w, h, text, a = x2, y2, w2, h2, text2, a2
end
if sh
temp = font.color.clone
font.color = Color.new(0,0,0)
draw_text(x+$shadow_power,y+$shadow_power,w,h,text,a,false)
font.color = temp
draw_text(x,y,w,h,text,a,false)
else
andrew_draw_text(x,y,w,h,text,a)
end
end
end