赞 | 11 |
VIP | 302 |
好人卡 | 162 |
积分 | 62 |
经验 | 108302 |
最后登录 | 2024-11-2 |
在线时间 | 6592 小时 |
Lv4.逐梦者 醉啸 长风万里
- 梦石
- 0
- 星屑
- 6157
- 在线时间
- 6592 小时
- 注册时间
- 2007-12-16
- 帖子
- 4501
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 仲秋启明 于 2010-12-31 15:35 编辑
- #==============================================================================
- # 华丽战斗背景
- # 原作BY: modern algbera
- # 提供BY:企鹅达达
- # 翻译BY:仲秋启明
- #==============================================================================
- #==============================================================================
- # ● 设定
- #==============================================================================
- module ModernAlgebra
- #==============================================================================
- # ● 设定
- # map_id => [scape_1_id, scape_2_id, ..., scape_n_id] 地图ID=> [背景图ID]
- # when scape_id 背景图ID
- # parallax_name = "" 背景图名
- # z = 0 决定显示位置Z轴
- # scroll_x = 0 X轴滚动
- # scroll_y = 0 Y轴滚动
- # zoom_x = 100 X轴缩放
- # zoom_y = 100 Y轴缩放
- # opacity = 255 透明度
- # blend_type = 0 混合方式:0:普通,1:加法,2: 减法
- # color = [r, g, b, a] #(default: [0, 0, 0, 0]) 颜色[红,绿,蓝,通道]
- # tone = [r, g, b] #(default: [0, 0, 0])
- #==============================================================================
- MAP_BATTLE_SCAPES = {
- 1 => [1, 2, 3]
- }
- MAP_BATTLE_SCAPES.default = []
- AREA_BATTLE_SCAPES = {
- 1 => [1, 2],
- 2 => [4, 5]
- }
- AREA_BATTLE_SCAPES.default = []
- BattleScape = Struct.new (:parallax_name, :z, :scroll_x, :scroll_y,
- :zoom_x, :zoom_y, :blend_type, :color, :tone, :opacity)
- def self.battle_scape (scape_id)
- @battle_scapes = [] if @battle_scapes.nil?
- return @battle_scapes[scape_id] if @battle_scapes[scape_id] != nil
- parallax_name, blend_type, color, tone = "", 0, [0, 0, 0, 0], [0, 0, 0]
- z, scroll_x, scroll_y, zoom_x, zoom_y, opacity = 0, 0, 0, 100, 100, 255
- case scape_id
- when 1
- parallax_name = "MegaTronx BG"
- z = 50
- when 2
- parallax_name = "CloudySky"
- scroll_x = -5
- when 3
- parallax_name = "Fog"
- z = 150
- scroll_x = -10
- scroll_y = 5
- blend_type = 2
- opacity = 100
- when 4
- parallax_name = "Bridge"
- z = 50
- zoom_x = 85
- zoom_y = 130
- when 5
- parallax_name = "BlueSky"
- scroll_x = 2
- end
- @battle_scapes[scape_id] = BattleScape.new (parallax_name, z, scroll_x,
- scroll_y, (zoom_x / 100.0), (zoom_y / 100.0), blend_type, color, tone, opacity)
- return @battle_scapes[scape_id]
- end
- def self.map_battle_scapes (map_id)
- scapes = []
- MAP_BATTLE_SCAPES[map_id].each { |scape_id| scapes.push (self.battle_scape (scape_id)) }
- return scapes
- end
- def self.area_battle_scapes (area_id)
- scapes = []
- AREA_BATTLE_SCAPES[area_id].each { |scape_id| scapes.push (self.battle_scape (scape_id)) }
- return scapes
- end
- end
- class Game_Map
- def battle_scapes
- $data_areas.values.each { |area|
- if $game_player.in_area? (area) && !ModernAlgebra.area_battle_scapes (area.id).empty?
- return ModernAlgebra.area_battle_scapes (area.id)
- end
- }
- return ModernAlgebra.map_battle_scapes (@map_id)
- end
- end
- class Spriteset_Battle
- alias modernalgbr_terraintypes_crtbttlebck_63b5 create_battleback
- def create_battleback (*args)
- if $BTEST
- modernalgbr_terraintypes_crtbttlebck_63b5 (*args)
- return
- end
- @battle_scapes = $game_map.battle_scapes
- @battle_planes = []
- @battle_planes_xy = []
- @battle_scapes.each { |battle_scape|
- plane = Plane.new (@viewport1)
- plane.z = battle_scape.z
- plane.bitmap = Cache.parallax (battle_scape.parallax_name)
- plane.zoom_x, plane.zoom_y = battle_scape.zoom_x, battle_scape.zoom_y
- plane.blend_type = battle_scape.blend_type
- plane.color = Color.new (*battle_scape.color)
- plane.tone = Tone.new (*battle_scape.tone)
- plane.opacity = battle_scape.opacity
- @battle_planes.push (plane)
- @battle_planes_xy.push ([0,0])
- }
- if @battle_planes.empty?
- modernalgbr_terraintypes_crtbttlebck_63b5 (*args)
- else
- Graphics.frame_reset
- end
- end
- alias modrnalgbra_terratas_dspsebkbmp_74bt dispose_battleback_bitmap
- def dispose_battleback_bitmap (*args)
- modrnalgbra_terratas_dspsebkbmp_74bt (*args) unless @battleback_sprite.nil?
- @battle_planes.each { |plane| plane.bitmap.dispose unless plane.bitmap.disposed? }
- end
- alias modrenalbr_dspsbb_terrintypes_09b6 dispose_battleback
- def dispose_battleback (*args)
- modrenalbr_dspsbb_terrintypes_09b6 (*args) unless @battleback_sprite.nil?
- @battle_planes.each { |plane| plane.dispose }
- end
- alias modalg_bbckupd_trrantypes_52n5 update_battleback
- def update_battleback (*args)
- if @battleback_sprite.nil?
- @battle_planes.each_index { |i|
- x_y = @battle_planes_xy[i]
- plane = @battle_planes[i]
- scape = @battle_scapes[i]
- x_y[0] += (scape.scroll_x * 2)
- x_y[1] += (scape.scroll_y * 2)
- plane.ox, plane.oy = (x_y[0] / 16), (x_y[1] / 16)
- }
- else
- modalg_bbckupd_trrantypes_52n5 (*args)
- end
- end
- end
复制代码 范例:
华丽战斗背景.rar
(1.11 MB, 下载次数: 3649)
夕阳武士于2010-12-26 22:15补充以下内容:
我明白了,不仅有背景图还有滑动的远景以及雾形图,果然不错!
|
评分
-
查看全部评分
|