TheoAllen

Theo - Custom Text Color

Jun 29th, 2013
389
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.18 KB | None | 0 0
  1. # =============================================================================
  2. # TheoAllen - Custom Text Color
  3. # Version : 1.0
  4. # Contact : www.rpgmakerid.com (or) http://theolized.blogspot.com
  5. # (English Documentation)
  6. # =============================================================================
  7. ($imported ||={})[:Theo_TextColor] = true
  8. # =============================================================================
  9. # CHANGE LOGS:
  10. # -----------------------------------------------------------------------------
  11. # 2013.06.29 - Finished snippet
  12. # =============================================================================
  13. =begin
  14.  
  15.   Introduction :
  16.   This script is simply add more color choice in color escape command. By
  17.   default, RMVXA just provided text color codes from 0 until 31.
  18.  
  19.   How to use :
  20.   Put this script below material but above main.
  21.   Edit the editable region.
  22.  
  23.   Use color escape command to change the color. For example :
  24.   \C[50]
  25.  
  26.   The number 50, must exist in the editable region
  27.  
  28.   Terms of use :
  29.   This just a simple snippet. You're free to edit by your own. Credit isn't
  30.   necessary. But I will be thankful if you put my name in your credit list.
  31.   Free for commercial and non-commercial purposes
  32.  
  33. =end
  34. # =============================================================================
  35. # Editable region :
  36. # =============================================================================
  37. module THEO
  38.   module COLOR
  39.     ID = {
  40.    
  41.   # id => Color.new(red,green,blue),
  42.  
  43.     32 => Color.new(255,  255, 255),
  44.     33 => Color.new(128,  128, 128),
  45.     34 => Color.new(  0,  255, 255),
  46.     35 => Color.new(255,    0, 255),
  47.     36 => Color.new(255,  255,   0),
  48.    
  49.   # Remember. The maximal value of each color is 255
  50.    
  51.     } # <-- Don't touch this
  52.   end
  53. end
  54. # =============================================================================
  55. # End of editable region
  56. # =============================================================================
  57. class Window_Base < Window
  58.  
  59.   alias ori_text_color text_color
  60.   def text_color(n)
  61.     return ori_text_color(n) if n < 32
  62.     return THEO::COLOR::ID[n] rescue normal_color
  63.   end
  64.  
  65. end
Advertisement
Add Comment
Please, Sign In to add comment