设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1450|回复: 1
打印 上一主题 下一主题

[已经过期] 求XP角色选择美化脚本

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
123 小时
注册时间
2012-2-12
帖子
73
跳转到指定楼层
1
发表于 2012-4-8 23:38:33 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 [email protected] 于 2012-4-15 18:27 编辑

Project1.rar (270.61 KB, 下载次数: 96) 如题求美化脚本

点评

情把问题说得再具体一点,您所想要美化的脚本能否从别的游戏提取一个美化之后的游戏截图并上传上来呢?  发表于 2012-4-17 20:52

Lv2.观梦者

梦石
0
星屑
432
在线时间
4175 小时
注册时间
2010-6-26
帖子
6474
2
发表于 2012-4-18 10:54:51 | 只看该作者

给您把光标做了美化,不再是那么大了。别的美化不够详细

本帖最后由 eve592370698 于 2012-4-18 10:55 编辑
  1. #============角色选择=========By凌冰==========================================
  2. #用法 $scene = Scene_SelectActor.new
  3. #=============================================================================
  4. #参与选择的角色ID

  5. ACT_SEL = [1,2,3,4,5]
  6. ACT_SEL_MAX = 5
  7. #====================================
  8. #存储选择结果的变量ID

  9. VA_ID = 4999

  10. #====================================
  11. #窗口设置

  12. WIDTH = 700#窗口宽度
  13. HEIGHT = 480#窗口高度
  14. OPACITY = 255#窗口透明度
  15. BACK_OPACITY = 255#窗口透明度

  16. #====================================
  17. #选择显示图形

  18. CHAORBAT = 1#2
  19. #0为显示人物战斗图,1为显示人物行走图
  20. #2为显示Pictures文件夹下的自定义图片(图片名为角色名)
  21. #其他为不显示图片

  22. #====================================
  23. #人物说明= =暂时仅限一行

  24. DES_SWI = true#说明开关
  25. ACT_DES = []#初始化,请不要修改
  26. #以下填写格式为ACT_DES[角色ID] = "说明文字"

  27. #====================================
  28. #背景图片

  29. BGP_SWI = false#背景开关= =打开后PDE_SWI被屏蔽
  30. BGP_PIC = "Logo"#背景图片文件名Pictures文件夹下
  31. BGP_OPA = 180#开关打开后,窗口透明度
  32. BGP_BOP = 0#开关打开后,窗口(不包括边框)透明度

  33. #====================================
  34. #说明图片
  35. #移动光标矩形时自动切换图片

  36. PDE_SWI = true#图片开关= =BGP_SWI打开后被屏蔽
  37. PIC_DES = []#初始化,请不要修改
  38. #以下填写格式为PIC_DES[角色ID] = "图片文件名"
  39. for i in 0..999
  40. PIC_DES[i] = "Logo"
  41. end
  42. PDE_OPA = 180#开关打开后,窗口透明度
  43. PDE_BOP = 0#开关打开后,窗口(不包括边框)透明度

  44. #====================================
  45. class Window_SelectActor < Window_Selectable
  46.   

  47.   def initialize
  48.     super(0, 0, WIDTH, HEIGHT)
  49.     self.contents = Bitmap.new(width - 32, height - 32)
  50.     @item_max = ACT_SEL.size
  51.     @column_max = ACT_SEL.size
  52.     @index = 0
  53.     self.x = (640-self.width)/2
  54.     self.y = (480-self.height)/2

  55.     refresh
  56.   end
  57.   def refresh
  58.     self.contents.clear
  59.     for i in 0...ACT_SEL.size
  60.       x = (self.width-32)/ACT_SEL.size * i
  61.       actor = $game_actors[ACT_SEL[i]]
  62.       x_plus = contents.text_size(actor.name).width
  63.       x_plus = ((self.width-32)/ACT_SEL.size - x_plus)/2
  64.       draw_actor_name(actor, x+4+x_plus, 4)
  65.       case CHAORBAT
  66.       when 0
  67.         bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
  68.         src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  69.         x_plus = bitmap.width
  70.         x_plus = ((self.width-32)/ACT_SEL.size - x_plus)/2
  71.         self.contents.blt(x+x_plus, 36, bitmap, src_rect)
  72.       when 1
  73.         bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
  74.         y_plus = bitmap.height/4
  75.         x_plus = bitmap.width/4
  76.         x_plus2 = ((self.width-32)/ACT_SEL.size - x_plus)/2
  77.         draw_actor_graphic(actor, x+x_plus/2+x_plus2, y_plus+36)
  78.       when 2
  79.         bitmap = RPG::Cache.picture(actor.name)
  80.         src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  81.         x_plus = bitmap.width
  82.         x_plus = ((self.width-32)/ACT_SEL.size - x_plus)/2
  83.         self.contents.blt(x+x_plus, 36, bitmap, src_rect)
  84.       end
  85.     end
  86.   end
  87.   def update_cursor_rect
  88.     if @index < 0
  89.       self.cursor_rect.empty
  90.     else
  91.       self.cursor_rect.set( @index * (self.width-32)/ACT_SEL.size,0, (self.width-32)/ACT_SEL.size, self.height / ACT_SEL_MAX )
  92.     end
  93.   end
  94. end
  95. class Window_Help_New < Window_Help
  96.   def initialize
  97.     super
  98.     self.contents = Bitmap.new(width, height)
  99.     self.width = WIDTH
  100.     self.contents = Bitmap.new(width - 32, height - 32)
  101.   end
  102. end
  103. class Scene_SelectActor
  104.   def main
  105.     @window = Window_SelectActor.new
  106.     @help_window = Window_Help_New.new
  107.     @help_window.visible = DES_SWI
  108.     @help_window.x = @window.x
  109.     @help_window.y = @window.y + @window.height
  110.     @help_window.width = @window.width
  111.     @help_window.back_opacity = @window.back_opacity = PDE_SWI ? PDE_BOP : BACK_OPACITY
  112.     @help_window.opacity = @window.opacity = PDE_SWI ? PDE_OPA : OPACITY
  113.     @help_window.back_opacity = @window.back_opacity = BGP_BOP if BGP_SWI
  114.     @help_window.opacity = @window.opacity = BGP_OPA if BGP_SWI
  115.     if BGP_SWI
  116.       @sprite = Sprite.new
  117.       @sprite.bitmap = RPG::Cache.picture(BGP_PIC)
  118.       a=$game_variables[1]
  119.     elsif PDE_SWI
  120.       @sprite = Sprite.new
  121.       @sprite.bitmap = RPG::Cache.picture(PIC_DES[1])
  122.     else
  123.       @sprite = Spriteset_Map.new
  124.     end
  125.     # 执行过度4
  126.     Graphics.transition
  127.     # 主循环
  128.     loop do
  129.       # 刷新游戏画面
  130.       Graphics.update
  131.       # 刷新输入信息
  132.       Input.update
  133.       # 刷新画面
  134.       update
  135.       # 如果画面切换就中断循环
  136.       if $scene != self
  137.         break
  138.       end
  139.     end
  140.     # 装备过渡
  141.     Graphics.freeze
  142.     @window.dispose
  143.     @help_window.dispose
  144.     @sprite.dispose
  145.   end
  146.   def update
  147.     @window.update
  148.     @sprite.update
  149.     if DES_SWI
  150.       @help_window_update
  151.       actor_id = ACT_SEL[@window.index]
  152. =begin   $data_actors[actor_id].name表示人名
  153.          
  154. =end  #注意下面是生成名称列表
  155.       text = $data_actors[actor_id].name
  156.       @help_window.set_text(text,1) if text != nil
  157.     end
  158.     if !BGP_SWI and PDE_SWI
  159.       pic = PIC_DES[ACT_SEL[@window.index]]
  160.       @sprite.bitmap = RPG::Cache.picture(pic) if pic != nil
  161.     end
  162.     if Input.trigger?(Input::C)
  163.       $game_system.se_play($data_system.decision_se)
  164.       for i in 0...$game_party.actors.size
  165.         id = $game_party.actors[i].id
  166.         actors_id = [] if actors_id == nil
  167.         actors_id.push(id)
  168.       end
  169.       actors_id.each do |i|
  170.         $game_party.remove_actor(i)
  171.       end
  172.       id = ACT_SEL[@window.index]
  173.       $game_party.add_actor(id)
  174.       $game_variables[VA_ID] = id
  175.       $scene = Scene_Map.new
  176.     end
  177.   end
  178. end
复制代码
潜水,专心忙活三次元工作了……
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-9-23 17:14

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表