class Interpreter def initialisation @windows = [] end def nouvelle_fenetre(x,y,w,h,o) windowlen = Window_Base.new(x,y,w,h) windowlen.contents = Bitmap.new(w - 32, h - 32) windowlen.contents.font.name = $fontface windowlen.contents.font.size = $fontsize windowlen.opacity = o @windows.push(windowlen) end def fermer_fenetre(id) id -= 1 if @windows[id].disposed? id += 1 print "La fenetre " + id.to_s + " n'existe pas ou a déjà été fermée." else @windows[id].dispose end end def bouger_fenetre(id, speed, angle, len) id -= 1 if @windows[id].disposed? id += 1 print "La fenetre " + id.to_s + " n'existe pas ou a déjà été fermée." else path = 0 angle = Math::PI*angle/180 cosx = (Math.cos(angle)*speed).to_i siny = (Math.sin(angle)*speed).to_i loop do path += 1 @windows[id].x += cosx @windows[id].y -= siny Graphics.update if path == len break end end end end def ajouter_image(id,x,y,o,file) id -= 1 if @windows[id].disposed? id += 1 print "La fenetre " + id.to_s + " n'existe pas ou a déjà été fermée." else bitmap = RPG::Cache.picture(file) rect = Rect.new(0, 0, bitmap.width, bitmap.height) @windows[id].contents.blt(x, y, bitmap, rect, o) end end def ajouter_texte(id,x,y,w,h,text, color, o) id -= 1 if @windows[id].disposed? id += 1 print "La fenetre " + id.to_s + " n'existe pas ou a déjà été fermée." else if w == "auto" w = text.size end if h == "auto" h = 32 end case color when "noir" color = Color.new(0,0,0,o) when "rouge" color = Color.new(255,0,0,o) when "blanc" color = Color.new(0,0,0,o) else color = Color.new(color[0,3].to_i,color[4,3].to_i,color[8,3].to_i,o) end @windows[id].contents.font.color = color @windows[id].contents.draw_text(x, y, w, h, text) end end def changer_skin(id, file) id -= 1 if @windows[id].disposed? id += 1 print "La fenetre " + id.to_s + " n'existe pas ou a déjà été fermée." else @windows[id].windowskin = RPG::Cache.windowskin(file) end end end
|