#-------------------------------------------------------------------------- # * Create Battleback Sprite toto je tvorba pozadí #-------------------------------------------------------------------------- def create_battleback if $BTEST #battle tetst začne bude klaasika source = $game_temp.background_bitmap bitmap = Bitmap.new(640, 480) bitmap.stretch_blt(bitmap.rect, source, source.rect) bitmap.radial_blur(90, 12) @battleback_sprite = Sprite.new(@viewport1) @battleback_sprite.bitmap = bitmap @battleback_sprite.ox = 320 @battleback_sprite.oy = 240 @battleback_sprite.x = 272 @battleback_sprite.y = 176 @battleback_sprite.wave_amp = 8 @battleback_sprite.wave_length = 240 @battleback_sprite.wave_speed = 120 else battle = $game_map.parallax_name #jestli existuje parallaxa na mapě if battle == "" #exist paralax case $game_variables[8] #jestli je variable číslo 8 rovno 1 bude pozadí následující a přidání opsat tyto řádky odsud when 1 #stačí změnit číslo na př.2 source=Cache.parallax("7") bitmap = Bitmap.new(640,480) @battleback_sprite = Sprite.new(@viewport1) bitmap.stretch_blt(bitmap.rect, source, source.rect) @battleback_sprite = Sprite.new(@viewport1) @battleback_sprite.bitmap = bitmap # potud else # jestli není var rovno paralax source = $game_temp.background_bitmap bitmap = Bitmap.new(640, 480) bitmap.stretch_blt(bitmap.rect, source, source.rect) bitmap.radial_blur(90, 12) @battleback_sprite = Sprite.new(@viewport1) @battleback_sprite.bitmap = bitmap end else #klasika case $game_variables[8] #jestli je variable číslo 8 rovno 1 bude pozadí následující a přidání opsat tyto řádky odsud when 1 #stačí změnit číslo na př.2 source=Cache.parallax("7") bitmap = Bitmap.new(640,480) @battleback_sprite = Sprite.new(@viewport1) bitmap.stretch_blt(bitmap.rect, source, source.rect) @battleback_sprite = Sprite.new(@viewport1) @battleback_sprite.bitmap = bitmap # potud else # jestli není var rovno paralax battle = Cache.parallax($game_map.parallax_name) bitmap = Bitmap.new(640,480) @battleback_sprite = Sprite.new(@viewport1) @battleback_sprite.bitmap = battle end end end if $game_variables[8] == nil battl = $game_map.parallax_name #jestli existuje parallaxa na map if battl == "" #exist paralax @battleback_sprite.ox = 320 @battleback_sprite.oy = 240 @battleback_sprite.x = 272 @battleback_sprite.y = 176 @battleback_sprite.wave_amp = 8 @battleback_sprite.wave_length = 240 @battleback_sprite.wave_speed = 120 else @battleback_sprite.ox = 0 @battleback_sprite.oy = 0 @battleback_sprite.x = 0 @battleback_sprite.y = 0 @battleback_sprite.wave_amp =0 @battleback_sprite.wave_length = 0 @battleback_sprite.wave_speed = 0 end else @battleback_sprite.ox = 0 @battleback_sprite.oy = 0 @battleback_sprite.x = 0 @battleback_sprite.y = 0 @battleback_sprite.wave_amp =0 @battleback_sprite.wave_length = 0 @battleback_sprite.wave_speed = 0 end end
A funguje když je parallax a var 8 na 1 hodí to pozadí podle var 8 a pokud není tak parallax. Apokud není parallax a je var 8 na 1 hodí to pozadí podle var 8, a poku není ani jedno hodí to klasiku
mám postnout ten můj.... nebo ne mohu ti k tomu tvému připsat automatické vypínání.... rozhodni se..... Tvůj script je lepší (nevím zaboha proč mi nefunguje)
#-------------------------------------------------------------------------- # * Create Battleback Sprite #-------------------------------------------------------------------------- def create_battleback if $BTEST #battle tetst begin witch classic source = $game_temp.background_bitmap bitmap = Bitmap.new(640, 480) bitmap.stretch_blt(bitmap.rect, source, source.rect) bitmap.radial_blur(90, 12) @battleback_sprite = Sprite.new(@viewport1) @battleback_sprite.bitmap = bitmap @battleback_sprite.ox = 320 @battleback_sprite.oy = 240 @battleback_sprite.x = 272 @battleback_sprite.y = 176 @battleback_sprite.wave_amp = 8 @battleback_sprite.wave_length = 240 @battleback_sprite.wave_speed = 120 else battle = $game_map.parallax_name # If exist Parallax on map and you should use as background if battle == "" #exist paralax case $game_variables[8] # If you don't like the spiral and waves in Maker VX you should change Create Battleback Sprite in Spriteset_Battle:
#-------------------------------------------------------------------------- # * Create Battleback Sprite #-------------------------------------------------------------------------- def create_battleback if $BTEST #battle tetst begin witch classic source = $game_temp.background_bitmap bitmap = Bitmap.new(640, 480) bitmap.stretch_blt(bitmap.rect, source, source.rect) bitmap.radial_blur(90, 12) @battleback_sprite = Sprite.new(@viewport1) @battleback_sprite.bitmap = bitmap @battleback_sprite.ox = 320 @battleback_sprite.oy = 240 @battleback_sprite.x = 272 @battleback_sprite.y = 176 @battleback_sprite.wave_amp = 8 @battleback_sprite.wave_length = 240 @battleback_sprite.wave_speed = 120 else battle = $game_map.parallax_name # If exist Parallax on map and you should use as background if battle == "" #exist paralax case $game_variables[8] # If Variable is present when 1 # for other choices change to 2 or more source=Cache.picture ("Image1") # Here place name of picture (640x480x24bit) in Picture folder bitmap = Bitmap.new(544, 416) @battleback_sprite = Sprite.new(@viewport1) bitmap.stretch_blt(bitmap.rect, source, source.rect) @battleback_sprite = Sprite.new(@viewport1) @battleback_sprite.bitmap = bitmap when 2 #for other choices change to 2 or more source=Cache.picture ("Image2") # Here place name of picture (640x480x24bit) in Picture folder bitmap = Bitmap.new(544, 416) @battleback_sprite = Sprite.new(@viewport1) bitmap.stretch_blt(bitmap.rect, source, source.rect) @battleback_sprite = Sprite.new(@viewport1) @battleback_sprite.bitmap = bitmap else # jestli není var rovno paralax source = $game_temp.background_bitmap bitmap = Bitmap.new(640, 480) bitmap.stretch_blt(bitmap.rect, source, source.rect) bitmap.radial_blur(90, 12) @battleback_sprite = Sprite.new(@viewport1) @battleback_sprite.bitmap = bitmap end else #klasika case $game_variables[8] # If Variable is present when 1 #for other choices change to 2 or more source=Cache.picture ("Image1")# Here place name of picture (640x480x24bit) in Picture folder bitmap = Bitmap.new(544, 416) @battleback_sprite = Sprite.new(@viewport1) bitmap.stretch_blt(bitmap.rect, source, source.rect) @battleback_sprite = Sprite.new(@viewport1) @battleback_sprite.bitmap = bitmap when 2 #for other choices change to 2 or more source=Cache.picture("Image2")# Here place name of picture (640x480x24bit) in Picture folder bitmap = Bitmap.new(544, 416) @battleback_sprite = Sprite.new(@viewport1) bitmap.stretch_blt(bitmap.rect, source, source.rect) @battleback_sprite = Sprite.new(@viewport1) @battleback_sprite.bitmap = bitmap else # jestli není var rovno paralax battle = Cache.parallax($game_map.parallax_name) bitmap = Bitmap.new(640, 480) @battleback_sprite = Sprite.new(@viewport1) @battleback_sprite.bitmap = battle end end end if $game_variables[8] == nil # if Variable is 0 if battle == "" #exist Parallax @battleback_sprite.ox = 320 @battleback_sprite.oy = 240 @battleback_sprite.x = 272 @battleback_sprite.y = 176 @battleback_sprite.wave_amp = 8 @battleback_sprite.wave_length = 240 @battleback_sprite.wave_speed = 120 else @battleback_sprite.ox = 0 @battleback_sprite.oy = 0 @battleback_sprite.x = 0 @battleback_sprite.y = 0 @battleback_sprite.wave_amp =0 @battleback_sprite.wave_length = 0 @battleback_sprite.wave_speed = 0 end else @battleback_sprite.ox = 0 @battleback_sprite.oy = 0 @battleback_sprite.x = 0 @battleback_sprite.y = 0 @battleback_sprite.wave_amp =0 @battleback_sprite.wave_length = 0 @battleback_sprite.wave_speed = 0 end end
Ještě úprava Update Battlefloor a Dispose of Battlefloor Sprite pro funkci Spriteset_Battle:
#-------------------------------------------------------------------------- # * Update Battlefloor #-------------------------------------------------------------------------- def update_battlefloor if $game_variables[8] == nil # if Variable is 0 if battle == "" #exist parallax @battlefloor_sprite.update else end else end end
#-------------------------------------------------------------------------- # * Dispose of Battlefloor Sprite #-------------------------------------------------------------------------- def dispose_battlefloor if $game_variables[8] == nil # if Variable is 0 if battle == "" #exist parallax @battlefloor_sprite.dispose else end else end end
A jak to funguje? Když je parallax a var 8 na 1 hodí to pozadí podle var 8 a pokud není tak parallax. A pokud není parallax a je var 8 na 1 hodí to pozadí podle var 8, a pokud není ani jedno hodí to klasiku