赞 | 1 |
VIP | 127 |
好人卡 | 25 |
积分 | 5 |
经验 | 59654 |
最后登录 | 2020-12-3 |
在线时间 | 820 小时 |
Lv2.观梦者 (暗夜天使) 卑微的梦
- 梦石
- 0
- 星屑
- 523
- 在线时间
- 820 小时
- 注册时间
- 2013-2-23
- 帖子
- 1185
|
- #==============================================================================
- # 默认地图名加强 by 子弹君
- #==============================================================================
- # 说明:
- # 加强默认地图名的各种功能
- # 注:目前还不支持显示一张图片做背景
- #==============================================================================
- $BombScript ||= {};$BombScript["默认地图名加强"] = "默认地图名加强20140920"
- #==============================================================================
- # 设定部分
- #==============================================================================
- module BOMB
- BOMB_TRW = 2
- # 设置地图名显示的模式(调为0会报错,目前只支持1、2两种模式)
- BOMB_WIDTH = 480
- # 设置地图框的宽度(宽度如果调大,需要重新设置一次坐标,因为太大了超出屏幕了= =)
- BOMB_FONT = "微软雅黑"
- # 设置地图名的字体
- BOMB_SIZE = 20
- # 设置字体的大小
- BOMB_X = 28
- # 设置地图名的X坐标
- BOMB_Y = 150
- # 设置地图名的Y坐标
- BOMB_BOLD = true
- # 设置地图名是否加粗
- BOMB_SHADOW = false
- # 设置地图名是否有阴影
- BOMB_ITALIC = false
- # 设置地图名是否斜体
- BOMB_DR = 14
- # 设置地图名的淡入时间
- BOMB_DC = 14
- # 设置地图名的淡出时间
- BOMB_COLOR = Color.new(255,255,255,255)
- # 设置地图字体的颜色
- BOMB_BACK1 = Color.new(0, 0, 0, 192)
- # 设置地图边框背景1的颜色
- BOMB_BACK2 = Color.new(0, 0, 0, 0)
- # 设置地图边框背景2的颜色
- end
- class Window_MapName < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对象
- #--------------------------------------------------------------------------
- def initialize
- super(BOMB::BOMB_X, BOMB::BOMB_Y, window_width, fitting_height(1))
- self.contents.font.name = BOMB::BOMB_FONT
- self.contents.font.size = BOMB::BOMB_SIZE
- self.contents.font.color = BOMB::BOMB_COLOR
- self.contents.font.bold = BOMB::BOMB_BOLD
- self.contents.font.shadow = BOMB::BOMB_SHADOW
- self.contents.font.italic = BOMB::BOMB_ITALIC
- self.opacity = 0
- self.contents_opacity = 0
- @show_count = 0
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 获取窗口的宽度
- #--------------------------------------------------------------------------
- def window_width
- return BOMB::BOMB_WIDTH
- end
- #--------------------------------------------------------------------------
- # ● 更新画面
- #--------------------------------------------------------------------------
- def update
- super
- if @show_count > 0 && $game_map.name_display
- update_fadein
- @show_count -= 1
- else
- update_fadeout
- end
- end
- #--------------------------------------------------------------------------
- # ● 更新淡入
- #--------------------------------------------------------------------------
- def update_fadein
- self.contents_opacity += BOMB::BOMB_DR
- end
- #--------------------------------------------------------------------------
- # ● 更新淡出
- #--------------------------------------------------------------------------
- def update_fadeout
- self.contents_opacity -= BOMB::BOMB_DC
- end
- #--------------------------------------------------------------------------
- # ● 打开窗口
- #--------------------------------------------------------------------------
- def open
- refresh
- @show_count = 150
- self.contents_opacity = 0
- self
- end
- #--------------------------------------------------------------------------
- # ● 关闭窗口
- #--------------------------------------------------------------------------
- def close
- @show_count = 0
- self
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- contents.clear
- unless $game_map.display_name.empty?
- draw_background(contents.rect)
- draw_text(contents.rect, $game_map.display_name, 1)
- end
- end
- #--------------------------------------------------------------------------
- # ● 绘制背景
- #--------------------------------------------------------------------------
- def draw_background(rect)
- temp_rect = rect.clone
- temp_rect.width /= BOMB::BOMB_TRW
- contents.gradient_fill_rect(temp_rect, back_color2, back_color1)
- temp_rect.x = temp_rect.width
- contents.gradient_fill_rect(temp_rect, back_color1, back_color2)
- end
- #--------------------------------------------------------------------------
- # ● 获取背景色 1
- #--------------------------------------------------------------------------
- def back_color1
- BOMB::BOMB_BACK1
- end
- #--------------------------------------------------------------------------
- # ● 获取背景色 2
- #--------------------------------------------------------------------------
- def back_color2
- BOMB::BOMB_BACK2
- end
- end
复制代码 |
评分
-
查看全部评分
|