|
| [RMXP]{Script}Supperpostion d'images | |
| | Auteur | Message |
---|
_
Messages : 167
| Sujet: [RMXP]{Script}Supperpostion d'images Ven 23 Juil - 17:14 | |
| Bonjour, Sur Créative, on m'a proposé de modifier la position "z" des images pour qu'elles soient suppérieur à 1000 puisque les images de la map allaient sur le menu. J'ai fait cela et soudain, tous les textes se trouvant dans le script (N'étant pas des images) se sont retrouvé sous les images. Les rendant ainsi foncés. - Citation :
J'imagine qu'il va falloir que je fasse un double-post (Ou même triple) pour afficher tous les scripts dans cette situation. (5 scripts) - Spoiler:
Le premier: - Code:
-
#_______________________________________________________________________________ # MOG_Scene_Equip V1.6 #_______________________________________________________________________________ # By Moghunter # http://www.atelier-rgss.com #_______________________________________________________________________________ module MOG #Transition Time. MSEQPT= 10 #Transition Type. MSEQPTT= "004-Blind04" # Set Maximum (STR,DEX,AGL,INT) MST_ST = 99 # Set Maximum (ATK,PDEF,MDEF) MST_STE = 99 end $mogscript = {} if $mogscript == nil $mogscript["MOG_Scene_Equip"] = true ############### # Window_Base # ############### class Window_Base < Window def nada2(actor) face = RPG::Cache.battler(actor.battler_name, actor.battler_hue) end def draw_heroface2(actor,x,y) face = RPG::Cache.picture(actor.name + "_fc2") rescue nada2(actor) cw = face.width ch = face.height src_rect = Rect.new(0, 0, cw, ch) if face == RPG::Cache.battler(actor.battler_name, actor.battler_hue) self.contents.blt(x + 40 , y - ch - 240, face, src_rect) else self.contents.blt(x , y - ch, face, src_rect) end end def drw_eqpup(x,y,type) case type when 0 est = RPG::Cache.icon("ST_EQU") when 1 est = RPG::Cache.icon("ST_UP") when 2 est = RPG::Cache.icon("ST_DOWN") end cw = est.width ch = est.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x , y - ch, est, src_rect) end def drw_equist(x,y) equist = RPG::Cache.picture("Equip_St") cw = equist.width ch = equist.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x , y - ch, equist, src_rect) end def draw_actor_parameter2(actor, x, y, type) back = RPG::Cache.picture("STBAR_Back") cw = back.width ch = back.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x + 50 , y - ch + 20, back, src_rect) meter = RPG::Cache.picture("STBAR.png") case type when 0 parameter_value = actor.atk cw = meter.width * actor.atk / MOG::MST_STE when 1 parameter_value = actor.pdef cw = meter.width * actor.pdef / MOG::MST_STE when 2 parameter_value = actor.mdef cw = meter.width * actor.mdef / MOG::MST_STE when 3 parameter_value = actor.str cw = meter.width * actor.str / MOG::MST_ST when 4 parameter_value = actor.dex cw = meter.width * actor.dex / MOG::MST_ST when 5 parameter_value = actor.agi cw = meter.width * actor.agi / MOG::MST_ST when 6 parameter_value = actor.int cw = meter.width * actor.int / MOG::MST_ST end self.contents.font.color = normal_color self.contents.draw_text(x + 120, y - 2, 36, 32, parameter_value.to_s, 2) ch = meter.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x + 50 , y - ch + 20, meter, src_rect) end def nada face = RPG::Cache.picture("") end def draw_heroface3(actor,x,y) face = RPG::Cache.picture(actor.name + "_fc3") rescue nada cw = face.width ch = face.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x , y - ch, face, src_rect) end end #################### # Window_EquipLeft # #################### class Window_EquipLeft < Window_Base def initialize(actor) super(0, 64, 272, 446) self.contents = Bitmap.new(width - 32, height - 32) self.opacity = 0 self.contents.font.name = "Georgia" @actor = actor refresh end def refresh self.contents.clear draw_heroface2(@actor, 20, 460) drw_equist(0,390) draw_actor_name(@actor, 4, 0) draw_actor_level(@actor, 4, 32) draw_actor_parameter2(@actor, 10, 164 , 0) draw_actor_parameter2(@actor, 10, 196 , 1) draw_actor_parameter2(@actor, 10, 228 , 2) draw_actor_parameter2(@actor, 10, 260 , 3) draw_actor_parameter2(@actor, 10, 292 , 4) draw_actor_parameter2(@actor, 10, 324 , 5) draw_actor_parameter2(@actor, 10, 356 , 6) if @new_atk != nil self.contents.font.color = system_color if @new_atk < @actor.atk drw_eqpup(170,190,2) self.contents.font.color = Color.new(255,50,50,255) elsif @new_atk > @actor.atk drw_eqpup(170,190,1) self.contents.font.color = Color.new(50,250,150,255) else drw_eqpup(170,190,0) self.contents.font.color = Color.new(255,255,255,255) end self.contents.draw_text(190, 162, 36, 32, @new_atk.to_s, 2) end if @new_pdef != nil if @new_pdef < @actor.pdef drw_eqpup(170,226,2) self.contents.font.color = Color.new(255,50,50,255) elsif @new_pdef > @actor.pdef drw_eqpup(170,226,1) self.contents.font.color = Color.new(50,250,150,255) else drw_eqpup(170,226,0) self.contents.font.color = Color.new(255,255,255,255) end self.contents.draw_text(190, 194, 36, 32, @new_pdef.to_s, 2) end if @new_mdef != nil if @new_mdef < @actor.mdef drw_eqpup(170,258,2) self.contents.font.color = Color.new(255,50,50,255) elsif @new_mdef > @actor.mdef drw_eqpup(170,258,1) self.contents.font.color = Color.new(50,250,150,255) else drw_eqpup(170,258,0) self.contents.font.color = Color.new(255,255,255,255) end self.contents.draw_text(190, 226, 36, 32, @new_mdef.to_s, 2) end if @new_str != nil if @new_str < @actor.str drw_eqpup(170,290,2) self.contents.font.color = Color.new(255,50,50,255) elsif @new_str > @actor.str drw_eqpup(170,290,1) self.contents.font.color = Color.new(50,250,150,255) else drw_eqpup(170,290,0) self.contents.font.color = Color.new(255,255,255,255) end self.contents.draw_text(190, 258, 36, 32, @new_str.to_s, 2) end if @new_dex != nil if @new_dex < @actor.dex drw_eqpup(170,322,2) self.contents.font.color = Color.new(255,50,50,255) elsif @new_dex > @actor.dex drw_eqpup(170,322,1) self.contents.font.color = Color.new(50,250,150,255) else drw_eqpup(170,322,0) self.contents.font.color = Color.new(255,255,255,255) end self.contents.draw_text(190, 290, 36, 32, @new_dex.to_s, 2) end if @new_agi != nil if @new_agi < @actor.agi drw_eqpup(170,354,2) self.contents.font.color = Color.new(255,50,50,255) elsif @new_agi > @actor.agi drw_eqpup(170,354,1) self.contents.font.color = Color.new(50,250,150,255) else drw_eqpup(170,354,0) self.contents.font.color = Color.new(255,255,255,255) end self.contents.draw_text(190, 322, 36, 32, @new_agi.to_s, 2) end if @new_int != nil if @new_int < @actor.int drw_eqpup(170,386,2) self.contents.font.color = Color.new(255,50,50,255) elsif @new_int > @actor.int drw_eqpup(170,386,1) self.contents.font.color = Color.new(50,250,150,255) else drw_eqpup(170,386,0) self.contents.font.color = Color.new(255,255,255,255) end self.contents.draw_text(190, 354, 36, 32, @new_int.to_s, 2) end end def set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex, new_agi, new_int) if @new_atk != new_atk or @new_pdef != new_pdef or @new_mdef != new_mdef or @new_str != new_str or @new_dex != new_dex or @new_agl != new_agi or @new_int != new_int @new_atk = new_atk @new_pdef = new_pdef @new_mdef = new_mdef @new_str = new_str @new_dex = new_dex @new_agi = new_agi @new_int = new_int refresh end end end ##################### # Window_EquipRight # ##################### class Window_EquipRight < Window_Selectable def initialize(actor) super(272, 64, 368, 192) self.contents = Bitmap.new(width - 32, height - 32) self.opacity = 0 self.contents.font.name = "Georgia" @actor = actor refresh self.index = 0 end def item return @data[self.index] end def refresh self.contents.clear @data = [] @data.push($data_weapons[@actor.weapon_id]) @data.push($data_armors[@actor.armor1_id]) @data.push($data_armors[@actor.armor2_id]) @data.push($data_armors[@actor.armor3_id]) @data.push($data_armors[@actor.armor4_id]) @item_max = @data.size self.contents.font.color = system_color draw_item_name(@data[0], 92, 32 * 0) draw_item_name(@data[1], 92, 32 * 1) draw_item_name(@data[2], 92, 32 * 2) draw_item_name(@data[3], 92, 32 * 3) draw_item_name(@data[4], 92, 32 * 4) end def update_help @help_window.set_text(self.item == nil ? "" : self.item.description) end end #################### # Window_EquipItem # #################### class Window_EquipItem < Window_Selectable def initialize(actor, equip_type) super(272, 256, 368, 224) self.opacity = 0 @actor = actor @equip_type = equip_type @column_max = 1 refresh self.active = false self.index = -1 end def item return @data[self.index] end def refresh if self.contents != nil self.contents.dispose self.contents = nil end @data = [] if @equip_type == 0 weapon_set = $data_classes[@actor.class_id].weapon_set for i in 1...$data_weapons.size if $game_party.weapon_number(i) > 0 and weapon_set.include?(i) @data.push($data_weapons[i]) end end end if @equip_type != 0 armor_set = $data_classes[@actor.class_id].armor_set for i in 1...$data_armors.size if $game_party.armor_number(i) > 0 and armor_set.include?(i) if $data_armors[i].kind == @equip_type-1 @data.push($data_armors[i]) end end end end @data.push(nil) @item_max = @data.size self.contents = Bitmap.new(width - 32, row_max * 32) for i in 0...@item_max-1 draw_item(i) end end def draw_item(index) self.contents.font.name = "Georgia" item = @data[index] x = 4 + index % 1 * (288 + 32) y = index / 1 * 32 case item when RPG::Weapon number = $game_party.weapon_number(item.id) when RPG::Armor number = $game_party.armor_number(item.id) end bitmap = RPG::Cache.icon(item.icon_name) self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24)) self.contents.font.color = normal_color self.contents.draw_text(x + 28, y, 212, 32, item.name, 0) self.contents.draw_text(x + 240, y, 16, 32, ":", 1) self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2) end def update_help @help_window.set_text(self.item == nil ? "" : self.item.description) end end ############### # Scene_Equip # ############### class Scene_Equip def initialize(actor_index = 0, equip_index = 0) @actor_index = actor_index @equip_index = equip_index end def main @mnback = Plane.new @spriteset = Spriteset_Map.new @mnback.z = 1 @mnlay = Sprite.new @mnlay.bitmap = RPG::Cache.picture("Equip_Lay") @mnlay.z = 1000 @actor = $game_party.actors[@actor_index] @help_window = Window_Help.new @help_window.opacity = 0 @help_window.x = -300 @help_window.contents_opacity = 0 @left_window = Window_EquipLeft.new(@actor) @left_window.x = -300 @left_window.contents_opacity = 0 @right_window = Window_EquipRight.new(@actor) @item_window1 = Window_EquipItem.new(@actor, 0) @item_window2 = Window_EquipItem.new(@actor, 1) @item_window3 = Window_EquipItem.new(@actor, 2) @item_window4 = Window_EquipItem.new(@actor, 3) @item_window5 = Window_EquipItem.new(@actor, 4) @item_window1.x = 640 @item_window2.x = 640 @item_window3.x = 640 @item_window4.x = 640 @item_window5.x = 640 @right_window.help_window = @help_window @item_window1.help_window = @help_window @item_window2.help_window = @help_window @item_window3.help_window = @help_window @item_window4.help_window = @help_window @item_window5.help_window = @help_window @right_window.index = @equip_index @right_window.x = 640 refresh Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end for i in 0..10 @left_window.x -= 25 @left_window.contents_opacity -= 15 @item_window.x += 30 @item_window.contents_opacity -= 20 @right_window.x += 30 @right_window.contents_opacity -= 20 Graphics.update end Graphics.freeze @help_window.dispose @left_window.dispose @right_window.dispose @item_window1.dispose @item_window2.dispose @item_window3.dispose @item_window4.dispose @item_window5.dispose @spriteset.dispose @mnlay.dispose end def refresh @item_window1.visible = (@right_window.index == 0) @item_window2.visible = (@right_window.index == 1) @item_window3.visible = (@right_window.index == 2) @item_window4.visible = (@right_window.index == 3) @item_window5.visible = (@right_window.index == 4) item1 = @right_window.item case @right_window.index when 0 @item_window = @item_window1 when 1 @item_window = @item_window2 when 2 @item_window = @item_window3 when 3 @item_window = @item_window4 when 4 @item_window = @item_window5 end if @right_window.active @left_window.set_new_parameters(nil, nil, nil,nil, nil, nil,nil) end if @item_window.active item2 = @item_window.item last_hp = @actor.hp last_sp = @actor.sp @actor.equip(@right_window.index, item2 == nil ? 0 : item2.id) new_atk = @actor.atk new_pdef = @actor.pdef new_mdef = @actor.mdef new_str = @actor.str new_dex = @actor.dex new_agi = @actor.agi new_int = @actor.int @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id) @actor.hp = last_hp @actor.sp = last_sp @left_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex,new_agi,new_int) end end def update if @right_window.x > 272 @right_window.x -= 30 elsif @right_window.x <= 272 @right_window.x = 272 end if @item_window.x > 272 @item_window.x -= 30 elsif @item_window.x <= 272 @item_window.x = 272 end if @item_window.active == false if Input.trigger?(Input::UP) or Input.trigger?(Input::DOWN) @item_window.x = 640 end end if @left_window.x < 0 @left_window.x += 25 @left_window.contents_opacity += 15 elsif @left_window.x >= 0 @left_window.x = 0 @left_window.contents_opacity = 255 end if @help_window.x < 0 @help_window.x += 25 @help_window.contents_opacity += 15 elsif @help_window.x >= 0 @help_window.x = 0 @help_window.contents_opacity = 255 end @mnback.ox += 1 @left_window.update @right_window.update @item_window.update if Input.trigger?(Input::B) or Input.trigger?(Input::C) or Input.trigger?(Input.dir4) or Input.trigger?(Input::L) or Input.trigger?(Input::R) or Input.press?(Input.dir4) @help_window.x = -300 @help_window.contents_opacity = 0 refresh end if @right_window.active update_right return end if @item_window.active update_item return end end def update_right if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Menu.new(2) return end if Input.trigger?(Input::C) if @actor.equip_fix?(@right_window.index) $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) @right_window.active = false @item_window.active = true @item_window.index = 0 refresh return end end def update_item if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @right_window.active = true @item_window.active = false @item_window.index = -1 refresh return end if Input.trigger?(Input::C) $game_system.se_play($data_system.equip_se) item = @item_window.item @actor.equip(@right_window.index, item == nil ? 0 : item.id) @right_window.active = true @item_window.active = false @item_window.index = -1 @right_window.refresh @item_window.refresh refresh return end end end Le deuxième: - Code:
-
#_______________________________________________________________________________ # MOG_Scene_Item V1.3 #_______________________________________________________________________________ # By Moghunter # http://www.atelier-rgss.com #_______________________________________________________________________________ module MOG #Transition Time. MNIT = 10 #Transition Type(Name). MNITT = "004-Blind04" end $mogscript = {} if $mogscript == nil $mogscript["MOG_Scene_Item"] = true ############### # Window_Base # ############### class Window_Base < Window def nada face = RPG::Cache.picture("") end def drw_face(actor,x,y) face = RPG::Cache.picture(actor.name + "_fc") rescue nada cw = face.width ch = face.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x , y - ch, face, src_rect) end def draw_maphp3(actor, x, y) back = RPG::Cache.picture("BAR0") cw = back.width ch = back.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x + 65, y - ch + 30, back, src_rect) meter = RPG::Cache.picture("HP_Bar") cw = meter.width * actor.hp / actor.maxhp ch = meter.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x + 65, y - ch + 30, meter, src_rect) text = RPG::Cache.picture("HP_Tx") cw = text.width ch = text.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x + 35, y - ch + 30, text, src_rect) self.contents.font.color = Color.new(0,0,0,255) self.contents.draw_text(x + 81, y - 1, 48, 32, actor.hp.to_s, 2) self.contents.font.color = Color.new(255,255,255,255) self.contents.draw_text(x + 80, y - 2, 48, 32, actor.hp.to_s, 2) end def draw_mapsp3(actor, x, y) back = RPG::Cache.picture("BAR0") cw = back.width ch = back.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x + 65, y - ch + 30, back, src_rect) meter = RPG::Cache.picture("SP_Bar") cw = meter.width * actor.sp / actor.maxsp ch = meter.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x + 65, y - ch + 30, meter, src_rect) text = RPG::Cache.picture("SP_Tx") cw = text.width ch = text.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x + 35, y - ch + 30, text, src_rect) self.contents.font.color = Color.new(0,0,0,255) self.contents.draw_text(x + 81, y - 1, 48, 32, actor.sp.to_s, 2) self.contents.font.color = Color.new(255,255,255,255) self.contents.draw_text(x + 80, y - 2, 48, 32, actor.sp.to_s, 2) end def draw_mexp_it(actor, x, y) lv_tx = RPG::Cache.picture("LV_tx") cw = lv_tx.width ch = lv_tx.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x + 60 , y - ch + 32, lv_tx, src_rect) self.contents.font.color = Color.new(0,0,0,255) self.contents.draw_text(x + 101, y + 5, 24, 32, actor.level.to_s, 1) self.contents.font.color = Color.new(255,255,255,255) self.contents.draw_text(x + 100, y + 4, 24, 32, actor.level.to_s, 1) end def draw_actor_state_it(actor, x, y, width = 80) text = make_battler_state_text(actor, width, true) self.contents.font.color = actor.hp == 0 ? knockout_color : normal_color self.contents.draw_text(x, y, width, 32, text,1) end end ###################### # Window_Target_Item # ###################### class Window_Target_Item < Window_Selectable def initialize super(0, 130, 280, 300) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = "Georgia" self.z += 1500 @item_max = $game_party.actors.size refresh end def refresh self.contents.clear for i in 0...$game_party.actors.size x = 4 y = i * 65 actor = $game_party.actors[i] drw_face(actor,x,y + 55) if $mogscript["TP_System"] == true draw_actor_tp(actor, x + 168, y + 27 ,4) else draw_mexp_it(actor, x + 110, y + 25 ) end draw_actor_state_it(actor, x + 165, y ) draw_maphp3(actor, x + 20, y + 0) draw_mapsp3(actor, x + 20, y + 32) end end def update_cursor_rect if @index <= -2 self.cursor_rect.set(0, (@index + 10) * 65, self.width - 32, 60) elsif @index == -1 self.cursor_rect.set(0, 0, self.width - 32, @item_max * 64 ) else self.cursor_rect.set(0, @index * 65, self.width - 32, 60) end end end ############ # Type_Sel # ############ class Type_Sel < Window_Base attr_reader :index attr_reader :help_window def initialize(x, y, width, height) super(x, y, width, height) @item_max = 1 @column_max = 1 @index = -1 end def index=(index) @index = index end def row_max return (@item_max + @column_max - 1) / @column_max end def top_row return self.oy / 32 end def top_row=(row) if row < 0 row = 0 end if row > row_max - 1 row = row_max - 1 end self.oy = row * 32 end def page_row_max return (self.height - 32) / 32 end def page_item_max return page_row_max * @column_max end def update super if self.active and @item_max > 0 and @index >= 0 if Input.repeat?(Input::RIGHT) if (@column_max == 1 and Input.trigger?(Input::RIGHT)) or @index < @item_max - @column_max $game_system.se_play($data_system.cursor_se) @index = (@index + @column_max) % @item_max end end if Input.repeat?(Input::LEFT) if (@column_max == 1 and Input.trigger?(Input::LEFT)) or @index >= @column_max $game_system.se_play($data_system.cursor_se) @index = (@index - @column_max + @item_max) % @item_max end end end end end ############### # Window_Type # ############### class Window_Type < Type_Sel def initialize super(0, 0, 0, 0) @item_max = 3 self.index = 0 end end ################## # Window_Item_Ex # ################## class Window_Item_Ex < Window_Selectable def initialize super(250, 50, 295, 350) @column_max = 1 refresh self.index = 0 if $game_temp.in_battle self.y = 64 self.height = 256 self.back_opacity = 160 end end def item return @data[self.index] end def refresh if self.contents != nil self.contents.dispose self.contents = nil end @data = [] for i in 1...$data_items.size if $game_party.item_number(i) > 0 @data.push($data_items[i]) end end @item_max = @data.size if @item_max > 0 self.contents = Bitmap.new(width - 32, row_max * 32) for i in 0...@item_max draw_item(i) end end end def draw_item(index) item = @data[index] case item when RPG::Item number = $game_party.item_number(item.id) end if item.is_a?(RPG::Item) and $game_party.item_can_use?(item.id) self.contents.font.color = normal_color else self.contents.font.color = disabled_color end x = 4 + index % 1 * (288 + 32) y = index / 1 * 32 rect = Rect.new(x, y, self.width / @column_max - 32, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) self.contents.font.name = "Georgia" bitmap = RPG::Cache.icon(item.icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(x + 28, y, 190, 1500, item.name, 0) self.contents.draw_text(x + 215, y, 16, 1500, ":", 1) self.contents.draw_text(x + 230, y, 24, 1500, number.to_s, 2) end def update_help @help_window.set_text(self.item == nil ? "" : self.item.description) end end ################# # Window_Weapon # ################# class Window_Weapon < Window_Selectable def initialize super(250, 50, 295, 350) @column_max = 1 refresh self.index = 0 if $game_temp.in_battle self.y = 64 self.height = 256 self.back_opacity = 160 end end def item return @data[self.index] end def refresh if self.contents != nil self.contents.dispose self.contents = nil end @data = [] for i in 1...$data_weapons.size if $game_party.weapon_number(i) > 0 @data.push($data_weapons[i]) end end @item_max = @data.size if @item_max > 0 self.contents = Bitmap.new(width - 32, row_max * 32) for i in 0...@item_max draw_item(i) end end end def draw_item(index) item = @data[index] case item when RPG::Weapon number = $game_party.weapon_number(item.id) end if item.is_a?(RPG::Item) and $game_party.item_can_use?(item.id) self.contents.font.color = normal_color else self.contents.font.color = disabled_color end x = 4 + index % 1 * (288 + 32) y = index / 1 * 32 rect = Rect.new(x, y, self.width / @column_max - 32, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) self.contents.font.name = "Georgia" bitmap = RPG::Cache.icon(item.icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(x + 28, y, 190, 32, item.name, 0) self.contents.draw_text(x + 215, y, 16, 32, ":", 1) self.contents.draw_text(x + 230, y, 24, 32, number.to_s, 2) end def update_help @help_window.set_text(self.item == nil ? "" : self.item.description) end end ################ # Window_Armor # ################ class Window_Armor < Window_Selectable def initialize super(250, 50, 295, 350) @column_max = 1 refresh self.index = 0 if $game_temp.in_battle self.y = 64 self.height = 256 self.back_opacity = 160 end end def item return @data[self.index] end def refresh if self.contents != nil self.contents.dispose self.contents = nil end @data = [] for i in 1...$data_armors.size if $game_party.armor_number(i) > 0 @data.push($data_armors[i]) end end @item_max = @data.size if @item_max > 0 self.contents = Bitmap.new(width - 32, row_max * 32) for i in 0...@item_max draw_item(i) end end end def draw_item(index) item = @data[index] case item when RPG::Armor number = $game_party.armor_number(item.id) end if item.is_a?(RPG::Item) and $game_party.item_can_use?(item.id) self.contents.font.color = normal_color else self.contents.font.color = disabled_color end x = 4 + index % 1 * (288 + 32) y = index / 1 * 32 rect = Rect.new(x, y, self.width / @column_max - 32, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) self.contents.font.name = "Georgia" bitmap = RPG::Cache.icon(item.icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(x + 28, y, 190, 32, item.name, 0) self.contents.draw_text(x + 215, y, 16, 32, ":", 1) self.contents.draw_text(x + 230, y, 24, 32, number.to_s, 2) end def update_help @help_window.set_text(self.item == nil ? "" : self.item.description) end end ############## # Scene_Item # ############## class Scene_Item def main @back = Plane.new @spriteset = Spriteset_Map.new @back.z = 100 @item_lay = Sprite.new @item_lay.bitmap = RPG::Cache.picture("Item_lay") @item_lay.z = 1000 @item_com = Sprite.new @item_com.bitmap = RPG::Cache.picture("Item_com01") @item_com.z = 1500 @type = Window_Type.new @type.opacity = 0 @type.visible = false @help_window = Window_Help.new @help_window.y = 405 @item_window = Window_Item_Ex.new @item_window.help_window = @help_window @item_window.visible = true @item_window.active = true @weapon_window = Window_Weapon.new @weapon_window.help_window = @help_window @weapon_window.visible = false @weapon_window.active = true @armor_window = Window_Armor.new @armor_window.help_window = @help_window @armor_window.visible = false @armor_window.active = true @target_window = Window_Target_Item.new @target_window.x = -300 @target_window.active = false @help_window.opacity = 0 @help_window.x = -200 @help_window.contents_opacity = 0 @item_window.opacity = 0 @weapon_window.opacity = 0 @armor_window.opacity = 0 @target_window.opacity = 0 @weapon_window.x = 640 @armor_window.x = 640 @item_window.x = 640 @weapon_window.contents_opacity = 0 @armor_window.contents_opacity = 0 @item_window.contents_opacity = 0 Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end for i in 0..10 @weapon_window.x += 25 @armor_window.x += 25 @item_window.x += 25 @weapon_window.contents_opacity -= 25 @armor_window.contents_opacity -= 25 @item_window.contents_opacity -= 25 @item_lay.zoom_x += 0.2 @item_lay.opacity -= 25 @item_com.zoom_y += 0.2 @item_com.opacity -= 25 @target_window.x -= 25 @help_window.contents_opacity -= 25 @back.ox += 2 Graphics.update end Graphics.freeze @help_window.dispose @item_window.dispose @weapon_window.dispose @armor_window.dispose @target_window.dispose @item_lay.dispose @spriteset.dispose @item_com.dispose @type.dispose end def update if @target_window.active == true @target_window.visible = true if @target_window.x < 0 @target_window.x += 30 elsif @target_window.x >= 0 @target_window.x = 0 end else if @target_window.x > -300 @target_window.x -= 30 elsif @target_window.x >= -300 @target_window.x = -300 @target_window.visible = false end end if @help_window.x < 0 @help_window.x += 15 @help_window.contents_opacity += 20 elsif @help_window.x >= 0 @help_window.x = 0 @help_window.contents_opacity = 255 end if @item_window.x > 250 @weapon_window.x -= 30 @armor_window.x -= 30 @item_window.x -= 30 @weapon_window.contents_opacity += 20 @armor_window.contents_opacity += 20 @item_window.contents_opacity += 20 elsif @item_window.x <= 250 @weapon_window.x = 250 @armor_window.x = 250 @item_window.x = 250 @weapon_window.contents_opacity = 250 @armor_window.contents_opacity = 250 @item_window.contents_opacity = 250 end if @target_window.active == false if Input.trigger?(Input::RIGHT) or Input.trigger?(Input::LEFT) or Input.press?(Input::RIGHT) or Input.press?(Input::LEFT) @weapon_window.x = 640 @armor_window.x = 640 @item_window.x = 640 @weapon_window.contents_opacity = 0 @armor_window.contents_opacity = 0 @item_window.contents_opacity = 0 end if Input.trigger?(Input.dir4) or Input.trigger?(Input.dir4) or Input.trigger?(Input::L) or Input.trigger?(Input::R) @help_window.x = -200 @help_window.contents_opacity = 0 end end @back.ox += 1 @help_window.update @item_window.update @weapon_window.update @armor_window.update @target_window.update @type.update case @type.index when 0 @item_com.bitmap = RPG::Cache.picture("Item_com01") if @target_window.active == true update_target @item_window.active = false @type.active = false return else @item_window.active = true @type.active = true end @weapon_window.active = false @armor_window.active = false @item_window.visible = true @weapon_window.visible = false @armor_window.visible = false when 1 @item_com.bitmap = RPG::Cache.picture("Item_com02") @item_window.active = false @weapon_window.active = true @armor_window.active = false @item_window.visible = false @weapon_window.visible = true @armor_window.visible = false when 2 @item_com.bitmap = RPG::Cache.picture("Item_com03") @item_window.active = false @weapon_window.active = false @armor_window.active = true @item_window.visible = false @weapon_window.visible = false @armor_window.visible = true end if @item_window.active update_item return end if @weapon_window.active update_weapon return end if @armor_window.active update_armor return end end def update_weapon if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Menu.new(0) return end end def update_armor if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Menu.new(0) return end end def update_item if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Menu.new(0) return end if Input.trigger?(Input::C) @item = @item_window.item unless @item.is_a?(RPG::Item) $game_system.se_play($data_system.buzzer_se) return end unless $game_party.item_can_use?(@item.id) $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) if @item.scope >= 3 @item_window.active = false @target_window.x = (@item_window.index + 1) % 1 * 304 @target_window.active = true @target_window.x = -350 if @item.scope == 4 || @item.scope == 6 @target_window.index = -1 else @target_window.index = 0 end else if @item.common_event_id > 0 $game_temp.common_event_id = @item.common_event_id $game_system.se_play(@item.menu_se) if @item.consumable $game_party.lose_item(@item.id, 1) @item_window.draw_item(@item_window.index) end $scene = Scene_Map.new return end end return end end def update_target if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) unless $game_party.item_can_use?(@item.id) @item_window.refresh end @item_window.active = true @target_window.active = false return end if Input.trigger?(Input::C) if $game_party.item_number(@item.id) == 0 $game_system.se_play($data_system.buzzer_se) return end if @target_window.index == -1 used = false for i in $game_party.actors used |= i.item_effect(@item) end end if @target_window.index >= 0 target = $game_party.actors[@target_window.index] used = target.item_effect(@item) end if used $game_system.se_play(@item.menu_se) if @item.consumable $game_party.lose_item(@item.id, 1) @item_window.draw_item(@item_window.index) end @target_window.refresh if $game_party.all_dead? $scene = Scene_Gameover.new return end if @item.common_event_id > 0 $game_temp.common_event_id = @item.common_event_id $scene = Scene_Map.new return end end unless used $game_system.se_play($data_system.buzzer_se) end return end end end Le troisième: - Code:
-
#_______________________________________________________________________________ # MOG Scene Skill Nami V2.0 #_______________________________________________________________________________ # By Moghunter # http://www.atelier-rgss.com #_______________________________________________________________________________ module MOG #Transition Time. MSK_TT = 10 #Transition Type(Name). MSK_TTT = "004-Blind04" end $mogscript = {} if $mogscript == nil $mogscript["menu_nami"] = true ############## # Game_Actor # ############## class Game_Actor < Game_Battler def now_exp return @exp - @exp_list[@level] end def next_exp return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0 end end ############### # Window_Base # ############### class Window_Base < Window def nada face = RPG::Cache.picture("") end def drw_face(actor,x,y) face = RPG::Cache.picture(actor.name + "_fc") rescue nada cw = face.width ch = face.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x , y - ch, face, src_rect) end def draw_lay(x,y) lay = RPG::Cache.picture("MSK_Status") cw = lay.width ch = lay.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x , y - ch, lay, src_rect) end def nada face = RPG::Cache.picture("") end def draw_heroface3(actor,x,y) face = RPG::Cache.picture(actor.name + "_fc3") rescue nada cw = face.width ch = face.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x , y - ch, face, src_rect) end def draw_maphp3(actor, x, y) back = RPG::Cache.picture("BAR0") cw = back.width ch = back.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x + 65, y - ch + 30, back, src_rect) meter = RPG::Cache.picture("HP_Bar") cw = meter.width * actor.hp / actor.maxhp ch = meter.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x + 65, y - ch + 30, meter, src_rect) text = RPG::Cache.picture("HP_Tx") cw = text.width ch = text.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x + 35, y - ch + 30, text, src_rect) self.contents.font.color = Color.new(0,0,0,255) self.contents.draw_text(x + 81, y - 1, 48, 32, actor.hp.to_s, 2) self.contents.font.color = Color.new(255,255,255,255) self.contents.draw_text(x + 80, y - 2, 48, 32, actor.hp.to_s, 2) end def draw_mapsp3(actor, x, y) back = RPG::Cache.picture("BAR0") cw = back.width ch = back.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x + 65, y - ch + 30, back, src_rect) meter = RPG::Cache.picture("SP_Bar") cw = meter.width * actor.sp / actor.maxsp ch = meter.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x + 65, y - ch + 30, meter, src_rect) text = RPG::Cache.picture("SP_Tx") cw = text.width ch = text.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x + 35, y - ch + 30, text, src_rect) self.contents.font.color = Color.new(0,0,0,255) self.contents.draw_text(x + 81, y - 1, 48, 32, actor.sp.to_s, 2) self.contents.font.color = Color.new(255,255,255,255) self.contents.draw_text(x + 80, y - 2, 48, 32, actor.sp.to_s, 2) end def draw_maphp4(actor, x, y) back = RPG::Cache.picture("BAR") cw = back.width ch = back.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x + 65, y - ch + 30, back, src_rect) meter = RPG::Cache.picture("HP_Bar2") cw = meter.width * actor.hp / actor.maxhp ch = meter.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x + 65, y - ch + 30, meter, src_rect) self.contents.font.color = Color.new(0,0,0,255) self.contents.draw_text(x + 66, y - 1, 100, 32, actor.hp.to_s + "/" + actor.maxhp.to_s, 1) self.contents.font.color = Color.new(250,255,255,255) self.contents.draw_text(x + 65, y - 2, 100, 32, actor.hp.to_s + "/" + actor.maxhp.to_s, 1) end def draw_mapsp4(actor, x, y) back = RPG::Cache.picture("BAR") cw = back.width ch = back.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x + 65 , y - ch + 30, back, src_rect) meter = RPG::Cache.picture("SP_Bar2") cw = meter.width * actor.sp / actor.maxsp ch = meter.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x + 65 , y - ch + 30, meter, src_rect) self.contents.font.color = Color.new(0,0,0,255) self.contents.draw_text(x + 66, y - 1, 100, 32, actor.sp.to_s + "/" + actor.maxsp.to_s, 1) self.contents.font.color = Color.new(250,255,255,255) self.contents.draw_text(x + 65, y - 2, 100, 32, actor.sp.to_s + "/" + actor.maxsp.to_s, 1) end def draw_mexp4(actor, x, y) actor = $game_party.actors[0] bitmap2 = RPG::Cache.picture("Exp_Back") cw = bitmap2.width ch = bitmap2.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x + 60 , y - ch + 30, bitmap2, src_rect) if actor.next_exp != 0 rate = actor.now_exp.to_f / actor.next_exp else rate = 1 end bitmap = RPG::Cache.picture("Exp_Meter") if actor.level < 99 cw = bitmap.width * rate else cw = bitmap.width end ch = bitmap.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x + 60 , y - ch + 30, bitmap, src_rect) self.contents.font.color = Color.new(0,0,0,255) self.contents.draw_text(x + 55, y + 1, 84, 32, "Exp",0) self.contents.font.color = Color.new(255,255,255,255) self.contents.draw_text(x + 54, y, 84, 32, "Exp",0) self.contents.font.color = Color.new(0,0,0,255) self.contents.draw_text(x + 190, y - 125, 60, 32,"LV " + actor.level.to_s, 1) self.contents.font.color = Color.new(255,255,255,255) self.contents.draw_text(x + 191, y - 124, 60, 32,"LV " + actor.level.to_s, 1) end def draw_mexp_it(actor, x, y) lv_tx = RPG::Cache.picture("LV_tx") cw = lv_tx.width ch = lv_tx.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x + 60 , y - ch + 32, lv_tx, src_rect) self.contents.font.color = Color.new(0,0,0,255) self.contents.draw_text(x + 101, y + 5, 24, 32, actor.level.to_s, 1) self.contents.font.color = Color.new(255,255,255,255) self.contents.draw_text(x + 100, y + 4, 24, 32, actor.level.to_s, 1) end def draw_actor_state_it(actor, x, y, width = 80) text = make_battler_state_text(actor, width, true) self.contents.font.color = actor.hp == 0 ? knockout_color : normal_color self.contents.draw_text(x, y, width, 32, text,1) end end ###################### # Window_Target_Item # ###################### class Window_Target_face < Window_Selectable def initialize super(0, 130, 280, 300) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = "Georgia" self.z += 10 @item_max = $game_party.actors.size refresh end def refresh self.contents.clear for i in 0...$game_party.actors.size x = 4 y = i * 65 actor = $game_party.actors[i] drw_face(actor,x,y + 55) if $mogscript["TP_System"] == true draw_actor_tp(actor, x + 168, y + 27 ,4) else draw_mexp_it(actor, x + 110, y + 25 ) end draw_actor_state_it(actor, x + 165, y ) draw_maphp3(actor, x + 20, y + 0) draw_mapsp3(actor, x + 20, y + 32) end end def update_cursor_rect if @index <= -2 self.cursor_rect.set(0, (@index + 10) * 65, self.width - 32, 60) elsif @index == -1 self.cursor_rect.set(0, 0, self.width - 32, @item_max * 64 ) else self.cursor_rect.set(0, @index * 65, self.width - 32, 60) end end end ####################### # Window_SkillStatus2 # ####################### class Window_SkillStatus2 < Window_Base def initialize(actor) super(350, 75, 290, 340) self.contents = Bitmap.new(width - 32, height - 32) @actor = actor self.opacity = 0 self.contents.font.name = "Georgia" refresh end
def refresh self.contents.clear draw_lay(0,300) draw_heroface3(@actor,50,140) draw_actor_name(@actor, 15, 10) draw_actor_state(@actor, 120, 140) draw_mexp4(@actor, -30, 135) draw_maphp4(@actor, 5, 195) draw_mapsp4(@actor, 5, 240) if $mogscript["TP_System"] == true draw_actor_tp(@actor, 40, 265,1) end end end ################# # Window_Skill2 # ################# class Window_Skill2 < Window_Selectable def initialize(actor) super(0, 95, 335, 290) @actor = actor @column_max = 1 refresh self.index = 0 end def skill return @data[self.index] end def refresh if self.contents != nil self.contents.dispose self.contents = nil end @data = [] for i in 0...@actor.skills.size skill = $data_skills[@actor.skills[i]] if skill != nil @data.push(skill) end end @item_max = @data.size if @item_max > 0 self.contents = Bitmap.new(width - 32, row_max * 32) for i in 0...@item_max draw_item(i) end end end def draw_item(index) skill = @data[index] if @actor.skill_can_use?(skill.id) self.contents.font.color = normal_color else self.contents.font.color = disabled_color end self.contents.font.name = "Georgia" x = index % 1 * (288) y = index / 1 * 32 rect = Rect.new(x, y, self.width / @column_max - 32, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) bitmap = RPG::Cache.icon(skill.icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0) self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2) if $mogscript["TP_System"] == true tp_cost = MOG::TP_COST[skill.id] if tp_cost != nil self.contents.font.color = Color.new(50,250,150,255) self.contents.draw_text(x + 170, y, 48, 32, MOG::TP_NAME, 2) else self.contents.font.color = Color.new(200,200,0,255) self.contents.draw_text(x + 170, y, 48, 32, $data_system.words.sp, 2) end else self.contents.font.color = Color.new(200,200,0,255) self.contents.draw_text(x + 170, y, 48, 32, $data_system.words.sp, 2) end end def update_help @help_window.set_text(self.skill == nil ? "" : self.skill.description) end end ############### # Scene_Skill # ############### class Scene_Skill def initialize(actor_index = 0, equip_index = 0) @actor_index = actor_index end def main @actor = $game_party.actors[@actor_index] @msk_lay = Sprite.new @msk_lay.bitmap = RPG::Cache.picture("MSK_Lay") @msk_lay.z = 1000 @msk_back1 = Plane.new @spriteset = Spriteset_Map.new @msk_back1.z = 10 @help_window = Window_Help.new @help_window.y = 500 @status_window = Window_SkillStatus2.new(@actor) @status_window.z = 15000 @status_window.x = 640 @skill_window = Window_Skill2.new(@actor) @skill_window.help_window = @help_window @skill_window.help_window.y = 500 @target_window = Window_Target_face.new @target_window.x = 640 @target_window.y = 100 @target_window.opacity = 0 @target_window.visible = false @target_window.active = false @skill_window.opacity = 0 @help_window.opacity = 0 @slide = true Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end for i in 0..30 @status_window.x += 25 @target_window.x += 25 Graphics.update end Graphics.freeze @help_window.dispose @status_window.dispose @skill_window.dispose @target_window.dispose @msk_lay.dispose @spriteset.dispose end def update if @target_window.active == true @target_window.visible = true if @target_window.x > 340 @target_window.x -= 15 elsif @target_window.x <= 340 @target_window.x = 340 end else if @target_window.x < 640 @target_window.x += 15 elsif @target_window.x >= 640 @target_window.x = 640 @target_window.visible = false end end if @slide == true @status_window.visible = true if @status_window.x > 350 @status_window.x -= 15 elsif @status_window.x <= 350 @status_window.x = 350 end else if @status_window.x < 640 @status_window.x += 15 elsif @status_window.x >= 640 @status_window.x = 640 @status_window.visible = false end end @help_window.update @status_window.update @skill_window.update @target_window.update @msk_back1.ox += 1 @msk_back1.oy += 1 if @skill_window.help_window.y > 425 @skill_window.help_window.y -= 5 elsif @skill_window.help_window.y <= 425 @skill_window.help_window.y = 425 end if @skill_window.active update_skill return end if @target_window.active update_target return end end def update_skill if Input.trigger?(Input::UP) or Input.trigger?(Input::DOWN) @help_window.y = 500 end if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Menu.new(1) return end if Input.trigger?(Input::C) @skill = @skill_window.skill if @skill == nil or not @actor.skill_can_use?(@skill.id) $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) if @skill.scope >= 3 @skill_window.active = false @target_window.active = true @slide = false if @skill.scope == 4 || @skill.scope == 6 @target_window.index = -1 elsif @skill.scope == 7 @target_window.index = @actor_index - 10 else @target_window.index = 0 end else if @skill.common_event_id > 0 $game_temp.common_event_id = @skill.common_event_id $game_system.se_play(@skill.menu_se) @actor.sp -= @skill.sp_cost @status_window.refresh @skill_window.refresh @target_window.refresh $scene = Scene_Map.new return end end return end end def update_target if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @skill_window.active = true @target_window.active = false @slide = true return end if Input.trigger?(Input::C) unless @actor.skill_can_use?(@skill.id) $game_system.se_play($data_system.buzzer_se) return end if @target_window.index == -1 used = false for i in $game_party.actors used |= i.skill_effect(@actor, @skill) end end if @target_window.index <= -2 target = $game_party.actors[@target_window.index + 10] used = target.skill_effect(@actor, @skill) end if @target_window.index >= 0 target = $game_party.actors[@target_window.index] used = target.skill_effect(@actor, @skill) end if used $game_system.se_play(@skill.menu_se) @actor.sp -= @skill.sp_cost @status_window.refresh @skill_window.refresh @target_window.refresh if $game_party.all_dead? $scene = Scene_Gameover.new return end if @skill.common_event_id > 0 $game_temp.common_event_id = @skill.common_event_id $scene = Scene_Map.new return end end unless used $game_system.se_play($data_system.buzzer_se) end return end end end
Dernière édition par Dark Guardian le Ven 23 Juil - 18:20, édité 2 fois | |
| | | _
Messages : 167
| Sujet: Re: [RMXP]{Script}Supperpostion d'images Ven 23 Juil - 17:15 | |
| - Spoiler:
Le quatrième: - Code:
-
#_______________________________________________________________________________ # MOG Scene File Ayumi V1.2 #_______________________________________________________________________________ # By Moghunter # http://www.atelier-rgss.com #_______________________________________________________________________________ module MOG #Transition Time. MSVT = 10 #Transition Type. MSVTT = "006-Stripe02" end $mogscript = {} if $mogscript == nil $mogscript["menu_ayumi"] = true ############### # Window_Base # ############### class Window_Base < Window def drw_win_file(x,y) dwf = RPG::Cache.picture("Win_File") cw = dwf.width ch = dwf.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x , y - ch, dwf, src_rect) end def nada face = RPG::Cache.picture("") end def draw_heroface3(actor,x,y) face = RPG::Cache.picture(actor.name + "_fc3") rescue nada cw = face.width ch = face.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x , y - ch, face, src_rect) end def draw_actor_level6(actor, x, y) self.contents.font.color = Color.new(0,0,0,255) self.contents.draw_text(x + 1, y + 1, 32, 32, "Lv") self.contents.font.color = system_color self.contents.draw_text(x, y, 32, 32, "Lv") self.contents.font.color = Color.new(0,0,0,255) self.contents.draw_text(x + 17, y + 1, 24, 32, actor.level.to_s, 2) self.contents.font.color = Color.new(255,255,255,255) self.contents.draw_text(x + 16, y, 24, 32, actor.level.to_s, 2) end def draw_actor_name6(actor, x, y) self.contents.font.color = Color.new(0,0,0,255) self.contents.draw_text(x + 1, y + 1, 100, 32, actor.name,1) self.contents.font.color = normal_color self.contents.draw_text(x, y, 100, 32, actor.name,1) end end ############ # Game_Map # ############ class Game_Map def map_name @mapinfo = load_data("Data/MapInfos.rxdata") if @mapinfo == nil return @mapinfo[@map_id].name end end ################### # Window_SaveFile # ################### class Window_SaveFile < Window_Base attr_reader :filename attr_reader :selected def initialize(file_index, filename) super(0, 64 + file_index * 138, 640, 240) self.contents = Bitmap.new(width - 32, height - 32) self.opacity = 0 @file_index = file_index @filename = "Save#{@file_index + 1}.rxdata" @time_stamp = Time.at(0) @file_exist = FileTest.exist?(@filename) if @file_exist file = File.open(@filename, "r") @time_stamp = file.mtime @characters = Marshal.load(file) @frame_count = Marshal.load(file) @game_system = Marshal.load(file) @game_switches = Marshal.load(file) @game_variables = Marshal.load(file) @game_self_switches = Marshal.load(file) @game_screen = Marshal.load(file) @game_actors = Marshal.load(file) @game_party = Marshal.load(file) @game_troop = Marshal.load(file) @game_map = Marshal.load(file) @total_sec = @frame_count / Graphics.frame_rate file.close end @wiref = 0 refresh @selected = false end def refresh self.contents.clear self.contents.font.name = "Georgia" drw_win_file(0,190) name = "#{@file_index + 1}" self.contents.font.color = Color.new(0,0,0,255) self.contents.draw_text(161, 41, 600, 32, name) self.contents.font.color = Color.new(255,255,255,255) self.contents.draw_text(160, 40, 600, 32, name) @name_width = contents.text_size(name).width if @file_exist for i in 0...@characters.size bitmap = RPG::Cache.character(@characters[i][0], @characters[i][1]) cw = bitmap.rect.width / 4 ch = bitmap.rect.height / 4 src_rect = Rect.new(cw * @wiref + 1 , 0, cw, ch) x = 300 - @characters.size + i * 64 - cw / 4 self.contents.blt(x - 10, 150 - ch, bitmap, src_rect) x = 116 actors = @game_party.actors for i in 0...[actors.size, 4].min x = i * 60 actor = actors[i] self.contents.font.size = 20 draw_actor_level6(actor, x + 280, 140) actor = actors[0] draw_heroface3(actor,160,180) draw_actor_name6(actor, 160, 155) self.contents.font.size = 22 end end hour = @total_sec / 60 / 60 min = @total_sec / 60 % 60 sec = @total_sec % 60 time_string = sprintf("%02d:%02d:%02d", hour, min, sec) self.contents.font.color = Color.new(0,0,0,255) self.contents.draw_text(5, 41, 450, 32, time_string, 2) self.contents.draw_text(41 , 141, 120 , 32, @game_map.map_name.to_s) self.contents.font.color = Color.new(255,255,255,255) self.contents.draw_text(40 , 140, 120 , 32, @game_map.map_name.to_s) self.contents.draw_text(4, 40, 450, 32, time_string, 2) end end def selected=(selected) @selected = selected end end ############## # Scene_File # ############## class Scene_File def initialize(help_text) @help_text = help_text end def main @mnback = Plane.new @spriteset = Spriteset_Map.new @mnback.z = 1 @mnlay = Sprite.new @mnlay.bitmap = RPG::Cache.picture("Lay_File.PNG") @mnlay.z = 2 @help_window = Window_Help.new @help_window.set_text(@help_text) @help_window.opacity = 0 @savefile_windows = [] for i in 0..2 @savefile_windows.push(Window_SaveFile.new(i, make_filename(i))) end @savefile_windows[0] @file_index = $game_temp.last_file_index @savefile_windows[@file_index].selected = true @savefile_windows[0].y = 40 @savefile_windows[1].y= 140 @savefile_windows[2].y= 240 @win_move_time = 0 @win_move = 0 @win_dire = 0 @win_opac = 255 @win1_y = 0 @win2_y = 0 @win3_y = 0 Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end for i in 0..50 @mnback.ox += 1 @savefile_windows[0].x += 10 @savefile_windows[1].x -= 10 @savefile_windows[2].x += 10 for i in @savefile_windows i.contents_opacity -= 5 end Graphics.update end Graphics.freeze @help_window.dispose @spriteset.dispose @mnlay.dispose for i in @savefile_windows i.dispose end end def update @mnback.ox += 1 @win_opac += 3 @win_move_time += 1 if @win_opac > 254 @win_opac = 150 end if @win_move_time > 60 @win_dire += 1 @win_move_time = 0 end if @win_dire > 1 @win_dire = 0 end if @win_dire == 0 @win_move += 1 else @win_move -= 1 end if @file_index == 0 @savefile_windows[0].z = 2 @savefile_windows[1].z = 1 @savefile_windows[2].z = 0 @savefile_windows[0].x = @win_move @savefile_windows[1].x = 0 @savefile_windows[1].x= 0 @savefile_windows[2].x = 0 @savefile_windows[0].contents_opacity = @win_opac @savefile_windows[1].contents_opacity = 130 @savefile_windows[2].contents_opacity = 130 elsif @file_index == 1 @savefile_windows[0].z = 1 @savefile_windows[1].z = 2 @savefile_windows[2].z = 1 @savefile_windows[0].x = 0 @savefile_windows[1].x = @win_move @savefile_windows[2].x = 0 @savefile_windows[0].contents_opacity = 130 @savefile_windows[1].contents_opacity = @win_opac @savefile_windows[2].contents_opacity = 130 else @savefile_windows[0].z = 0 @savefile_windows[1].z = 1 @savefile_windows[2].z = 2 @savefile_windows[0].x = 0 @savefile_windows[1].x = 0 @savefile_windows[2].x = @win_move @savefile_windows[0].contents_opacity = 130 @savefile_windows[1].contents_opacity = 130 @savefile_windows[2].contents_opacity = @win_opac end @help_window.update for i in @savefile_windows i.update end if Input.trigger?(Input::C) on_decision(make_filename(@file_index)) $game_temp.last_file_index = @file_index return end if Input.trigger?(Input::B) on_cancel return end if Input.repeat?(Input::DOWN) if Input.trigger?(Input::DOWN) or @file_index < 3 $game_system.se_play($data_system.cursor_se) @savefile_windows[@file_index].selected = false @file_index = (@file_index + 1) % 3 @savefile_windows[@file_index].selected = true return end end if Input.repeat?(Input::UP) if Input.trigger?(Input::UP) or @file_index > 0 $game_system.se_play($data_system.cursor_se) @savefile_windows[@file_index].selected = false @file_index = (@file_index - 1) % 3 @savefile_windows[@file_index].selected = true return end end end def make_filename(file_index) return "Save#{file_index + 1}.rxdata" end end
Et le dernier: - Code:
-
#_______________________________________________________________________________ # MOG_Scene_End V2.1 #_______________________________________________________________________________ # By Moghunter # http://www.atelier-rgss.com #_______________________________________________________________________________ # Scene_End com movimento e layout em pictures. # Apresenta a quantidade de batalhas, saves, loads, etc... # Permite criar condições especiais de eventos. #_______________________________________________________________________________ module MOG #Transition Time. ENDTT = 10 #Transition Type(Name). ENDTN = "004-Blind04" #---------------------------------------------------------------- #Definição do texto da apresentação dos parâmetros. SAVE_COUNT_TEXT = "Sauvegardes effectuées" LOAD_COUNT_TEXT = "Chargements effectués" ENEMY_DEFEATED_TEXT = "Ennemis Éliminés" ACTOR_DEFEATED_TEXT = "Points Bonus" #---------------------------------------------------------------- # Definição da variável que registrará o valor dos parâmetros. #(Essa função serve para criar condições especiais no jogo. # Exemplo -> Mate 100 inimigos que você receberá a espada do # dragão.) #---------------------------------------------------------------- # Valor de vezes que o jogo foi Salvo(Save). SAVE_COUNT = 996 # Valor de vezes que o jogo foi carregado(Load). LOAD_COUNT = 997 # Quantidade de inimigos mortos. ENEMY_DEFEATED = 999 # Valor de vezes que o personagens foi abatido. ACTOR_DEFEATED = 998 #---------------------------------------------------------------- end $mogscript = {} if $mogscript == nil $mogscript["menu_sakura"] = true ############### # Game_System # ############### class Game_System include MOG attr_accessor :enemy_defeated attr_accessor :actor_defeated attr_accessor :load_count alias mog21_initialize initialize def initialize @enemy_defeated = 0 @actor_defeated = 0 @load_count = 0 mog21_initialize end def enemy_defeated $game_variables[ENEMY_DEFEATED] = @enemy_defeated return @enemy_defeated end def actor_defeated $game_variables[ACTOR_DEFEATED] = @enemy_defeated return @actor_defeated end def load_count $game_variables[LOAD_COUNT] = @load_count return @load_count end def save_count $game_variables[SAVE_COUNT] = @save_count return @save_count end end ############## # Scene_Load # ############## class Scene_Load < Scene_File alias mog21_read_save_data read_save_data def read_save_data(file) mog21_read_save_data(file) $game_system.load_count += 1 end end ################## # Sprite_Battler # ################## class Sprite_Battler < RPG::Sprite def collapse super if @battler.is_a?(Game_Enemy) $game_system.enemy_defeated += 1 else $game_system.actor_defeated += 1 end end end ############### # Window Data # ############### class Window_Data < Window_Base include MOG def initialize super(0, 100, 640, 280) self.contents = Bitmap.new(width - 32, height - 32) self.opacity = 0 self.contents.font.name = "Georgia" refresh end def refresh self.contents.clear self.contents.draw_text(70, 50, 300, 64,SAVE_COUNT_TEXT + " -> " + $game_system.save_count.to_s ,0) self.contents.draw_text(140, 100, 300, 64,LOAD_COUNT_TEXT + " -> " + $game_system.load_count.to_s,0) self.contents.draw_text(210, 150, 300, 64,ENEMY_DEFEATED_TEXT + " -> " + $game_variables[XAS_BA::DEFEAT_NUMBERS_ID].to_s,0) self.contents.draw_text(280, 200, 300, 64,ACTOR_DEFEATED_TEXT + " -> " + $game_variables[MOG::AP_VARIABLE_ID].to_s,0) end end ############# # Scene_End # ############# class Scene_End def main s1 = "" s2 = "" s3 = "" @command_window = Window_Command.new(100, [s1, s2, s3]) @command_window.visible = false @window_data = Window_Data.new @endback = Plane.new @spriteset = Spriteset_Map.new @endback.z = 10 @endback.opacity = 255 @endlayout = Plane.new @endlayout.bitmap = RPG::Cache.picture("End_Layout") @endlayout.z = 1000 @endcom1 = Sprite.new @endcom1.bitmap = RPG::Cache.picture("End_Com01") @endcom1.z = 1500 @endcom1.x = 20 @endcom1.y = 340 @endcom1.zoom_x = 1 @endcom2 = Sprite.new @endcom2.bitmap = RPG::Cache.picture("End_Com02") @endcom2.z = 1500 @endcom2.x = 100 @endcom2.y = 395 @endcom3 = Sprite.new @endcom3.bitmap = RPG::Cache.picture("End_Com03") @endcom3.z = 1500 @endcom3.x = 190 @endcom3.y = 440 $ld = 0 @zc = 1 Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @command_window.dispose @window_data.dispose @spriteset.dispose @endcom1.dispose @endcom2.dispose @endcom3.dispose @endlayout.dispose if $scene.is_a?(Scene_Title) Graphics.transition Graphics.freeze end end def update @zc += 0.01 if @zc > 1.3 @zc = 1 end @endback.ox += 1 @endback.oy += 1 @command_window.update case @command_window.index when 0 @endcom1.zoom_x = @zc @endcom2.zoom_x = 1 @endcom3.zoom_x = 1 when 1 @endcom1.zoom_x = 1 @endcom2.zoom_x = @zc @endcom3.zoom_x = 1 when 2 @endcom1.zoom_x = 1 @endcom2.zoom_x = 1 @endcom3.zoom_x = @zc end if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Menu.new(5) return end if Input.trigger?(Input::C) case @command_window.index when 0 command_to_title when 1 command_load when 2 command_shutdown end return end end def command_to_title $game_system.se_play($data_system.decision_se) Audio.bgm_fade(800) Audio.bgs_fade(800) Audio.me_fade(800) $scene = Scene_Title.new end def command_load $ld = 1 $scene = Scene_Load.new end def command_shutdown $game_system.se_play($data_system.decision_se) Audio.bgm_fade(800) Audio.bgs_fade(800) Audio.me_fade(800) $scene = nil
end end ############## # Scene_Load # ############## class Scene_Load def on_cancel $game_system.se_play($data_system.cancel_se) if $ld == 1 $scene = Scene_End.new else $scene = Scene_Title.new end end end Merci d'avance!!!
Dernière édition par Dark Guardian le Ven 23 Juil - 18:20, édité 1 fois | |
| | | Léo
Messages : 6241
| Sujet: Re: [RMXP]{Script}Supperpostion d'images Ven 23 Juil - 18:19 | |
| Là je ne peux pas t'aider, j'y connait rien en script. Par contre tu devrais les mettre en spoile, parce que là, faut 1/2heure pour aller en bas de page. | |
| | | Little-Cherry
Messages : 179
| Sujet: Re: [RMXP]{Script}Supperpostion d'images Sam 24 Juil - 12:59 | |
| Pareil que Leo, moi et les scripts... | |
| | | Magicalichigo
Messages : 3283
| Sujet: Re: [RMXP]{Script}Supperpostion d'images Dim 25 Juil - 16:37 | |
| Tu as modifié quelles lignes ? | |
| | | _
Messages : 167
| Sujet: Re: [RMXP]{Script}Supperpostion d'images Dim 25 Juil - 20:52 | |
| Toutes les lignes que j'ai pus voir qui affichaient une image avec la valeur "z" modifiable. | |
| | | Contenu sponsorisé
| Sujet: Re: [RMXP]{Script}Supperpostion d'images | |
| |
| | | | [RMXP]{Script}Supperpostion d'images | |
|
Sujets similaires | |
|
| Permission de ce forum: | Vous ne pouvez pas répondre aux sujets dans ce forum
| |
| |
| |