Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # ** Window_Help
- #------------------------------------------------------------------------------
- # This window shows skill and item explanations along with actor status.
- #==============================================================================
- class Window_Help < Window_Base
- #--------------------------------------------------------------------------
- # * Set Text
- #--------------------------------------------------------------------------
- def set_text(t='', a = 0)
- draw_colored_text(t,a) if t != @text || a != @align
- self.visible = true
- end
- #--------------------------------------------------------------------------
- # * Draw Colored Text
- #--------------------------------------------------------------------------
- def draw_colored_text(t='',a=0)
- self.contents.clear
- self.contents.font.color = normal_color
- @text, @align, @actor, x = t.clone, a, nil, 0
- if a != 0
- t.gsub!(/\\[Cc]\[([0-9]+)\]/) { '' }
- return self.contents.draw_text(4,0,self.width-40,32,t,a)
- end
- t.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
- while ((c = t.slice!(/./m)) != nil)
- if c == "\001"
- t.sub!(/\[([0-9]+)\]/, "")
- self.contents.font.color = text_color($1.to_i)
- next
- end
- self.contents.draw_text(4 + x, 32 * 0, 40, 32, c)
- x += self.contents.text_size(c).width
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement