扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 137|回复: 0

[转载发布] 【不是创意的创意】上下左右都能选择的脚本

[复制链接]
累计送礼:
0 个
累计收礼:
0 个
  • TA的每日心情
    开心
    昨天 18:01
  • 签到天数: 114 天

    连续签到: 4 天

    [LV.6]常住居民II

    2338

    主题

    403

    回帖

    1万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    6
    卡币
    10622
    OK点
    16
    推广点
    0
    同能卷
    0
    积分
    13391

    灌水之王

    发表于 2024-4-19 15:59:43 | 显示全部楼层 |阅读模式
    这个脚本特点我不用截图了。其实就是模仿以前的游戏的特点,4个键都能选择。
    上=左,下=右,左=上,右=下,另外加入了左右循环功能,强烈推荐使用。
    1. #==============================================================================# 本脚本来自www.66RPG.com,使用和转载请保留此信息#==============================================================================#---------------------------------------------------------------------------#其实就是模仿以前的老游戏的特点,4个键都能选择菜单。#上=左,下=右,左=上,右=下,另外加入了左右循环功能,强烈推荐使用。#---------------------------------------------------------------------------class Window_Selectable  #--------------------------------------------------------------------------  # ● 刷新画面  #--------------------------------------------------------------------------  def update    super    # 可以移动光标的情况下    if self.active and @item_max > 0 and @index >= 0      # 方向键下被按下的情况下      if Input.repeat?(Input::DOWN)        # 列数不是 1 并且方向键的下的按下状态不是重复的情况、        # 或光标位置在(项目数-列数)之前的情况下        if (@column_max == 1 and Input.trigger?(Input::DOWN)) or           @index < @item_max - @column_max          # 光标向下移动          $game_system.se_play($data_system.cursor_se)          @index = (@index + @column_max) % @item_max        else          if @column_max >= 2 and  @index == @item_max - 1          $game_system.se_play($data_system.cursor_se)          @index = -1          end          # 列数为 2 以上并且、光标位置在(项目数 - 1)之前的情况下          if @column_max >= 2 and @index < @item_max - 1           # 光标向右移动           $game_system.se_play($data_system.cursor_se)           @index += 1          end         end      end      # 方向键上被按下的情况下      if Input.repeat?(Input::UP)        # 列数不是 1 并且方向键的下的按下状态不是重复的情况、        # 或光标位置在列之后的情况下        if (@column_max == 1 and Input.trigger?(Input::UP)) or           @index >= @column_max          # 光标向上移动          $game_system.se_play($data_system.cursor_se)          @index = (@index - @column_max + @item_max) % @item_max        else           if  @column_max >= 2 and @index == 0          $game_system.se_play($data_system.cursor_se)          @index = @item_max          end                 # 列数为 2 以上并且、光标位置在 0 之后的情况下          if @column_max >= 2 and @index > 0          # 光标向左移动          $game_system.se_play($data_system.cursor_se)          @index -= 1          end        end      end      # 方向键右被按下的情况下      if Input.repeat?(Input::RIGHT)               if @column_max >= 2 and @index == @item_max - 1          $game_system.se_play($data_system.cursor_se)          @index = -1        end         # 列数为 2 以上并且、光标位置在(项目数 - 1)之前的情况下        if @column_max >= 2 and @index < @item_max - 1           # 光标向右移动           $game_system.se_play($data_system.cursor_se)           @index += 1        else          # 列数不是 1 并且方向键的下的按下状态不是重复的情况、          # 或光标位置在(项目数-列数)之前的情况下          if (@column_max == 1 and Input.trigger?(Input::RIGHT)) or           @index < @item_max - @column_max          # 光标向下移动          $game_system.se_play($data_system.cursor_se)          @index = (@index + @column_max) % @item_max          end        end        end           # 方向键左被按下的情况下      if Input.repeat?(Input::LEFT)        if  @column_max >= 2 and @index == 0          $game_system.se_play($data_system.cursor_se)          @index = @item_max        end              # 列数为 2 以上并且、光标位置在 0 之后的情况下        if @column_max >= 2 and @index > 0         # 光标向左移动          $game_system.se_play($data_system.cursor_se)          @index -= 1        else          # 列数不是 1 并且方向键的下的按下状态不是重复的情况、          # 或光标位置在列之后的情况下          if (@column_max == 1 and Input.trigger?(Input::LEFT)) or           @index >= @column_max          # 光标向上移动          $game_system.se_play($data_system.cursor_se)          @index = (@index - @column_max + @item_max) % @item_max          end        end      end      # R 键被按下的情况下      if Input.repeat?(Input::R)        # 显示的最后行在数据中最后行上方的情况下        if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)          # 光标向后移动一页          $game_system.se_play($data_system.cursor_se)          @index = [@index + self.page_item_max, @item_max - 1].min          self.top_row += self.page_row_max        end      end      # L 键被按下的情况下      if Input.repeat?(Input::L)        # 显示的开头行在位置 0 之后的情况下        if self.top_row > 0          # 光标向前移动一页          $game_system.se_play($data_system.cursor_se)          @index = [@index - self.page_item_max, 0].max          self.top_row -= self.page_row_max        end      end    end    # 刷新帮助文本 (update_help 定义了继承目标)    if self.active and @help_window != nil      update_help    end    # 刷新光标矩形    update_cursor_rect  endend#==============================================================================# 本脚本来自www.66RPG.com,使用和转载请保留此信息#============================================================================== 复制代码
    复制代码
                 本帖来自P1论坛作者轮回者,因Project1站服务器在国外有时候访问缓慢不方便作者交流学习,经联系P1站长fux2同意署名转载一起分享游戏制作经验,共同为国内独立游戏作者共同创造良好交流环境,原文地址:https://rpg.blue/forum.php?mod=viewthread&tid=49005  若有侵权,发帖作者可联系底部站长QQ在线咨询功能删除,谢谢。
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2025-3-15 00:10 , Processed in 0.113817 second(s), 54 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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