Black_Mage icon

Picture Z Changer Script

Black_Mage | PRO | 04/24/23 06:48:05 PM UTC (Edited) | 0 ⭐ | 7247 👁️ | Never ⏰ | []
Ruby |

2.21 KB

|

None

|

0 👍

/

0 👎

#==============================================================================
# Don't remove this header!
#==============================================================================
# Picture Z Changer script By Black Mage (Credit required to use)
# Current Version : 1.1
# https://burningwizard.wordpress.com/2019/04/18/picture-z-changer-script/
#
# This script can change z value of choosen picture called via command event.
#
# This script is licensed under CC BY 3.0
# https://creativecommons.org/licenses/by/3.0/
#==============================================================================
 
#==============================================================================
# Changelog
#==============================================================================
# Version 1.1
#   - Rewrite some codes.
#
# Version 1.0
#   - Initial version.
#==============================================================================
 
#==============================================================================
# How to use the script
#==============================================================================
# Put this script on your project.
#
# Use these command on script call from event command to change the z value of 
# a picture:
#
# change_picture_z(picture_id, value)
#
#==============================================================================
 
#------------------------------------------------------------------------------
# * Beyond this is the sacred land of code. You need programming qualification
#   to dwelve deeper, or it'll cause many unnecessary problems. Proceed on your
#   own risk.
#------------------------------------------------------------------------------
class Game_Picture; attr_accessor :z_value; end
 
class Game_Interpreter
  def change_picture_z(id, value)
    if SceneManager.scene_is?(Scene_Battle)
      a = $game_troop.screen.pictures
    elsif SceneManager.scene_is?(Scene_Map)
      a = $game_map.screen.pictures
    end
    return if a.nil?
    a[id].z_value = value
  end
end
 
class Sprite_Picture < Sprite  
  alias black_u_p update_position
  def update_position
    black_u_p; self.z = @picture.z_value if @picture.z_value != nil
  end
end

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎