[VX]DISPLAYING ICONS
Posts
Pages:
1
This might be very simple but I can't figure it out.
I manage to display icons in dialogue boxes but can't do so in the Databse/terms/parameters
This is what happens:
Could explain to me how I could make the \IC function work everywhere in my game?
I'm using the following script to display icons in my game:
I manage to display icons in dialogue boxes but can't do so in the Databse/terms/parameters
This is what happens:
Could explain to me how I could make the \IC function work everywhere in my game?
I'm using the following script to display icons in my game:
#==============================================================================
# ** Window_Message
#------------------------------------------------------------------------------
# This message window is used to display text.
#==============================================================================
class Window_Message
#--------------------------------------------------------------------------
# * Convert Special Characters
#--------------------------------------------------------------------------
alias crea_convert_special_characters convert_special_characters
def convert_special_characters
crea_convert_special_characters
@text.gsub!(/\\IC\[([0-9]+)\]/i) { "\x09[#{$1}]" }
end
#--------------------------------------------------------------------
# * Update Message
#--------------------------------------------------------------------------
def update_message
loop do
c = @text.slice!(/./m) # Get next text character
case c
when nil # There is no text that must be drawn
finish_message # Finish update
break
when "\x00" # New line
new_line
if @line_count >= MAX_LINE # If line count is maximum
unless @text.empty? # If there is more
self.pause = true # Insert number input
break
end
end
when "\x01" # \C[n] (text character color change)
@text.sub!(/\[([0-9]+)\]/, "")
contents.font.color = text_color($1.to_i)
next
when "\x02" # \G (gold display)
@gold_window.refresh
@gold_window.open
when "\x03" # \. (wait 1/4 second)
@wait_count = 15
break
when "\x04" # \| (wait 1 second)
@wait_count = 60
break
when "\x05" # \! (Wait for input)
self.pause = true
break
when "\x06" # \> (Fast display ON)
@line_show_fast = true
when "\x07" # \< (Fast display OFF)
@line_show_fast = false
when "\x08" # \^ (No wait for input)
@pause_skip = true
when "\x09" # \IC[n] (show icon)
@text.sub!(/\[([0-9]+)\]/, "")
draw_icon($1.to_i, @contents_x, @contents_y)
@contents_x += 24
else # Normal text character
contents.draw_text(@contents_x, @contents_y, 40, WLH, c)
c_width = contents.text_size(c).width
@contents_x += c_width
end
break unless @show_fast or @line_show_fast
end
end
end
Weird, I just posted this the other day in response to several other requests...
http://www.hbgames.org/forums/viewtopic.php?p=827298#p827298
Unfortunately, it doesn't currently handle icons. But you could combine your code in update_message with my code in 'draw_text' to implement icons as well. However you would need to break up the string at the icons, then call the 'draw_parsed_text' method for each substring.
Or draw each character separately like you do in update_message.
Do you only need icons at the beginning of the text? or anywhere in the text? (multiple icons?)
http://www.hbgames.org/forums/viewtopic.php?p=827298#p827298
Unfortunately, it doesn't currently handle icons. But you could combine your code in update_message with my code in 'draw_text' to implement icons as well. However you would need to break up the string at the icons, then call the 'draw_parsed_text' method for each substring.
Or draw each character separately like you do in update_message.
Do you only need icons at the beginning of the text? or anywhere in the text? (multiple icons?)
Pages:
1
















