查看: 52|回复: 0

[转载发布] 一个实用的提示脚本

[复制链接]
  • TA的每日心情
    开心
    7 天前
  • 签到天数: 37 天

    连续签到: 3 天

    [LV.5]常住居民I

    2028

    主题

    32

    回帖

    7260

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    0
    卡币
    5184
    OK点
    16
    积分
    7260
    发表于 同元一千年八月四日(秋) | 显示全部楼层 |阅读模式
    做游戏衍生出的东西,现在献丑拿出来发布一下


    功能:显示提示框(与得失物品提示脚本不同的是,该对话框可以随着地图刷新,不影响游戏流畅)
    使用方法:在事件中输入脚本    tip("提示内容") 即可
    1. $提示框弹出时间 = 20class Window_Tip < Window_Base  def initialize    super(0,300,128,64)    self.contents_opacity = 0    self.opacity = 0    self.contents = Bitmap.new(width - 32, height - 32)    self.z = 9999    @p = 0  end  def refresh    text = $game_temp.tipping    self.x = (580-(text.to_s.size / 3 * 32))/2    self.width = (text.to_s.size / 3 * 32)+32    self.contents = Bitmap.new(width - 32, height - 32)     self.contents.draw_text(0, -2, (text.to_s.size / 3 * 32), 32, text,1)    case @p    when 0..40       self.opacity += 30       self.contents_opacity += 30    when (40 + $提示框弹出时间)..(80 + $提示框弹出时间)       self.opacity -= 30       self.contents_opacity -= 30     when (81 + $提示框弹出时间)      $game_temp.tipping = nil      self.opacity = 0      self.contents_opacity = 0      @p = -1    end    @p += 1  endendclass Game_Temp  attr_accessor :tippingendclass Interpreter  def tip(text)    $game_temp.tipping = text  endendclass Scene_Map  alias b_m main  def main    @tip = Window_Tip.new    b_m    @tip.dispose  end  alias u update  def update    @tip.refresh if $game_temp.tipping    u  endend复制代码
    复制代码
                 本帖来自P1论坛作者heiwang1997,因Project1站服务器在国外有时候访问缓慢不方便作者交流学习,经联系P1站长fux2同意署名转载一起分享游戏制作经验,共同为国内独立游戏作者共同创造良好交流环境,原文地址:https://rpg.blue/forum.php?mod=viewthread&tid=249642  若有侵权,发帖作者可联系底部站长QQ在线咨询功能删除,谢谢。
    天天去同能,天天有童年!
    回复 论坛版权

    使用道具 举报

    ahome_bigavatar:guest
    ahome_bigavatar:welcomelogin
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

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

    GMT+8, 2024-5-17 20:21 , Processed in 0.046060 second(s), 43 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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