设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 67|回复: 0

[转载发布] TSR_NumPad

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    2026-7-12 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    9015

    主题

    864

    回帖

    6万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    58751
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    68660

    灌水之王

    发表于 2026-7-16 19:04:41 | 显示全部楼层 |阅读模式




    Authors
    Initial idea: @ShadowDragon
    programming: TSR

    download
    TSR_NumPad

    This plugin replace the default number input process with a numeric pad where digits are input from right to left like a classic calculator. Navigate the pad with keyboard arrows or mouse, or directly type the digits on the keyboard to input numbers in game.

    HOW TO USE:

         -Install the plugin in your Plugin Manager
         -Use the default event command: 'Number Input Process'

    Same as default, set the max digits and the game variable ID that will store the input number. Once you confirm and close
    the number input pad, the returning value will be stored in that game variable.


    The numeric pad will adjust to the position of the message window.












    The plugin also provide a few additionnal features like the possibility to input negative and floating values.








    All settings are done using plugin commands so each time you need a number input, the numeric pad can be set as needed.
    For further details, consult the plugin instructions:
    Spoiler: Instructions
                    Code:       
    1. * ===================================================================================
    2. * == About this Plugin ==============================================================
    3. * ===================================================================================
    4. * This plugin replace the default number input process with
    5. * a numeric pad. Navigate the pad with keyboard arrows or
    6. * mouse, or directly type the digits on the keyboard to
    7. * input numbers in game.
    8. *
    9. * HOW TO USE:
    10. *
    11. *      -Install the plugin in your Plugin Manager
    12. *      -Use the default event command: 'Number Input Process'
    13. *
    14. * Same as default, set the max digits and the game variable ID
    15. * that will store the input number. Once you confirm and close
    16. * the number input pad, the returning value will be stored in
    17. * that game variable.
    18. *
    19. *
    20. * Using plugin commands, you can set 3 different layouts for the
    21. * numeric panel:
    22. *
    23. * Layout 1
    24. * ========
    25. * This is the basic layout:
    26. *
    27. *     1  2  3
    28. *     4  5  6
    29. *     7  8  9
    30. *     C  0  Ok
    31. *
    32. * Buttons:
    33. *    Digits [0-9] = input a digit
    34. *              Ok = confirm the input and close
    35. *               C = delete last digit, close if no inputs
    36. *
    37. *
    38. * Layout 2
    39. * ========
    40. * This layout allow to return negative values.
    41. *
    42. *     1  2  3  C
    43. *     4  5  6  AC
    44. *     7  8  9  +/-
    45. *       0   Ok
    46. *
    47. * Additional buttons:
    48. *              AC = delete all digits, close if no inputs
    49. *             +/- = toggle On/Off the minus sign, return
    50. *                   negative values when On
    51. *                  
    52. *
    53. * Layout 3
    54. * ========
    55. * This layout add the dot (.) button to turn the
    56. * number into a floating value.
    57. *
    58. *     1  2  3  C
    59. *     4  5  6  AC
    60. *     7  8  9  +/-
    61. *     .  0   Ok
    62. *
    63. * Additional button:
    64. *              . = input a dot to turn the number into a
    65. *                  floating value***
    66. *
    67. *
    68. *    *** Floating value ***
    69. *
    70. *  The input number is returned inside a game variable.
    71. *  By default game variables cannot stored floating numerical
    72. *  values, so when the input number is a floating value, the
    73. *  plugin will return the value as a string (text), see bellow.
    74. *
    75. *  ******************************************************
    76. *
    77. *
    78. *
    79. * Plugin commands
    80. * ===============
    81. *
    82. *   -Number input layout:
    83. *          Select between one of the 3 layouts described above
    84. *
    85. *
    86. *   -Number input font face:
    87. *          Select between the main font face or the number font
    88. *          face for the number input windows.
    89. *
    90. *              *the main font face and the number font face are
    91. *               the 2 default font faces set in the data base.
    92. *
    93. *
    94. *   -Input leading zeros:
    95. *          If you want the returning combination to includes '0'
    96. *          in front, like: 0246, you can enable the leading zeros.
    97. *          Note that in this case the returning value will be a
    98. *          string (text), see bellow.
    99. *         
    100. *
    101. *   -Number input auto close:
    102. *          When enabled, the number input windows will automatically
    103. *          confirm and close when the last digits is input.
    104. *
    105. *            Ex:
    106. *              You have set the maximum digits to 4.
    107. *              The number input process will close as
    108. *              soon as a fourth digit is input.
    109. *           
    110. *
    111. *   -Revert digits layout:
    112. *          Revert the first and second digits rows.
    113. *
    114. *           revert        no revert
    115. *          7  8  9         1  2  3
    116. *          4  5  6         4  5  6
    117. *          1  2  3         7  8  9
    118. *
    119. *
    120. *
    121. *   ** String values **
    122. * **********************************************************
    123. * When the returning value is a string, you cannot directly
    124. * compare it to a numerical value, and math operations using
    125. * a string value might render unexpected results.
    126. *
    127. * A string value can be convert to a numerical value using
    128. * the parseInt method in js.
    129. *
    130. *    Ex: parseInt('123') = 123
    131. *
    132. * But doing that will remove any leading zeros and round up
    133. * floating values.
    134. *
    135. * The parseFloat method can be use for returning the floating
    136. * value of a string.
    137. *
    138. *    Ex: parseFloat('0.56') = 0.56
    139. *
    140. *
    141. * For direct comparison, you can simply check if the returing
    142. * value is equal to the corresponding string (between quotes).
    143. *
    144. *    Ex: If the returning value is '00456' and is stored
    145. *        in the game variable X.
    146. *
    147. *        You can check if:
    148. *          $gameVariables.value(X) === '00456'
    149. *
    150. *
    151. * Important notes:
    152. *
    153. *     -Float
    154. *         If you're using the Layout 3. The returning value
    155. *         will be a string only if it contains a dot ('.').
    156. *         Otherwise it will return a numerical value.
    157. *
    158. *     -Leading zeros
    159. *         If you have enabled the 'Leading zeros' option, the
    160. *         returning value will always be a string, even if it
    161. *         doesn't contains any leading zeros.
    162. *
    163. * **********************************************************
    复制代码


                    Code:       
    1. * ================================================================================
    2. * == Term of Usage ===============================================================
    3. * ================================================================================
    4. *
    5. * Use in any independant RPG Maker MZ projects, including commercials.
    6. *
    7. * Credit is required for using this Plugin.
    8. * For crediting, use 'TSR' along with one of
    9. * the following terms:
    10. *      'The Northern Frog' or 'A frog from the north'
    11. *
    12. * Do not change the Header or the Terms of usage.
    13. *
    14. * You can edit it as you like for you project.
    15. *
    16. *
    17. * DO NOT REDISTRIBUTE!
    18. * If you want to share it, share the link to my itch.io account:
    19. * https://the-northern-frog.itch.io/
    20. *
    21. *
    22. * ================================================================================
    复制代码


    Happy game dev!
    Regards.
    TSR



    本贴来自国际rpgmaker官方论坛作者:TSR处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/tsr_numpad.154887/

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

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

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-8-4 21:31 , Processed in 0.104663 second(s), 56 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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