Project1
标题:
脚本汉化---Map Credit
[打印本页]
作者:
光的圆周率
时间:
2008-5-17 01:45
标题:
脚本汉化---Map Credit
脚本汉化---Map Credit
Map Credit
Version 1.0
by Woratana
Release Date: 10/05/2008 *Prom Night~*
Form:http://www.rpgmakervx.net/?showtopic=2232
我真的不知道这个脚本名字中文是什么啊~麻烦讲一下下
测试过了,没有问题
#===============================================================
# ● [VX] ◦ 地图控件 ◦ □
#--------------------------------------------------------------
# ◦ by Woratana [
[email protected]
]
# ◦ 创建日期 on: 09/05/2008
# ◦ 版本: 1.0
#----------------------------------------------------
# 使用方法:
# ** 想要开始,Call脚本:
# $scene.credit.start
#
# ** 停止而且清除, call 脚本:
# $scene.credit.terminate
#----------------------------------------------------
# ◦ Special Tags for Decorate Text:
# 有可以放置的特殊的标记文本来修饰该行中
#
# 你也可以设置默认的字符:
#-------------------------------------
# 设置标题
#-------------------------------------
# <h>标题是我 (标题的记号是 <h>)
# &
#-------------------------------------
# 设置文章
#-------------------------------------
#
#-----------------------------------------------------
# ◦ >= 列表 <= ◦
# * 这些标记将只应用到它处于的行~
# * 您不能使用相对同一行中的标记. (例如. <b> 和 </b>)
#
# <b> :加粗文本
# </b> :不要加粗文本
# <i> :I斜体文本
# </i> :没有斜体文本
# <center> :使字体居中
# <left> :使字体向左倾
# <right> :使字体向右倾斜
# <h> :使该行成为标头
#===========================================================================
#----------------------------------------
# 地图说明脚本
#----------------------------------------
class Wora_Map_Credit
BG_Image = '' # 背景名称, 图像必须在目录 'Picture' 下
# 留空表示没有背景体片
BG_Image_Opacity = 255 # 背景暗度 (0 - 255)
Text_Begin_y = 416 # 使用 0 - 416: 文本将从开始屏幕下方
# 使用 416+: 文本将从开始在屏幕中
Text_Scroll_Speed = 1 # 速度
Text_Scroll_Delay = 0 # 每个文本之间延迟移动 速度(0 表示没有)
Text_Opacity = 220 # 文本暗度
Text_Blend_Type = 0 # 0: 正常, 1: 添加, 2: 减法运算
Test_Text = 'I' # 测试高度的文本,
# 如果高度不正确更改为高度字母 ~
#--------------------------
# 开始
#--------------------------
Credit= <<_MAP_CREDIT_
<h>66RPG
<h>建设
柳柳<h>123
465
<h>地址
http://rpg.blue/web
<h>本脚本汉化
x387804363
2
3
_MAP_CREDIT_
#--------------------------
# 结束
#--------------------------
#-------------------------------------
# 设置标题字体
#-------------------------------------
def header_properties(bitmap)
bitmap.font.name = 'Tahoma' # 字体
bitmap.font.color = Color.new(0, 0, 255, 255) # (红,绿, 蓝, 透明度)
bitmap.font.size = 30 # 字体大小
bitmap.font.bold = true # 使用粗字体? (true/false)
bitmap.font.italic = false # 斜体字? (true/false)
bitmap.font.shadow = true # 阴影? (true/false)
@text_outline = Color.new(0,0,0) # Color.new(r,g,b) 大纲颜色?
@text_align = 1 # 0: 靠左, 1: 中心, 2: 靠右
end
#-------------------------------------
# 设置正文字体
#-------------------------------------
def content_properties(bitmap)
bitmap.font.name = 'Tahoma'
bitmap.font.color = Color.new(255, 255, 255, 255)
bitmap.font.size = 22
bitmap.font.bold = true
bitmap.font.italic = false
bitmap.font.shadow = true
@text_outline = nil
@text_align = 1
end
#-----------------------------------------------------------------------
# 脚本设置部分
#===========================================================================
def initialize
@started = false
end
# 假如字体已经创建,则删除他
def terminate
if @started
if @bg != nil
@bg.bitmap.dispose
@bg.dispose
end
@sprite.bitmap.dispose
@sprite.dispose
@started = false
end
end
# 开始创建
def start(text = Credit, bg = BG_Image)
# 创建背景
if BG_Image != ''
@bg = Sprite.new
@bg.bitmap = Cache.picture(bg)
@bg.opacity = BG_Image_Opacity
@bg.z = 10000
end
# 创建文本
@sprite = Sprite.new
@sprite.x = 0
@sprite.y = 0
@sprite.z = 10001
@sprite.opacity = Text_Opacity
@sprite.blend_type = Text_Blend_Type
# 计算高度
header_line = 0
content_line = 0
height = 0
text = text.split(/n/)
text.each do |i|
if i.include?('<h>'); header_line += 1
else; content_line += 1
end
end
@sprite.bitmap = Bitmap.new(1,1)
# 测试标题属性
header_properties(@sprite.bitmap)
header_height = @sprite.bitmap.text_size(Test_Text).height
height += ( header_line * ( header_height ) )
# 测试内容属性
content_properties(@sprite.bitmap)
content_height = @sprite.bitmap.text_size(Test_Text).height
height += ( content_line * ( content_height ) )
@sprite.bitmap.dispose
# 完成测试,绘制文本
@sprite.bitmap = Bitmap.new(Graphics.width, Text_Begin_y + height + 32)
content_x = 0
content_y = Text_Begin_y
text.each do |i|
# 确定特殊标记
if i.include?('<h>')
i.sub!('<h>', '')
header_properties(@sprite.bitmap)
bitmap_height = header_height
else
content_properties(@sprite.bitmap)
bitmap_height = content_height
end
# 粗字体
if i.include?('<b>')
i.sub!('<b>', ''); @sprite.font.bold = true
elsif i.include?('</b>')
i.sub!('</b>', ''); @sprite.font.bold = false
end
# 倾斜文本
if i.include?('<i>')
i.sub!('<i>', ''); @sprite.font.italic = true
elsif i.include?('</i>')
i.sub!('</i>', ''); @sprite.font.italic = false
end
# 对齐文本
if i.include?('<center>')
i.sub!('<center>', ''); @text_align = 1
elsif i.include?('<left>')
i.sub!('<left>', ''); @text_align = 0
elsif i.include?('<right>')
i.sub!('<right>', ''); @text_align = 2
end
if [url=mailto:!@text_outline.nil]!@text_outline.nil[/url]? # 文本大纲
ori_color = @sprite.bitmap.font.color.clone
@sprite.bitmap.font.color = @text_outline
@sprite.bitmap.draw_text(content_x-1, content_y, @sprite.bitmap.width,
bitmap_height, i, @text_align)
@sprite.bitmap.draw_text(content_x, content_y-1, @sprite.bitmap.width,
bitmap_height, i, @text_align)
@sprite.bitmap.draw_text(content_x, content_y+1, @sprite.bitmap.width,
bitmap_height, i, @text_align)
@sprite.bitmap.draw_text(content_x+1, content_y, @sprite.bitmap.width,
bitmap_height, i, @text_align)
@sprite.bitmap.font.color = ori_color
end
# 绘制字体
@sprite.bitmap.draw_text(content_x, content_y, @sprite.bitmap.width,
bitmap_height, i, @text_align)
content_y += bitmap_height
end
@delay = 0
@started = true
end
# 创建
def update
if @started
if @delay > 0
@delay -= 1
return
else
@sprite.oy += Text_Scroll_Speed
@delay += Text_Scroll_Delay
end
end
end
end
#----------------------------------------
# 插入到地图 ~~~(*^__^*)~~~
#----------------------------------------
class Scene_Map < Scene_Base
attr_reader :credit
alias wor_mapcre_scemap_str start
alias wor_mapcre_scemap_upd update
alias wor_mapcre_scemap_ter terminate
def start
@credit = Wora_Map_Credit.new # 创建
wor_mapcre_scemap_str
end
def update
@credit.update # 更新
wor_mapcre_scemap_upd
end
def terminate
@credit.terminate # 释放
wor_mapcre_scemap_ter
end
end
复制代码
猛击我下载
作者:
越前止まる殇
时间:
2008-5-17 04:29
提示:
作者被禁止或删除 内容自动屏蔽
作者:
沉影不器
时间:
2008-5-17 06:57
提示:
作者被禁止或删除 内容自动屏蔽
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1