Age : 134 Inscrit le : 14/04/2009 Messages : 1321
| Sujet: Priorité d'afficahge supérieur des Characters (par dessus une image) Lun 25 Oct 2010 - 9:47 | |
| Bonjour ! Hier soir, j'ai planché sur un modèle d'event afin d'essayer de recréer l'intérieur d'un train (avec, bien sûr un paysage défilant par les fenêtres, ldes vibrtions et un BGS pour accompagner tout cela). Donc, en gros, pour le moment, ça me donne ça. (Les fenêtres son du custom, avec un fond transparent.) Contrairement aux apparences, la partie mappée n'est qu'une image. Pourquoi ? Pour la simple est bonne raison que j'ai eu besoin de ressources supplémentaires. Impossible de les insérer dans mon projet actuel, en somme. Je me suis donc débrouillé en jonglant avec les images de deux projets, pour enfin parvenir à cette intérieur basique de train (encore en cosntruction). Ainsi, il me suffit d'afficher cette image sur une map sur laquelle j'ai programmé un panorama défilant, ainsi qu'un évènement en processus parallèle faisant trembler l'écran, par soucis de réalisme. Seulement, les Characters ne s'affiche pas. Enfin, si, ils s'affichent, mais derrière l'image. D'où ma question. Y'a t-il un moyen pour que les characters s'affichent devant l'image ? P.S : Une alternative consisterait à mapper ce qui est possible, et de rajouter le reste en event, en ayant préalablement consitué une palnche de chara de l'élément désiré. Mais bon, si une solution existe, ça m'éviterais de devoir tout refaire. |
|
Citadin Lv.7
Age : 29 Inscrit le : 09/11/2009 Messages : 204
| Sujet: Re: Priorité d'afficahge supérieur des Characters (par dessus une image) Lun 25 Oct 2010 - 11:32 | |
| Il existe un script permettant de faire ça. Je le retrouve et te le passe Auteur, Modern Algebra : - Spoiler:
- Code:
-
#============================================================================== # Fix Pictures to Map # Version: 1.0 # Author: modern algebra (rmrk.net) # Date: June 17, 2010 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Description: # # This allows you to set the position of a picture by the X and Y position # of the map, rather than the screen, so that the picture won't move with you # when the screen scrolls. It also has a couple other features, such as # allowing you to set the Z value to show below characters, or below the # tiles to add another parallax (kind of). #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Instructions: # # Paste this script into its own slot above Main and below Materials in the # Script Editor (F11). # # This switch is run by two switches and one variable that you specify. # They are: # FPM_SWITCH - This switch toggles the fix pictures feature. When this # switch is ON and a picture is shown, then that picture will be fixed # to the map coordinates you specify, not to the screen. This means # that if the screen scrolls, the picture will not scroll with it. It # is useful if you want to use a picture as an additional map layer, # or as a parallax. Note that this still sets it to pixels, so if you # want a picture to show up at the map coordinates 1, 2, you would set # it to 32, 64. To specify which switch should be used to control this # feature, go to line 56 and change the value to the ID of the switch # you want to use to control this feature. # FPM_LAYER_SWITCH - This switch has a strange function; basically, the # spriteset for a map uses three different viewports: one for tiles # and characters, one for pictures, weather, and the timer, and one to # control screen brightness. This means that tiles and characters will # always be below pictures by default. By turning this switch on # before you show a picture, you move pictures into the lower viewport # with characters and tiles, allowing you to show the picture below # tiles and characters. If this switch is off, it is not possible to # do so. To specify which switch should be used to control this # feature, go to line 57 and change the value to the ID of the switch # you want to use to control this feature. # FPM_Z_VARIABLE - This allows you to set the priority of the picture # within the viewport you put it in. This variable is only active if # FPM_LAYER_SWITCH is ON. Setting this variable to 1 will place it # below characters but above non-star tiles. Setting this variable to # 2 will draw the picture above all tiles and characters except for # "Above Characters" Events. Setting it to 3 will put it below all # tiles and characters but above the parallax. Setting it to 4 will # put it below everything, including the parallax. Setting it to any # other value directly sets the z of that sprite to that value. Again, # this only works if the FPM_LAYER_SWITCH is ON. To specify which # variable controls this feature, go to line 58 and set FPM_Z_VARIABLE # to the ID of the variable you want to use. #============================================================================== FPM_SWITCH = 9 # See line 22 FPM_LAYER_SWITCH = 10 # See line 32 FPM_Z_VARIABLE = 17 # See line 43 #============================================================================== # ** Game_Picture #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Summary of Changes: # attr_reader - map_locked # aliased method - initialize, show #==============================================================================
class Game_Picture #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Public Instance Variables #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ attr_reader :map_locked attr_reader :fpm_viewport attr_reader :fpm_z #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Object Initialization #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ alias malg_fixpicmp_initz_6yh3 initialize def initialize (*args) @map_locked = false @fpm_viewport = false malg_fixpicmp_initz_6yh3 (*args) # Run Original Method @fpm_z = 100 + self.number end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Show Picture #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ alias ma_fxpm_showpic_2dx4 show def show (*args) ma_fxpm_showpic_2dx4 (*args) # Run Original Method @map_locked = $game_switches[FPM_SWITCH] @fpm_viewport = $game_switches[FPM_LAYER_SWITCH] if @fpm_viewport @fpm_z = case $game_variables[FPM_Z_VARIABLE] when 0 then 100 + self.number when 1 then 0 when 2 then 200 when 3 then -50 when 4 then -150 else @fpm_z = $game_variables[FPM_Z_VARIABLE] end else @fpm_z = 100 + self.number end end end
#============================================================================== # ** Sprite_Picture #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Summary of Changes: # new attr_accessor - fpm_vp1, fpm_vp2 # aliased method - update #==============================================================================
class Sprite_Picture #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Public Instance Variables #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ attr_accessor :fpm_vp1 attr_accessor :fpm_vp2 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Frame Update #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ alias ma_fpm_updt_oxoy_5tb3 update def update (*args) pic_name = @picture_name ma_fpm_updt_oxoy_5tb3 (*args) # Run Original Method if pic_name != @picture_name self.viewport = @picture.fpm_viewport ? @fpm_vp1 : @fpm_vp2 self.ox, self.oy = 0, 0 # Reset OX and OY for new picture end if @picture.map_locked self.ox, self.oy = $game_map.display_x / 8, $game_map.display_y / 8 end self.z = @picture.fpm_z end end
#============================================================================== # ** Spriteset_Map #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Summary of Changes: # aliased method - create_pictures #==============================================================================
class Spriteset_Map #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Create Pictures #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ alias malg_fxpix_crtpi_5oq1 create_pictures def create_pictures (*args) malg_fxpix_crtpi_5oq1 (*args) # Run Original Method @picture_sprites.each { |sprite| sprite.fpm_vp1 = @viewport1 sprite.fpm_vp2 = @viewport2 } end end
|
|
Age : 134 Inscrit le : 14/04/2009 Messages : 1321
| Sujet: Re: Priorité d'afficahge supérieur des Characters (par dessus une image) Lun 25 Oct 2010 - 14:47 | |
| Cool. Enfin, mis à part la traduction miteuse de Google.
Bon, je vais essayer de m'en dépatouiller.
Arty' |
|
| Sujet: Re: Priorité d'afficahge supérieur des Characters (par dessus une image) | |
| |
|