Project1
标题:
即时消息脚本
[打印本页]
作者:
hgfor
时间:
2008-12-21 05:27
即时消息脚本还有一个window_down ,在这里修改.
super(0, 340, 330, 240) 这里修改相应的就行了.
#==============================================================================
# ■ Window_Down 【仿网游式即时消息系统】
#------------------------------------------------------------------------------
# 信息窗口。
#==============================================================================
class Window_Down < Window_Selectable
#--------------------------------------------------------------------------
# ● 定义实例变量
#--------------------------------------------------------------------------
attr_reader :item_max
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize
super(0, 340, 330, 240)
@column_max = 1
self.opacity = 0
if $a != nil and $a.size < 21
self.index = $a.size/2
elsif $a != nil and $a.size > 20
self.index = 9
end
refresh
self.active = false
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
if $a != nil and $a.size < Blue::Blue_max + 1
@item_max = $a.size
elsif $a != nil and $a.size > Blue::Blue_max
@item_max = Blue::Blue_max
end
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 16)
for i in 0...@item_max
draw_item(i)
end
end
end
#--------------------------------------------------------------------------
# ● 描绘项目
# index : 项目编号
#--------------------------------------------------------------------------
def draw_item(index)
if $a.size < Blue::Blue_max + 1
item = $a[index]
else
item = $a[index + $a.size - Blue::Blue_max]
end
x = 0
y = index * 16
self.contents.font.size = 14
self.contents.font.color = Color.new(-170,-170,-170,255)
self.contents.draw_text(x + 6, y + 1, self.contents.text_size(item).width, 16, item, 0)
self.contents.font.color = normal_color
self.contents.draw_text(x + 5, y, self.contents.text_size(item).width, 16, item, 0)
end
#--------------------------------------
# ● 刷新光标
#--------------------------------------
def update_cursor_rect
# 光标位置不满 0 的情况下
if @index < 0
self.cursor_rect.empty
return
end
# 获取当前的行
row = @index / @column_max
# 当前行被显示开头行前面的情况下
if row < self.top_row
# 从当前行向开头行滚动
self.top_row = row
end
# 当前行被显示末尾行之后的情况下
if row > self.top_row + (self.page_row_max - 1)
# 从当前行向末尾滚动
self.top_row = row - (self.page_row_max - 1)
end
# 计算光标的宽
cursor_width = self.width / @column_max - 32
cursor_width = 0
# 计算光标坐标
x = @index % @column_max * (cursor_width + 32)
y = @index / @column_max * 32 - self.oy
# 更新国标矩形
self.cursor_rect.set(x, y, cursor_width, 16)
end
end
复制代码
[LINE]1,#dddddd[/LINE]
系统信息:本贴由本区版主认可为正确答案,66RPG感谢您的热情解答~
作者:
肖宋发
时间:
2009-6-12 08:00
标题:
即时消息脚本
我今天使用即时消息脚本了这个脚本后!我发现文字显示太高了!想调整一下字体低一点!应该怎么调整!{/dk}
#------------------制作by bluefool,转载请保留------------------
module Blue
#这个是控制显示最近的多少条信息的,当超出一屏能显示的值的话可通过先按一下shift
#然后用上下翻看内容。再按一次shift则解除激活
Blue_max = 12
#这个填写进如游戏时生成的系统语言,
INTRO = "欢迎使用即时消息窗口,有什么建议可以联系bluefool,请从左至右依次运行事件体验功能."
#战斗画面时即时消息窗口的x坐标
BATAM_X = 0
#战斗画面时即时消息窗口的y坐标
BATAM_Y = 90
#用于清空hash表,可以不管它,但不要让Blue_max大于它,当然,它的值也可以改变
NAM_MAX = 50
#主要传递信息参数为函数$am,参见脚本内容
end
#-------------------------------------------
class Scene_Load < Scene_File
#--------------------------------------------------------------------------
# ● 确定时的处理
#--------------------------------------------------------------------------
def on_decision(filename)
# 文件不存在的情况下
unless FileTest.exist?(filename)
# 演奏冻结 SE
$game_system.se_play($data_system.buzzer_se)
return
end
# 演奏读档 SE
$game_system.se_play($data_system.load_se)
# 写入存档数据
file = File.open(filename, "rb")
read_save_data(file)
file.close
# 还原 BGM、BGS
$game_system.bgm_play($game_system.playing_bgm)
$game_system.bgs_play($game_system.playing_bgs)
# 刷新地图 (执行并行事件)
$a = {}
$game_map.update
# 切换到地图画面
$scene = Scene_Map.new
end
end
class Game_Player < Game_Character
def update
# 本地变量记录移动信息
last_moving = moving?
# 移动中、事件执行中、强制移动路线中、
# 信息窗口一个也不显示的时候
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing or $ccc == 1
case Input.dir4
when 2
move_down
when 4
move_left
when 6
move_right
when 8
move_up
end
end
# 本地变量记忆坐标
last_real_x = @real_x
last_real_y = @real_y
super
# 角色向下移动、画面上的位置在中央下方的情况下
if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
# 画面向下卷动
$game_map.scroll_down(@real_y - last_real_y)
end
# 角色向左移动、画面上的位置在中央左方的情况下
if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
# 画面向左卷动
$game_map.scroll_left(last_real_x - @real_x)
end
# 角色向右移动、画面上的位置在中央右方的情况下
if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
# 画面向右卷动
$game_map.scroll_right(@real_x - last_real_x)
end
# 角色向上移动、画面上的位置在中央上方的情况下
if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
# 画面向上卷动
$game_map.scroll_up(last_real_y - @real_y)
end
# 不在移动中的情况下
unless moving?
# 上次主角移动中的情况
if last_moving
# 与同位置的事件接触就判定为事件启动
result = check_event_trigger_here([1,2])
# 没有可以启动的事件的情况下
if result == false
# 调试模式为 ON 并且按下 CTRL 键的情况下除外
unless $DEBUG and Input.press?(Input::CTRL)
# 遇敌计数下降
if @encounter_count > 0
@encounter_count -= 1
end
end
end
end
# 按下 C 键的情况下
if Input.trigger?(Input::C)
# 判定为同位置以及正面的事件启动
check_event_trigger_here([0])
check_event_trigger_there([0,1,2])
end
end
end
end
复制代码
[LINE]1,#dddddd[/LINE]
此贴于 2008-12-21 13:28:48 被版主darkten提醒,请楼主看到后对本贴做出回应。
[LINE]1,#dddddd[/LINE]
版务信息:版主帮忙结贴~
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1