Project1

标题: 物品裝備的說明問題 [打印本页]

作者: 米血    时间: 2013-6-19 23:03
标题: 物品裝備的說明問題
本帖最后由 米血 于 2013-6-22 09:01 编辑

物品或裝備的說明簡介如果過長字體都會被壓縮
搜尋到的古文似乎都沒有答案
曾經有看過別人的作品的說明文是跑馬燈方式
那種的是腳本嗎?
作者: 彭格列第XI代    时间: 2013-6-20 22:25
跑馬燈方式= =?
作者: a364774426    时间: 2013-6-21 22:55
  1. #===============================================================================
  2. # Scrolling Window_Help
  3. #-------------------------------------------------------------------------------
  4. # Version: 1.1a
  5. # Author: Cozziekuns (rmrk)
  6. # Last Date Updated: 12/6/2011
  7. #===============================================================================
  8. # Description:
  9. #-------------------------------------------------------------------------------
  10. # This script allows you to auto scroll the text in Window_Help if it becomes
  11. # too long for the window to hold. Originally, RPG Maker would auto resize the
  12. # text to make it thin and aesthetically displeasing to the eye.
  13. #===============================================================================
  14. # Updates
  15. # ------------------------------------------------------------------------------
  16. # o 12/06/2011 - Started Script
  17. # o 09/07/2011 - Updated script with a bugfix.
  18. #===============================================================================
  19. # Instructions
  20. # ------------------------------------------------------------------------------
  21. # Copy and paste this script above ? Main Process but below ? Materials, and
  22. # edit the modules to your liking.
  23. #===============================================================================

  24. module COZZIEKUNS
  25.   module SCROLLING_WINDOW_HELP
  26.     SCROLL_SPEED = 1 # The higher the scroll speed, the faster the text will scroll.
  27.     SCROLL_REFRESH_RATE = 1 # The lower the refresh rate, the faster the text will scroll.
  28.     SCROLL_INITIAL_WAIT = 60 # The amount of time before the text starts to scroll (in milliseconds)
  29.   end
  30. end

  31. #==============================================================================
  32. # ** Window_Help
  33. #------------------------------------------------------------------------------
  34. #  This window shows skill and item explanations along with actor status.
  35. #==============================================================================

  36. class Window_Help < Window_Base
  37.   #--------------------------------------------------------------------------
  38.   # * Object Initialization
  39.   #--------------------------------------------------------------------------
  40.   alias coz_scrolltxt_wh_14199_initialize initialize
  41.   def initialize(*args)
  42.     coz_scrolltxt_wh_14199_initialize
  43.     @scroll = false
  44.     @frames = 0
  45.   end
  46.   #--------------------------------------------------------------------------
  47.   # * Set Text
  48.   #  text  : character string displayed in window
  49.   #  align : alignment (0..flush left, 1..center, 2..flush right)
  50.   #--------------------------------------------------------------------------
  51.   def set_text(text, align = 0)
  52.     if text != @text or align != @align
  53.       text_width = contents.text_size(text).width + 40 > self.contents.width - 40
  54.       text_width = false if align != 0
  55.       if text_width
  56.         self.contents = Bitmap.new(self.width + contents.text_size(text).width + 8, self.height - 32)
  57.         @scroll = true
  58.       else
  59.         self.contents = Bitmap.new(self.width - 32, self.height - 32)
  60.         @scroll = false
  61.       end
  62.       self.ox = 0
  63.       self.contents.clear
  64.       self.contents.font.color = normal_color
  65.       self.contents.draw_text(4, 0, text_width ? self.contents.text_size(text).width : self.width - 40, WLH, text, align)
  66.       @text = text
  67.       @align = align
  68.       @frames = 0
  69.     end
  70.   end
  71.   #--------------------------------------------------------------------------
  72.   # * Frame Update
  73.   #--------------------------------------------------------------------------
  74.   def update
  75.     @frames += 1
  76.     f_refresh = COZZIEKUNS::SCROLLING_WINDOW_HELP::SCROLL_REFRESH_RATE
  77.     f_wait = COZZIEKUNS::SCROLLING_WINDOW_HELP::SCROLL_INITIAL_WAIT
  78.     speed = COZZIEKUNS::SCROLLING_WINDOW_HELP::SCROLL_SPEED
  79.     if @scroll == true
  80.       if (Graphics.frame_count % f_refresh == 0) and @frames >= f_wait
  81.         self.ox += speed
  82.       end
  83.       if self.ox >= self.contents.text_size(@text).width
  84.         self.ox = -self.contents.text_size(@text).width / 2
  85.       end
  86.     end
  87.   end
  88. end
复制代码





欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1