Project1
标题:
请问如何用脚本移动图片?
[打印本页]
作者:
冬天吃雪糕
时间:
2013-7-16 09:45
标题:
请问如何用脚本移动图片?
我用脚本实现了如下图的效果(选择角色时在窗口的右侧显示一张角色半身图)
但是现在这样是一选择角色图就直接出来了,
我想做成让这张图从右边界平移出来,并且令其不透明度逐渐增大(渐显)
脚本如下
$se名 = [*"A".."E"]
class Scene_Battle < Scene_Base
alias start_actor_command_selection_old start_actor_command_selection
def start_actor_command_selection
start_actor_command_selection_old
@actorface = Sprite.new
if BattleManager.actor.hp < BattleManager.actor.mhp*0.3
@actorface.bitmap = Bitmap.new("Graphics/Faces/face0_" + BattleManager.actor.id.to_s + ".png")
else
@actorface.bitmap = Bitmap.new("Graphics/Faces/face_" + BattleManager.actor.id.to_s + ".png")
end
@actorface.x = 300
@actorface.y = 50
end
alias prior_command_old prior_command
def prior_command
@actorface.dispose if @actorface != nil && @actorface.disposed? != true
prior_command_old
end
alias next_command_old next_command
def next_command
@actorface.dispose if @actorface != nil && @actorface.disposed? != true
next_command_old
end
end
复制代码
我搜索到这么一个脚本$game_map.screen.pictures[number].move(origin,x,y,zoom_x,zoom_y,opacity,blend_type,duration),
但是这个脚本似乎是VX的,不知道通不通用,而且那个pictures[number]应该改成什么?
求教,谢谢
作者:
冬天吃雪糕
时间:
2013-7-16 18:18
居然沉了{:2_258:}
顺便提出另一个问题,
在战斗开始时有“战斗、撤退”两个选项,我想在那里添加一个“自动战斗”选项,选择自动战斗后给每个角色添加“自动战斗”这个特性,然后战斗结束或者在战斗中按Esc解除。
请问用脚本如何实现?
如果不能添加特性的话,要做成选择自动战斗后所有角色自动普通攻击又如何实现?求指教{:2_270:}
作者:
冬天吃雪糕
时间:
2013-7-17 13:27
主楼的问题在自己的不懈努力下终于用循环勉强解决了{:2_279:},不过不知道这样会不会很卡,求排泄,求精简写法(事件里面都有的话应该有相应语句的吧{:2_270:})
脚本如下
$se名 = [*"A".."E"]
class Scene_Battle < Scene_Base
alias start_actor_command_selection_old start_actor_command_selection
def start_actor_command_selection
start_actor_command_selection_old
@actorface = Sprite.new
if BattleManager.actor.hp < BattleManager.actor.mhp*0.3
@actorface.bitmap = Bitmap.new("Graphics/Faces/face0_" + BattleManager.actor.id.to_s + ".png")
else
@actorface.bitmap = Bitmap.new("Graphics/Faces/face_" + BattleManager.actor.id.to_s + ".png")
end
@actorface.y = Graphics.height - @actorface.bitmap.height
i = 0
loop do
i = i + 1
@actorface.x = Graphics.width - @actorface.bitmap.width + 25 - i
@actorface.opacity = 0 + i * 10
wait 2
if @actorface.x == Graphics.width - @actorface.bitmap.width
break
end
end
end
alias prior_command_old prior_command
def prior_command
@actorface.dispose if @actorface != nil && @actorface.disposed? != true
prior_command_old
end
alias next_command_old next_command
def next_command
@actorface.dispose if @actorface != nil && @actorface.disposed? != true
next_command_old
end
end
复制代码
另外,求第二个问题的脚本{:2_264:}
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1