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

Project1

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

[交流讨论] 让初始标题的选项变成横向方法

[复制链接]

Lv2.观梦者

梦石
0
星屑
624
在线时间
471 小时
注册时间
2015-8-23
帖子
70
跳转到指定楼层
1
发表于 2024-4-25 14:35:29 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
方法比较简单,就修改三个地方就可以了。至于底图可以按照图书管里的菜单修改来弄就可以弄一个美美的选项了

搜狗截图20240425143012.png (83.34 KB, 下载次数: 16)

搜狗截图20240425143012.png

Lv4.逐梦者

梦石
0
星屑
10675
在线时间
2024 小时
注册时间
2013-6-10
帖子
1498
2
发表于 2024-4-25 15:19:07 | 只看该作者
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
869
在线时间
73 小时
注册时间
2023-12-26
帖子
114
3
发表于 2024-4-27 07:19:31 | 只看该作者
感谢感谢,。不过,,在这个脚本里修改后,会出错,这个脚本还带一些小玩意的,我发给你看。很多人用这个脚本 ..

RUBY 代码复制
  1. #==============================================================================
  2. # +++ MOG - Animated Title A (v1.1) +++
  3. #==============================================================================
  4. # By Moghunter
  5. # [url]http://www.atelier-rgss.com/[/url]
  6. #==============================================================================
  7. # Tela de titulo animado, com logo, imagens aleatórias e outros efeitos visuais.
  8. #==============================================================================
  9. # Nota - Serão necessários as seguintes imagens na pasta Graphics/Titles2/
  10. #
  11. #
  12. # Firefly.png
  13. # Logo.jpg      (Opcional - Caso for usar o efeito logo.)
  14. #
  15. #==============================================================================
  16. # Para definir a imagem de texto basta selecionar no banco de dados
  17. # a imagem do titulo numero 2 (Segunda camada)
  18. #
  19. #==============================================================================
  20. # 1.1 - Opção de pular o logo ao apertar alguma tecla.
  21. #     - Adição de comandos em pictures.
  22. #     - Adição de cursor de comando.
  23. #==============================================================================
  24. module MOG_SCENE_TITLE_A
  25.   #Definição das pictures.
  26.   RANDOM_PICTURES = ["画面1","画面2","画面3","画面4","画面5","画面6"]#,"liubei","攻城","guanyu","zhangfei","赵云","马超","黄忠","诸葛亮"]
  27.   #Tempo de duração para ativar a troca de imagens.
  28.   RANDOM_PICTURES_DURATION = 6#(sec)
  29.   #Seleção aleatória.
  30.   RAMDOM_SELECTION = true
  31.   #Posição do comando.
  32.   COMMANDS_POS =[160+60 , 250+60] #[220+150 , 280+50]
  33.   #Ativar Particulas.
  34.   FIREFLY = true
  35.   #Definição da posição do cursor.(Para ajustes)
  36.   CURSOR_POS = [-40+25,-5]
  37.  
  38. end
  39.  
  40. #==============================================================================
  41. # ■ Window TitleCommand
  42. #==============================================================================
  43. class Window_TitleCommand < Window_Command
  44.   attr_reader :list
  45. end
  46.  
  47. #==============================================================================
  48. # ■ FireFly
  49. #==============================================================================
  50. class Firefly < Sprite
  51.  
  52. #--------------------------------------------------------------------------
  53. # ● Initialize
  54. #--------------------------------------------------------------------------            
  55.   def initialize(viewport = nil)
  56.       super(viewport)
  57.       self.bitmap = Cache.title2("Firefly")
  58.       reset_setting
  59.   end  
  60.  
  61. #--------------------------------------------------------------------------
  62. # ● Reset Setting
  63. #--------------------------------------------------------------------------               
  64.   def reset_setting
  65.       zoom = (50 + rand(100)) / 100.1
  66.       self.zoom_x = zoom
  67.       self.zoom_y = zoom
  68.       self.x = rand(640)
  69.       self.y = rand(480 + self.bitmap.height)
  70.       self.opacity = 0
  71.       self.angle = rand(360+200)
  72.       self.blend_type = 1
  73.       @speed_x = 0
  74.       @speed_y = [[rand(4), 4].min, 1].max
  75.       @speed_a = rand(3)
  76.   end
  77.  
  78. #--------------------------------------------------------------------------
  79. # ● Dispose
  80. #--------------------------------------------------------------------------               
  81.   def dispose
  82.       super
  83.       self.bitmap.dispose
  84.   end  
  85.  
  86. #--------------------------------------------------------------------------
  87. # ● Update
  88. #--------------------------------------------------------------------------               
  89.   def update
  90.       super
  91.       self.x += @speed_x
  92.       self.y -= @speed_y
  93.       self.angle += @speed_a      
  94.       self.opacity += 5
  95.       reset_setting if self.y < 0
  96.   end  
  97.  
  98. end
  99.  
  100. #==============================================================================
  101. # ■ Scene Title
  102. #==============================================================================
  103. class Scene_Title < Scene_Base
  104. include MOG_SCENE_TITLE_A
  105.  
  106. #--------------------------------------------------------------------------
  107. # ● Start
  108. #--------------------------------------------------------------------------         
  109. def start
  110.      super
  111.      SceneManager.clear
  112.      @phase = 1
  113.      @phase_time = -1      
  114.      # 为了第一阶段计时,只要是负的,多少无所谓,在update_initial_animation的时候会设置为15
  115.      # 如果是0则第一阶段直接结束进入第二阶段,所以图片不会显示,因为此时图片还在-100
  116.      # 如果为正,则会马上开始第一阶段计时,负数则会先重置为正再计时
  117.  
  118.      create_command_window
  119.      create_commands
  120.      create_background
  121.      create_light
  122.      create_cursor
  123.      play_title_music
  124. end   
  125.  
  126. #--------------------------------------------------------------------------
  127. # ● Create_cursor
  128. #--------------------------------------------------------------------------           
  129. def create_cursor
  130.      @cursor = Sprite.new          #生成cursor的位图
  131.      @cursor.bitmap = Cache.title2("Cursor")
  132.      @cursor.opacity = 0           #设置cursor开始状态为透明
  133.      @cursor.z = 99                #设置cursor的Z坐标
  134.      @cursor_position = [0,0]      #设置cussor的坐标
  135.      @mx = [0,0,0]                 #还没搞清楚这个是什么????
  136. end
  137.  
  138.  
  139. #--------------------------------------------------------------------------
  140. # ● Create Commands
  141. #--------------------------------------------------------------------------           
  142. def create_commands
  143.      @command_window.visible = false   # close command windows
  144.      @commands_index_old = -1          # 设置一个旧索引代新索引参考
  145.      @commands = []                    # 把命令清空
  146.      @commands_shake_duration = 0      # 设置先不抖动
  147.      index = 0                         # 设置索引位置
  148.      for com in @command_window.list   # 遍历command_window.list里面的所有命令
  149.          sprite = Sprite.new           # 和下一句一起生成位图
  150.          sprite.bitmap = Cache.title2(com[:name].to_s) rescue nil  
  151.          if sprite.bitmap == nil       # 这一段,如果没能生成位图,则生成文字
  152.             sprite.bitmap = Bitmap.new(200,32)
  153.             sprite.bitmap.font.size = 24
  154.             sprite.bitmap.font.bold = true
  155.             sprite.bitmap.font.italic = true
  156.             sprite.bitmap.draw_text(0, 0, 200, 32, com[:name].to_s,1)
  157.          end
  158.          sprite.x = COMMANDS_POS[0] - 100 - (index * 20)  #生成命令位图X坐标,-100是为了能移动,-index*20 是为了让每个命令有斜度
  159.          sprite.y = index * sprite.bitmap.height + COMMANDS_POS[1] #生成命令位图Y坐标
  160.          sprite.z = 100 + index   #设置命令的Z轴
  161.          sprite.opacity = 0       #设置位图初始为透明状态
  162.          index += 1               #索引+1,准备生成下一个命令相关参数
  163.          @commands.push(sprite)   #把命令赋予位图,这个就是把命令和图片联系起来  #到这一步之后可以返回至第一步,直接所有命令生成完毕
  164.      end
  165.      @command_max = index         #获取命令数,生成到几个索引就意味着有几个命令数
  166. end
  167.  
  168.   #--------------------------------------------------------------------------
  169.   # ● create_background
  170.   #--------------------------------------------------------------------------
  171.   def create_background
  172.       @rand_title_duration = 120
  173.       @old_back_index = 0
  174.       @sprite1 = Plane.new
  175.       @sprite1.opacity = 0
  176.       if RAMDOM_SELECTION
  177.          execute_random_picture(false)
  178.       else
  179.          execute_random_picture(true)
  180.       end
  181.       @sprite2 = Plane.new
  182.       @sprite2.bitmap = Cache.title2($data_system.title2_name)
  183.       @sprite2.z = 100
  184.       @sprite2.opacity = 0
  185.   end
  186.  
  187.   #--------------------------------------------------------------------------
  188.   # ● Create Light
  189.   #--------------------------------------------------------------------------  
  190.   def create_light
  191.       return unless FIREFLY
  192.       @light_viewport = Viewport.new(-32, -32, 800, 480)
  193.       @light_bitmap =[]
  194.       for i in 0...20
  195.           @light_bitmap.push(Firefly.new(@light_viewport))
  196.       end  
  197.   end
  198.  
  199.  
  200.  
  201.  
  202.   #--------------------------------------------------------------------------
  203.   # ● dispose Background1
  204.   #--------------------------------------------------------------------------
  205.   def dispose_background1
  206.       @sprite1.bitmap.dispose
  207.       @sprite1.bitmap = nil
  208.       @sprite1.dispose
  209.       @sprite1 = nil
  210.   end
  211.  
  212. #--------------------------------------------------------------------------
  213. # ● Dispose Background2
  214. #--------------------------------------------------------------------------               
  215.   def dispose_background2
  216.       if @sprite2.bitmap != nil
  217.          @sprite2.bitmap.dispose
  218.          @sprite2.bitmap = nil
  219.          @sprite2.dispose
  220.          @sprite2 = nil
  221.       end
  222.   end
  223.  
  224. #--------------------------------------------------------------------------
  225. # ● Dispose Light
  226. #--------------------------------------------------------------------------              
  227.   def dispose_light
  228.       return unless FIREFLY
  229.       if @light_bitmap != nil
  230.          for i in @light_bitmap
  231.              i.dispose
  232.          end
  233.          @light_viewport.dispose
  234.          @light_bitmap = nil
  235.       end      
  236.   end   
  237.  
  238.  
  239. #--------------------------------------------------------------------------
  240. # ● Terminate
  241. #--------------------------------------------------------------------------            
  242. def terminate
  243.      super
  244.      dispose_background1
  245.      dispose_background2
  246.      dispose_light
  247.      @cursor.bitmap.dispose
  248.      @cursor.dispose
  249.      for com in @commands
  250.          com.bitmap.dispose
  251.          com.dispose
  252.      end  
  253. end  
  254.  
  255. #--------------------------------------------------------------------------
  256. # ● Update
  257. #--------------------------------------------------------------------------            
  258. def update
  259.      super
  260.      update_initial_animation   # 第一阶段update,第一阶段结束后不会再执行
  261.      update_command             # 上面第一阶段结束后就会进行此第二阶段update
  262.      update_background
  263.      update_light
  264. end
  265.  
  266. #--------------------------------------------------------------------------
  267. # ● Update Cursor Position
  268. #--------------------------------------------------------------------------            
  269. def update_cursor_position
  270.      @cursor.opacity += 5
  271.      execute_animation_s
  272.      execute_cursor_move(0,@cursor.x,@cursor_position[0] + @mx[1])
  273.      execute_cursor_move(1,@cursor.y,@cursor_position[1])
  274. end  
  275.  
  276.   #--------------------------------------------------------------------------
  277.   # ● Execute Animation S
  278.   #--------------------------------------------------------------------------      
  279.   def execute_animation_s
  280.       @mx[2] += 1
  281.       return if @mx[2] < 4
  282.       @mx[2] = 0
  283.       @mx[0] += 1
  284.       case @mx[0]
  285.          when 1..7;  @mx[1] += 1            
  286.          when 8..14; @mx[1] -= 1
  287.          else
  288.            @mx[0] = 0
  289.            @mx[1] = 0
  290.       end
  291.   end
  292.  
  293.   #--------------------------------------------------------------------------
  294.   # ● Execute Cursor Move
  295.   #--------------------------------------------------------------------------      
  296.   def execute_cursor_move(type,cp,np)
  297.       sp = 5 + ((cp - np).abs / 5)
  298.       if cp > np
  299.          cp -= sp
  300.          cp = np if cp < np
  301.       elsif cp < np
  302.          cp += sp
  303.          cp = np if cp > np
  304.       end     
  305.       @cursor.x = cp if type == 0
  306.       @cursor.y = cp if type == 1
  307.   end   
  308.  
  309.  
  310. #--------------------------------------------------------------------------
  311. # ● Update Background
  312. #--------------------------------------------------------------------------              
  313. def update_background
  314.      @sprite2.opacity += 1     
  315.      return if RANDOM_PICTURES.size == 1
  316.      @rand_title_duration -= 1
  317.      if @rand_title_duration <= 0
  318.         @sprite1.opacity -= 1
  319.      else
  320.         @sprite1.opacity += 1
  321.      end   
  322.      return if @sprite1.opacity != 0
  323.      execute_random_picture
  324. end
  325.  
  326. #--------------------------------------------------------------------------
  327. # ● Execute Random Picture
  328. #--------------------------------------------------------------------------              
  329. def execute_random_picture(initial = false)
  330.      @rand_title_duration = [[60 * RANDOM_PICTURES_DURATION, 9999].min, 60].max
  331.      if @sprite1.bitmap != nil
  332.         @sprite1.bitmap.dispose
  333.         @sprite1.bitmap = nil
  334.      end
  335.      if RAMDOM_SELECTION
  336.          rand_pic = rand(RANDOM_PICTURES.size)
  337.          if rand_pic == @old_back_index
  338.             rand_pic += 1
  339.             rand_pic = 0 if rand_pic >= RANDOM_PICTURES.size
  340.          end
  341.          @old_back_index = rand_pic   
  342.      else
  343.          @old_back_index += 1 unless initial
  344.          @old_back_index = 0 if @old_back_index >= RANDOM_PICTURES.size
  345.      end
  346.      pic = RANDOM_PICTURES[@old_back_index]     
  347.      @sprite1.bitmap = Cache.title1(pic)
  348. end
  349.  
  350. #--------------------------------------------------------------------------
  351. # ● Update Light
  352. #--------------------------------------------------------------------------              
  353. def update_light
  354.      return unless FIREFLY
  355.      if @light_bitmap != nil
  356.         for i in @light_bitmap
  357.             i.update
  358.         end  
  359.      end   
  360. end
  361.  
  362. #--------------------------------------------------------------------------
  363. # ● Update Initial Animation
  364. #--------------------------------------------------------------------------               
  365. def update_initial_animation
  366.      return if @phase != 1               
  367.      # 判断是否初始阶段,初始阶段需要把菜单从左往右移动显示在窗口中间
  368.      # 如果不是初始阶段,那么以下的这一段把菜单从左往右移动的命令就不需要再执行
  369.      @phase_time -= 1 if @phase_time > 0 # 如果@phase_time>0,就会-1以计时此阶段
  370.      if @phase_time == 0                 # 直到@phase_time==0,就是此阶段结束进入
  371.         @phase = 2                       # 进入@phase = 2阶段
  372.         @phase_time = 30                 # 同时@phase_time 重新计时
  373.      end   
  374.      for i in @commands
  375.         index = 0
  376.         if i.x < COMMANDS_POS[0]         # 判断命令是否在设定的X坐标的左边
  377.            i.x += 5 + (2 * index)        # 如果是则会以+5的速度往右移动
  378.            i.opacity += 10               # 同时透明度会增加
  379.            if i.x >= COMMANDS_POS[0]     # 如果命令移动到设定的坐标或右边
  380.               i.x = COMMANDS_POS[0]      # 则把命令固定
  381.               i.opacity = 255            # 同时透明度提到最高
  382.               if @phase_time < 15 / 2    # 如果阶段时间小于15/2,就重置@phase_time
  383.                  @phase_time = 15        # 即重新定义,或说是设置第一阶段持续的时间
  384.               end   
  385.            end  
  386.          end
  387.          index += 1                      #索引+?然后循环的时候又置0?没懂
  388.       end  
  389. end  
  390.     # 以上这个update做完一帧之后,就会接行下面这个 update_command
  391.  
  392. #--------------------------------------------------------------------------
  393. # ● Update Command
  394. #--------------------------------------------------------------------------              
  395. def update_command
  396.      return if @phase != 2   
  397.      # 如果不是第二阶段就返回空值,那就会继续去做第一阶段的update,也就是上面那个update_initial_animation
  398.  
  399.      update_command_slide
  400.      update_cursor_position
  401. end
  402.  
  403. #--------------------------------------------------------------------------
  404. # ● Update Command Slide
  405. #--------------------------------------------------------------------------               
  406. def update_command_slide
  407.      if @commands_index_old != @command_window.index # create_commands预设了@commands_index_old = -1
  408.         @commands_index_old = @command_window.index  # 如果预设索引和当前索引不一样,则设为一样
  409.         @commands_shake_duration = 30                # 并且设置抖动持续时间 30
  410.      end
  411.      #以上,也就意味着,如果预设的和最新的索引相同,就不再抖动了
  412.  
  413.  
  414.      return if @commands_shake_duration == 0         # 如果持续时间为0,返回空值
  415.      @commands_shake_duration -= 1 if @commands_shake_duration > 0   # 如果持续时间>0,刚减1   
  416.      for i in @commands                              # create_commands预设的Z坐标是 sprite.z = 100 + index
  417.        if (i.z - 100) == @command_window.index       # 所分别是101,102,103,i.z是否与当前的命令索引相同
  418.           i.opacity += 10                            # 如果是当前命令,则透明度+10                     
  419.           @cursor_position = [COMMANDS_POS[0] + CURSOR_POS[0],i.y + CURSOR_POS[1]]  # 移动光标至当命令的坐标
  420.           i.x = COMMANDS_POS[0] + rand(@commands_shake_duration)  #设置当前命令位图向右随机抖动坐标
  421.        else  
  422.           i.opacity -= 7 if i.opacity > 100          # 如果i不是当前命令,则会变透明
  423.           i.x = COMMANDS_POS[0]                      # 设置X坐标
  424.        end
  425.      end  
  426. end
  427.  
  428. end
  429.  
  430. $mog_rgss3_animated_title_a = true
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
624
在线时间
471 小时
注册时间
2015-8-23
帖子
70
4
 楼主| 发表于 2024-4-27 16:15:43 | 只看该作者
脚本里的class Window_TitleCommand < Window_HorzCommand看看  改了就没报错了
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
624
在线时间
471 小时
注册时间
2015-8-23
帖子
70
5
 楼主| 发表于 2024-4-27 16:16:47 | 只看该作者
djs789783 发表于 2024-4-27 07:19
感谢感谢,。不过,,在这个脚本里修改后,会出错,这个脚本还带一些小玩意的,我发给你看。很多人用这个脚 ...

脚本里的第43行     改成class Window_TitleCommand < Window_HorzCommand看看  改了就没报错了
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-7 00:24

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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