Advertisement
WCouillard

RGSS3: VE SFonts 1.01 Add-On: Custom Spacing

Feb 26th, 2014
484
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 6.55 KB | None | 0 0
  1. # ╔══════════════════════════════════════════════════════╤═══════╤════════════╗
  2. # ║ Victor Engine SFont 1.01 Add-On: Custom Spacing      │ v1.00 │ (12/25/13) ║
  3. # ╠══════════════════════════════════════════════════════╧═══════╧════════════╣
  4. # ║ Author  : William Couillard                                               ║
  5. # ║ E-Mail  : cooliebk18@yahoo.com                                            ║
  6. # ║ Website : http://ffdiscovery.wikia.com                                    ║
  7. # ╠═══════════════════════════════════════════════════════════════════════════╣
  8. # ║ ABOUT                                                                     ║
  9. # ╠═══════════════════════════════════════════════════════════════════════════╣
  10. # ║ This script allows the user to change the number of pixels used as space  ║
  11. # ║ between each letter when using Victor Engine - SFonts 1.01. By default,   ║
  12. # ║ the original script forces 12 pixels of space, which may be too few or    ║
  13. # ║ too many, depending on the SFont files used.                              ║
  14. # ╠═══════════════════════════════════════════════════════════════════════════╣
  15. # ║ TERMS OF USE                                                              ║
  16. # ╠═══════════════════════════════════════════════════════════════════════════╣
  17. # ║ ► Do not edit the script's header or comments.                            ║
  18. # ║ ► Free to use in commercial projects as long as proper credit is given to ║
  19. # ║   ALL the names in the above header.                                      ║
  20. # ╠═══════════════════════════════════════════════════════════════════════════╣
  21. # ║ CHANGE LOG                                                                ║
  22. # ╠═════════════════════════════════════════════════════════════════╤═════════╣
  23. # ║ ■ December 25, 2013 : Initial release.                          │ (v1.00) ║
  24. # ╠═════════════════════════════════════════════════════════════════╧═════════╣
  25. # ║ OVERWRITTEN METHODS                                                       ║
  26. # ╠═══════════════════════════════════════════════════════════════════════════╣
  27. # ║   This script overwrites a method in Victor Engine - SFonts 1.01.         ║
  28. # ╟───────────────────────────────────────────────────────────────────────────╢
  29. # ║ ■ class SFont                                                             ║
  30. # ║    ► def initialize                                                       ║
  31. # ╠═══════════════════════════════════════════════════════════════════════════╣
  32. # ║ INSTRUCTIONS                                                              ║
  33. # ╠═══════════════════════════════════════════════════════════════════════════╣
  34. # ║ Paste this script directly UNDERNEATH Victor Engine - SFonts 1.01 script. ║
  35. # ╠═══════════════════════════════════════════════════════════════════════════╣
  36. # ║ IMPORT SETTING                                                            ║
  37. # ╚═══════════════════════════════════════════════════════════════════════════╝
  38. module Victor_Engine
  39.                        # ╔════════════════════════════════════════════════════╗
  40.   VE_SFONT_SPACING = 6 # ║ Set the number of pixels between each letter here. ║
  41.                        # ╚════════════════════════════════════════════════════╝
  42. end
  43. #==============================================================================
  44. # ** SFont
  45. #------------------------------------------------------------------------------
  46. #  This class handles the SFonts
  47. #==============================================================================
  48.  
  49. class SFont
  50.   #--------------------------------------------------------------------------
  51.   # * initialize
  52.   #--------------------------------------------------------------------------
  53.   def initialize(name)
  54.     @bitmap = Cache.sfont(name)
  55.     @height = @bitmap.height + 4
  56.     @skip   = @bitmap.get_pixel(0, 0)
  57.     @digits = VE_SFONT_DIGITS
  58.     @alpha  = 255
  59.     @values = {}
  60.     @values[" "] = Rect.new(-12, 0, VE_SFONT_SPACING, @height)
  61.     setup_digits
  62.     @values.default = @values[" "]
  63.   end
  64. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement