Project1
标题:
怎么显示一张图片在行走图"下面"
[打印本页]
作者:
刺夜之枪
时间:
2012-1-7 23:33
标题:
怎么显示一张图片在行走图"下面"
本帖最后由 刺夜之枪 于 2012-1-9 20:03 编辑
RT,这个下面是说让NPC士兵脚底下踩着个光环(即时战略的的士兵都有的光环)
总之不能用PS,哪有什么办法。
注意,只有指定的事件脚下才能有。。。 dsu_plus_rewardpost_czw
作者:
傲视群雄
时间:
2012-1-8 02:10
可以设置动画
显示某个事件 播放动画
用自定义设置等待与开关 这样就可以做到炫光的效果
作者:
Wind2010
时间:
2012-1-8 09:14
这样的话或者需要改Game_Character,在里面再加一个Bitmap来描绘
作者:
px.凤翔九天
时间:
2012-1-8 09:30
貌似也可以在scene_map中加个监视事件位置的处理然后跟随他播放动画光环或者图片光环。
作者:
刺夜之枪
时间:
2012-1-8 10:19
具体步骤求指示,脚本什么的不会
作者:
众神与将军
时间:
2012-1-8 21:00
用PS在士兵脚下加光圈
作者:
CockyGuy
时间:
2012-1-8 21:43
本帖最后由 CockyGuy 于 2012-1-9 21:31 编辑
首先在Main之前插入脚本:
#==============================================================================
# ■ Spriteset_Map
#------------------------------------------------------------------------------
# 处理地图画面活动块和元件的类。本类在
# Scene_Map 类的内部使用。
#==============================================================================
class Spriteset_Map
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize
# 生成显示端口
@viewport1 = Viewport.new(0, 0, 640, 480)
@viewport2 = Viewport.new(0, 0, 640, 480)
@viewport3 = Viewport.new(0, 0, 640, 480)
@viewport2.z = 200
@viewport3.z = 5000
# 生成元件地图
@tilemap = Tilemap.new(@viewport1)
@tilemap.tileset = RPG::Cache.tileset($game_map.tileset_name)
for i in 0..6
autotile_name = $game_map.autotile_names[i]
@tilemap.autotiles[i] = RPG::Cache.autotile(autotile_name)
end
@tilemap.map_data = $game_map.data
@tilemap.priorities = $game_map.priorities
# 生成远景平面
@panorama = Plane.new(@viewport1)
@panorama.z = -1000
# 生成雾平面
@fog = Plane.new(@viewport1)
@fog.z = 3000
# 生成角色活动块
@character_sprites = []
for i in $game_map.events.keys.sort
sprite = Sprite_Character.new(@viewport1, $game_map.events[i])
if not sprite.character.ring.empty?
ring = BrightRing.new(@viewport1,sprite.character)
@character_sprites.push(ring)
end
@character_sprites.push(sprite)
end
@character_sprites.push(Sprite_Character.new(@viewport1, $game_player))
# 生成天气
@weather = RPG::Weather.new(@viewport1)
# 生成图片
@picture_sprites = []
for i in 1..50
@picture_sprites.push(Sprite_Picture.new(@viewport2,
$game_screen.pictures[i]))
end
# 生成计时器块
@timer_sprite = Sprite_Timer.new
# 刷新画面
update
end
end
复制代码
再在Main前插入一个脚本(这俩可以放一起,随便。)
class BrightRing < RPG::Sprite
attr_accessor :offset_x
attr_accessor :offset_y
attr_accessor :character
def initialize(viewport, character = nil)
super(viewport)
self.character = character
@offset_x = 0
@offset_y = 0
self.visible = true
self.z = 9
self.bitmap = RPG::Cache.picture(character.ring)
end
def update()
x = (character.real_x - $game_map.display_x + 3) / 4
y = (character.real_y - $game_map.display_y + 3) / 4
adjust_offset(x, y)
self.x = x + @offset_x
self.y = y + @offset_y
end
def change_ring(bitmap)
self.bitmap = bitmap
end
def hide_ring
self.visible = false
end
def show_ring
self.visible = true
end
def adjust_offset(x, y)
@offset_x = 16 - (self.bitmap.width / 2)
@offset_y = 16 - (self.bitmap.height / 2)
end
end
class Game_Character
attr_accessor :ring
alias :ori_character_initialize :initialize
def initialize
@ring = ''
ori_character_initialize
end
end
class Game_Event < Game_Character
alias :ori_event_initialize :initialize
def initialize(map_id, event)
ori_event_initialize(map_id, event)
ring_initialize
end
def ring_initialize
command = @event.pages[0].list[0]
if command.code == 108 and command.parameters[0][0] == 64
@ring = command.parameters[0][1,command.parameters[0].size - 1]
end
end
end
复制代码
将你的"光环"素材保存在Graphics/Pictures文件夹,例如文件名为11.png。
在你想要显示这个光环的事件的【事件页】第一页第一个事件必须是注释。内容是
@素材名
复制代码
在本例子中就是
@11
复制代码
======================================
[@]刺夜之枪[/@]
图片跟着事件走。
变成尸体后在【设置移动路线】事件中调用脚本
self.brightring.hide_ring
复制代码
光环就没了。
额,写的仓促脚本有点缺陷……默认我这个是自动跟踪事件移动的,如果想要小改位置貌似访问不到……
������������
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1