| 赞 | 0 |
| VIP | |
| 好人卡 | |
| 积分 | 1 |
| 经验 | |
| 最后登录 | 2017-7-6 |
| 在线时间 | 125 小时 |
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 125 小时
- 注册时间
- 2006-7-19
- 回帖
- 225
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
本帖最后由 天涯孤客 于 2016-1-9 22:34 编辑
如题,希望大大们帮帮忙。在此谢过。
功能就是点开NPC后,诸多设置好的地点名称,点击后,主角传送到该地点。
虽也可以用变量实现,但是选项框只能有4项选择,且排列不好看,体验感不好。
此为XP原脚本:
[pre lang="ruby"]#==============================================================================
# by bbaugle 本脚本来自www.66RPG.com。使用或转载时请保留此信息。
#==============================================================================
class Scene_Fly
def initialize(names=nil,place=nil,x=nil,y=nil)
@names = names
@place = place
@x = x
@y = y
end
def main
@a = Window_Command.new(240,@names)
@a.x = 320 - @a.width / 2
@a.height = 320
@a.y = 240 - @a.height/ 2
@b = Window_Base.new(0, 0, 240, 52)
@b.contents = Bitmap.new(240-32, 320-32)
@b.y = 10
@b.x = 320 - @a.width/2
@b.contents.draw_text(35, 0, 240, 16, "请选择需要传送的地点")
@gold = Window_Base.new(640-128,10,128,48)
@gold.contents = Bitmap.new(128,48)
gold = $game_party.gold
@gold.contents.draw_text(36,0,128,16,gold.to_s)
@gold.contents.draw_text(0,0,64,16,"金钱")
@gold.opacity = 230
Graphics.transition
loop do;
Graphics.update
Input.update
update
if $scene != self then;
break
end
end
Graphics.freeze
@a.dispose
@b.dispose
@gold.dispose
end
def update
@a.update
@b.update
@gold.update
if Input.trigger?(Input::B)
$scene = Scene_Map.new
end
if Input.trigger?(Input::C)
$game_map.setup(@place[@a.index])
$game_player.moveto(@x[@a.index],@y[@a.index])
$game_player.refresh
$game_map.autoplay
$game_map.update
$scene = Scene_Map.new
end
end
end
[/pre] |
|