alpha und beta
23.08.2007, 21:04
Also,ich habe mir den rpgmakerxp vor 3Tage gekauft und wollte wissen:
#///////////////////////HTML-Rendering-Engine/////////////////////////////////
#~~~~~~~~~~~~~~~~by Caesar~~~~~~~~~~~~~~~~~~~
#\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
class Bitmap
def draw_shadow_text(x, y, width, height, str, align=0)
color = font.color.dup
font.color = Color.new(192, 192, 192, 156)
draw_text(x+2, y+2, width, height, str, align)
font.color = color
draw_text(x, y, width, height, str, align)
end
#----------------
def draw_html(x, y, width, height, str)
# remember string and font variables
str = str.dup
color = font.color.dup
bold = font.bold
italic = font.italic
size = font.size
name = font.name.dup
#::::::::::
shadow = false
underlined = false
opacity = 255
str.gsub!(/<if=([0-9]+)>(.+?)<else>(.+?)<\/if>/) {$game_switches[$1.to_i] ? $2 : $3}
str.gsub!(/<var=([0-9]+)>/) {$game_variables[$1.to_i].to_s}
str.gsub!(/<eval={(.+?)}>/) {eval $1}
str.gsub!(/<style=([A-Za-z0-9_-]+)>(.+?)<\/style>/) {
STYLES.has_key?($1) ? STYLES[$1].sub("|", $2) : ""
} if defined?(STYLES)
str.gsub!(/<br>/) {"\n"}
str.gsub!(/\\\\/) {"\00"}
str.gsub!(/<b>/) {"\01"}
str.gsub!(/<\/b>/) {"\02"}
str.gsub!(/<i>/) {"\03"}
str.gsub!(/<\/i>/) {"\04"}
str.gsub!(/<color=(#?[0-9a-z_]+)>/) {"\05[#{$1}]"}
str.gsub!(/<\/color>/) {"\06"}
str.gsub!(/<shadow>/) {"\16"}
str.gsub!(/<\/shadow>/) {"\17"}
str.gsub!(/<small>/) {"\20"}
str.gsub!(/<\/small>/) {"\21"}
str.gsub!(/<big>/) {"\23"}
str.gsub!(/<\/big>/) {"\21"}
str.gsub!(/<size=([0-9]+)>/) {"\24[#{$1}]"}
str.gsub!(/<\/size>/) {"\21"}
str.gsub!(/<font=([A-Za-z0-9\s]+)>/) {"\25[#{$1}]"}
str.gsub!(/<\/font>/) {"\26"}
str.gsub!(/<u>/) {"\27"}
str.gsub!(/<\/u>/) {"\30"}
str.gsub!(/<icon=([_A-Za-z0-9-]+)>/) {"\11[#{$1}]"}
str.gsub!(/<image=([_A-Za-z0-9-]+)>/) {"\31[#{$1}]"}
str.gsub!(/<down=([0-9]+)>/) {"\22[#{$1}]"}
str.gsub!(/<space=([0-9]+)>/) {"\100[#{$1}]"}
str.gsub!(/<line>/) {"\07"}
ix = 0
iy = 0
while ((c = str.slice!(/./m)) != nil)
if c == "\00" # \\
c = "\\"
end
if c == "\01" # <b>
font.bold = true
wollte wissen wo soll ich das einfügen.
#///////////////////////HTML-Rendering-Engine/////////////////////////////////
#~~~~~~~~~~~~~~~~by Caesar~~~~~~~~~~~~~~~~~~~
#\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
class Bitmap
def draw_shadow_text(x, y, width, height, str, align=0)
color = font.color.dup
font.color = Color.new(192, 192, 192, 156)
draw_text(x+2, y+2, width, height, str, align)
font.color = color
draw_text(x, y, width, height, str, align)
end
#----------------
def draw_html(x, y, width, height, str)
# remember string and font variables
str = str.dup
color = font.color.dup
bold = font.bold
italic = font.italic
size = font.size
name = font.name.dup
#::::::::::
shadow = false
underlined = false
opacity = 255
str.gsub!(/<if=([0-9]+)>(.+?)<else>(.+?)<\/if>/) {$game_switches[$1.to_i] ? $2 : $3}
str.gsub!(/<var=([0-9]+)>/) {$game_variables[$1.to_i].to_s}
str.gsub!(/<eval={(.+?)}>/) {eval $1}
str.gsub!(/<style=([A-Za-z0-9_-]+)>(.+?)<\/style>/) {
STYLES.has_key?($1) ? STYLES[$1].sub("|", $2) : ""
} if defined?(STYLES)
str.gsub!(/<br>/) {"\n"}
str.gsub!(/\\\\/) {"\00"}
str.gsub!(/<b>/) {"\01"}
str.gsub!(/<\/b>/) {"\02"}
str.gsub!(/<i>/) {"\03"}
str.gsub!(/<\/i>/) {"\04"}
str.gsub!(/<color=(#?[0-9a-z_]+)>/) {"\05[#{$1}]"}
str.gsub!(/<\/color>/) {"\06"}
str.gsub!(/<shadow>/) {"\16"}
str.gsub!(/<\/shadow>/) {"\17"}
str.gsub!(/<small>/) {"\20"}
str.gsub!(/<\/small>/) {"\21"}
str.gsub!(/<big>/) {"\23"}
str.gsub!(/<\/big>/) {"\21"}
str.gsub!(/<size=([0-9]+)>/) {"\24[#{$1}]"}
str.gsub!(/<\/size>/) {"\21"}
str.gsub!(/<font=([A-Za-z0-9\s]+)>/) {"\25[#{$1}]"}
str.gsub!(/<\/font>/) {"\26"}
str.gsub!(/<u>/) {"\27"}
str.gsub!(/<\/u>/) {"\30"}
str.gsub!(/<icon=([_A-Za-z0-9-]+)>/) {"\11[#{$1}]"}
str.gsub!(/<image=([_A-Za-z0-9-]+)>/) {"\31[#{$1}]"}
str.gsub!(/<down=([0-9]+)>/) {"\22[#{$1}]"}
str.gsub!(/<space=([0-9]+)>/) {"\100[#{$1}]"}
str.gsub!(/<line>/) {"\07"}
ix = 0
iy = 0
while ((c = str.slice!(/./m)) != nil)
if c == "\00" # \\
c = "\\"
end
if c == "\01" # <b>
font.bold = true
wollte wissen wo soll ich das einfügen.