-29%
Le deal à ne pas rater :
PC portable – MEDION 15,6″ FHD Intel i7 – 16 Go / 512Go (CDAV : ...
499.99 € 699.99 €
Voir le deal
Le deal à ne pas rater :
Pokémon EV06 : où acheter le Bundle Lot 6 Boosters Mascarade ...
Voir le deal

Aller en bas
emiya
emiya
Membre

Nombre de messages : 20
Distinction : aucune
Date d'inscription : 09/06/2013

Capture d'écran/Screenshot d'une map compléte Empty Capture d'écran/Screenshot d'une map compléte

Ven 14 Juin 2013 - 21:40
Bonsoir,
Je voudrais savoir s'il existait un moyen pour prendre un screenshot entier d'une map sur l'éditeur ou sur le jeu?
merci...
Heaven
Heaven
Staffeux retraité

Nombre de messages : 2441
Age : 23
Localisation : Alpes-Maritimes VIRILITÉ OLALA
Distinction : Aucune
Date d'inscription : 18/10/2012

Capture d'écran/Screenshot d'une map compléte Empty Re: Capture d'écran/Screenshot d'une map compléte

Ven 14 Juin 2013 - 22:03
Sur ton clavier tu as la touche "impecr ecran", tu appuis dessus, ca va copier ton ecran.
Ou paint (ou autre) colle et tu auras ton screen . redimensionne le , heavidemment.
Si tu as besoin d'autres precisions n'hesites pas.

Heav'n
emiya
emiya
Membre

Nombre de messages : 20
Distinction : aucune
Date d'inscription : 09/06/2013

Capture d'écran/Screenshot d'une map compléte Empty Re: Capture d'écran/Screenshot d'une map compléte

Ven 14 Juin 2013 - 22:18
Je sais déjà ça , sauf qu'il est impossible , sans montage , de prendre une grosse map entiére en screen avec ce bouton  , moi ce que je cherche c'est pouvoir prendre un screen de toute la map automatiquement sans passe par un quelconque logiciel et ce , peu importe la taille de la map.
Spytje
Spytje
Administrateur

Nombre de messages : 5935
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008

Capture d'écran/Screenshot d'une map compléte Empty Re: Capture d'écran/Screenshot d'une map compléte

Ven 14 Juin 2013 - 22:19
Il y a beaucoup plus facile et précis que le "Print Screen"

Voici le script que j'utilise dans mon projet :

Code:
=begin
==============================================================================
 ** Tsuki Map Saver
------------------------------------------------------------------------------
 Author: Tsukihime
 Date: May 28, 2012
------------------------------------------------------------------------------
 Changes Log
 May 28
   - updated overlay mapping compatibility to draw the overlays
    based on the player's current position
   - fixed issue where import hash was commented out
   - Added support for Yami's overlay mapping
 May 24, 2012
   - fixed large characters
   - some optimizations for calculating bounds and dimensions
 May 5, 2012
   - fixed waterfall autotile
   - added screenshot feature
 May 4, 2012
   - fixed tiles with alpha channel
   - fixed shadows
   - fixed wall autotiles
 May 1, 2012
   - fixed wall autotile, although there is still an issue with some tiles
 Apr 29, 2012
   - fixed shadow map drawing
   - added region highlighting
   - added damage tile highlighting
 Apr 28, 2012
   - Initial Release
------------------------------------------------------------------------------
 Creates an image of a map that you could share
------------------------------------------------------------------------------
 Map shows up in the game folder with the same name
 as the map, or the display name of the map if it exists.
 
Two ways to export an image of the map:

 A - just hit F6 (can customize below)
 B - use script calls
   1. create an event on the map
   2. use the following script call
         Map_Saver.new(map_id).export
 
You can also use the bitmap that it creates in-game as well
 with the following script call
    bitmap = Map_Saver.new(map_id).bitmap
 
However currently there doesn't seem to be too many things you can
 do with a bitmap object. Maybe in the future.
------------------------------------------------------------------------------
 Credits to Cidiomar for drawing autotiles and shadows,
 as well as providing efficient bmp and png exporters
==============================================================================
=end
$imported = {} if $imported.nil?
$imported["Tsuki_MapSaver"] = true
#==============================================================================
# ** Configuration
# Some settings you can customize
#==============================================================================
module Tsuki
  module Map_Saver
    
    #Mapshot options. This takes an image of the entire map
    Mapshot_Scale = 1
    Mapshot_Button = Input::F7
    
    #Screenshot options. This takes an image of the visible map
    Screenshot_Button = Input::F6
    Screenshot_Scale = 1
    
    #Folder that the map will be exported to
    Mapshot_Directory = "Mapshots"
    Screenshot_Directory = "Screenshots"
    
    #format you want to export to
    #Options: [tga, bmp, png]
   Export_Format = "png"
   
    #Should events be drawn in the image?
    Draw_Events = false
    
    #Should the game player be drawn in the image?
    Draw_Player = false
    Draw_Followers = false
    
    #Should shadows be drawn? What color?
    Draw_Shadow = false
    Shadow_Color = Color.new(0, 0, 0, 128)
    
    #Should damage tiles be highlighted? What color?
    Highlight_Damage = false
    Damage_Color = Color.new(128, 0, 0, 128)
    
    #Should regions be drawn?
    #And at what opacity (0 = transparent, 255 = opaque)
    Draw_Regions = false
    Region_Opacity = 160
    
    #Set this to true if your game crashes when trying to save image
    #Specify format to fallback to if your game crashes: choice of [bmp, png]
    Crashes = false
    Crash_Format = "png"
    
    ###Not implemented yet###
    Draw_Vehicles = false
  end
end

#==============================================================================
# ** Module: Map_Tiles
# Contains data and methods useful for working with maps and tiles
#==============================================================================

module Map_Tiles
  
  AUTOTILE_PARTS = [[18,17,14,13], [ 2,14,17,18], [13, 3,17,18], [ 2, 3,17,18],
                    [13,14,17, 7], [ 2,14,17, 7], [13, 3,17, 7], [ 2, 3,17, 7],
                    [13,14, 6,18], [ 2,14, 6,18], [13, 3, 6,18], [ 2, 3, 6,18],
                    [13,14, 6, 7], [ 2,14, 6, 7], [13, 3, 6, 7], [ 2, 3, 6, 7],
                    [16,17,12,13], [16, 3,12,13], [16,17,12, 7], [12, 3,16, 7],
                   [10, 9,14,13], [10, 9,14, 7], [10, 9, 6,13], [10, 9, 6, 7],
                    [18,19,14,15], [18,19, 6,15], [ 2,19,14,15], [ 2,19, 6,15],
                    [18,17,22,21], [ 2,17,22,21], [18, 3,22,21], [ 2, 3,21,22],
                    [16,19,12,15], [10, 9,22,21], [ 8, 9,12,13], [ 8, 9,12, 7],
                    [10,11,14,15], [10,11, 6,15], [18,19,22,23], [ 2,19,22,23],
                    [16,17,20,21], [16, 3,20,21], [ 8,11,12,15], [ 8, 9,20,21],
                    [16,19,20,23], [10,11,22,23], [ 8,11,20,23], [ 0, 1, 4, 5]]
  WATERFALL_PIECES = [[ 2, 1, 6, 5], [ 0, 1, 4, 5], [ 2, 3, 6, 7], [0, 3, 4, 7]]
  WALL_PIECES =  [[10, 9, 6, 5], [ 8, 9, 4, 5], [ 2, 1, 6, 5], [ 0, 1, 4, 5],
                  [10,11, 6, 7], [ 8,11, 4, 7], [ 2, 3, 6, 7], [ 0, 3, 4, 7],
                  [10, 9,14,13], [ 8, 9,12,13], [ 2, 1,14,13], [ 0, 1,12,13],
                  [10,11,14,15], [8, 11,12,15], [ 2, 3,14,15], [ 0, 3,12,15]]

  A1_TILES = [[0, 0], [0, 96], [192, 0], [192, 96],
               [256, 0], [448, 0], [256, 96], [448, 96],
               [0, 192], [192, 192], [0, 288], [192, 288],
               [256, 192], [448, 192], [256, 288], [448, 288]]
    
  
  #--------------------------------------------------------------------------
  # * Checks if a tile is a wall
  #--------------------------------------------------------------------------
  def is_wall?(data)
    return true if data.between?(2288, 2335)
    return true if data.between?(2384, 2431)
    return true if data.between?(2480, 2527)
    return true if data.between?(2576, 2623)
    return true if data.between?(2672, 2719)
    return true if data.between?(2768, 2815)
    return true if data.between?(4736, 5119)
    return true if data.between?(5504, 5887)
    return true if data.between?(6272, 6655)
    return true if data.between?(7040, 7423)
    return true if data > 7807
    false
  end
  #--------------------------------------------------------------------------
  # * Checks if a tile is roof
  #--------------------------------------------------------------------------
  def is_roof?(data)
    return true if data.between?(4352, 4735)
    return true if data.between?(5120, 5503)
    return true if data.between?(5888, 6271)
    return true if data.between?(6656, 7039)
    return true if data.between?(7424, 7807)
    false
  end  
  #--------------------------------------------------------------------------
  # * Checks if a tile is soil
  #--------------------------------------------------------------------------
  def is_soil?(data)
    return true if data.between?(2816, 4351) && !is_table?(data)
    return true if data > 1663 && !is_stair?(data)
    false
  end    
  #--------------------------------------------------------------------------
  # * Checks if a tile is a stair
  #--------------------------------------------------------------------------
  def is_stair?(data)
     return true if data.between?(1541, 1542)
     return true if data.between?(1549, 1550)
     return true if data.between?(1600, 1615)
     false
  end
  #--------------------------------------------------------------------------
  # * Checks if a tile is a table
  #--------------------------------------------------------------------------
  def is_table?(data)
    return true if data.between?(3152, 3199)
    return true if data.between?(3536, 3583)
    return true if data.between?(3920, 3967)
    return true if data.between?(4304, 4351)
    false
  end
 
 #--------------------------------------------------------------------------
  # * The tileset to be used
  #--------------------------------------------------------------------------
  def tileset
    $data_tilesets[@tileset_id]
  end
  
  #--------------------------------------------------------------------------
  # * Region ID
  #--------------------------------------------------------------------------
  def region_id(x, y)
    valid?(x, y) ? @map.data[x, y, 3] >> 8 : 0
  end
  
  #--------------------------------------------------------------------------
  # * Gets all of the tiles for each layer at position x,y
  #--------------------------------------------------------------------------
  def layered_tiles(x, y)
    [2, 1, 0].collect {|z| @map.data[x, y, z] }
  end
  
  def layered_tiles_flag?(x, y, bit)
    layered_tiles(x, y).any? {|tile_id| tileset.flags[tile_id] & bit != 0 }
  end
  
 def valid?(x, y)
    x >= 0 && x < width && y >= 0 && y < height
  end
  
  def damage_floor?(x, y)
    valid?(x, y) && layered_tiles_flag?(x, y, 0x100)
  end
  
  #--------------------------------------------------------------------------
  # * Specifies which type of autotile is used
  #--------------------------------------------------------------------------
  def auto_tile(id)
    id / 48
  end
  
  #--------------------------------------------------------------------------
  # * Specifies the specific arrangement of autotiles used
  #--------------------------------------------------------------------------
  def auto_index(id)
    id % 48
  end
  
  #--------------------------------------------------------------------------
  # * Put the auto-tile pieces together
  #--------------------------------------------------------------------------
  def make_autotile(rects, sx, sy)
    @tile.clear
    for i in 0...4
      @auto_rect.x = (rects[i] % 4) * 16 + sx
      @auto_rect.y = (rects[i] / 4) * 16 + sy
      @tile.blt((i % 2) * 16,(i / 2) * 16, @tilemap, @auto_rect)
    end
  end
    
 #--------------------------------------------------------------------------
  # * Get auto-tile A1 tiles
  #--------------------------------------------------------------------------
  def autotile_A1(tile_id)
    @tilemap = @bitmaps[0]
    autotile = tile_id / 48
    auto_id = tile_id % 48
    sx, sy = A1_TILES[autotile]
    if is_wall?(tile_id + 2048)
      rects = WATERFALL_PIECES[auto_id]
    else  
      rects = AUTOTILE_PARTS[auto_id]
    end
    make_autotile(rects, sx, sy)
  end
  
  #--------------------------------------------------------------------------
  # * Get auto-tile A2 tiles.
  # 64x96 tiles, 8 per row, 4 rows
  #--------------------------------------------------------------------------
  def autotile_A2(tile_id)
    autotile = tile_id / 48
    auto_id = tile_id % 48
    @tilemap = @bitmaps[1]
    sx = (autotile % * 64
    sy = (autotile / 8 % 4) * 96
    rects = AUTOTILE_PARTS[auto_id]
    make_autotile(rects, sx, sy)
  end
  
  #--------------------------------------------------------------------------
  # * Get auto-tile A3 tiles.
  # 64x64 tiles, 8 per row, 4 rows
  #--------------------------------------------------------------------------
  def autotile_A3(tid)
    @tilemap = @bitmaps[2]
    sx = (auto_tile(tid) % * 64
    sy = (auto_tile(tid) / 8 % 4) * 64
    rects = WALL_PIECES[auto_index(tid)]
    make_autotile(rects, sx, sy)
  end
  
  #--------------------------------------------------------------------------
  # * Get auto-tile A4 tiles (walls)
  #--------------------------------------------------------------------------
  def autotile_A4(tile_id)
    @tilemap = @bitmaps[3]
    autotile = tile_id / 48
    auto_id = tile_id % 48
    sx = (autotile % * 64
    sy = (autotile / 16 * 160) + (autotile / 8 % 2) * 96
    if is_wall?(tile_id + 5888)
      rects = WALL_PIECES[auto_id]
    else
      rects = AUTOTILE_PARTS[auto_id]
    end
   make_autotile(rects, sx, sy)
  end
  
  #--------------------------------------------------------------------------
  # * Get auto-tile A5 tiles (normal)
  #--------------------------------------------------------------------------
  def autotile_A5(tile_id)
    @tilemap = @bitmaps[4]
    sx = (tile_id) % 8 * tilesize
    sy = (tile_id) / 8 * tilesize
    @src_rect.set(sx, sy, tilesize, tilesize)
    @tile.clear
    @tile.blt(0, 0, @tilemap, @src_rect)
  end
  
  #--------------------------------------------------------------------------
  # * Get normal tiles B, C, D, E
  #--------------------------------------------------------------------------
  def normal_tile(tile_id)
    @tilemap = @bitmaps[5 + tile_id / 256]
    sx = (tile_id / 128 % 2 * 8 + tile_id % * tilesize;
    sy = (tile_id % 256 / 8 % 16) * tilesize;
    @src_rect.set(sx, sy, tilesize, tilesize)
    @tile.clear
    @tile.blt(0, 0, @tilemap, @src_rect)
  end
  
 #--------------------------------------------------------------------------
  # * Get bitmap for the specified tile id
  #--------------------------------------------------------------------------
  def get_bitmap(id)
    if id < 1024
      normal_tile(id)
    elsif id < 1664
      autotile_A5(id - 1536)
    elsif id < 2816
      autotile_A1(id - 2048)
    elsif id < 4352
      autotile_A2(id - 2816)
    elsif id < 5888
      autotile_A3(id - 4352)
    else
      autotile_A4(id - 5888)
    end
  end
end

#==============================================================================
# **
#==============================================================================

class Game_Player < Game_Character
  
  alias tsuki_mapsaver_update update
  def update
    tsuki_mapsaver_update
    if Input.trigger?(Tsuki::Map_Saver::Mapshot_Button)
      s = Map_Saver.new($game_map.map_id)
      s.set_scale(Tsuki::Map_Saver::Mapshot_Scale)
      s.mapshot
    end
    if Input.trigger?(Tsuki::Map_Saver::Screenshot_Button)
      s = Map_Saver.new($game_map.map_id)
      s.set_scale(Tsuki::Map_Saver::Screenshot_Scale)
      s.screenshot
    end
  end
end

class Game_Vehicle
  attr_reader :map_id
end

#==============================================================================
# **
#==============================================================================

class Map_Saver
  include Tsuki::Map_Saver
  include Map_Tiles
  #--------------------------------------------------------------------------
  # * Constants
  #--------------------------------------------------------------------------

  SHADOW_COLOR = Tsuki::Map_Saver::Shadow_Color
  DAMAGE_COLOR = Tsuki::Map_Saver::Damage_Color
  REGION_COLORS = { 0 => Color.new(0, 0, 0, 0),
                    1 => Color.new(183, 95, 95, Region_Opacity),
                    2 => Color.new(183, 139, 95, Region_Opacity),
                    3 => Color.new(183, 183, 95, Region_Opacity),
                    4 => Color.new(140, 183, 95, Region_Opacity),
                    5 => Color.new(95, 183, 95, Region_Opacity),
                    6 => Color.new(95, 183, 139, Region_Opacity),
                    7 => Color.new(95, 183, 182, Region_Opacity),
                    8 => Color.new(0, 0, 0, 0),
                    9 => Color.new(0, 0, 0, 0),
                    10 => Color.new(0, 0, 0, 0),
                    11 => Color.new(0, 0, 0, 0),
                    12 => Color.new(0, 0, 0, 0),
                    13 => Color.new(0, 0, 0, 0),
                    14 => Color.new(0, 0, 0, 0),
                    15 => Color.new(0, 0, 0, 0),
                    16 => Color.new(0, 0, 0, 0),
                    17 => Color.new(0, 0, 0, 0),
                    18 => Color.new(0, 0, 0, 0),
                    19 => Color.new(0, 0, 0, 0),
                    20 => Color.new(0, 0, 0, 0),
                    21 => Color.new(0, 0, 0, 0),
                    22 => Color.new(0, 0, 0, 0),
                    23 => Color.new(0, 0, 0, 0),
                    24 => Color.new(0, 0, 0, 0),
                    25 => Color.new(0, 0, 0, 0),
                    26 => Color.new(0, 0, 0, 0),
                    27 => Color.new(0, 0, 0, 0),
                    28 => Color.new(0, 0, 0, 0),
                    29 => Color.new(0, 0, 0, 0),
                    30 => Color.new(0, 0, 0, 0),
                    31 => Color.new(0, 0, 0, 0),
                    32 => Color.new(0, 0, 0, 0),
                    33 => Color.new(0, 0, 0, 0),
                    34 => Color.new(0, 0, 0, 0),
                    35 => Color.new(0, 0, 0, 0),
                    36 => Color.new(0, 0, 0, 0),
                    37 => Color.new(0, 0, 0, 0),
                    38 => Color.new(0, 0, 0, 0),
                    39 => Color.new(0, 0, 0, 0),
                    40 => Color.new(0, 0, 0, 0),
                    41 => Color.new(0, 0, 0, 0),
                    42 => Color.new(0, 0, 0, 0),
                    43 => Color.new(0, 0, 0, 0),
                    44 => Color.new(0, 0, 0, 0),
                    45 => Color.new(0, 0, 0, 0),
                    46 => Color.new(0, 0, 0, 0),
                    47 => Color.new(0, 0, 0, 0),
                    48 => Color.new(0, 0, 0, 0),
                    49 => Color.new(0, 0, 0, 0),
                    50 => Color.new(0, 0, 0, 0),
                    51 => Color.new(0, 0, 0, 0),
                    52 => Color.new(0, 0, 0, 0),
                    53 => Color.new(0, 0, 0, 0),
                    54 => Color.new(0, 0, 0, 0),
                    55 => Color.new(0, 0, 0, 0),
                    56 => Color.new(0, 0, 0, 0),
                    57 => Color.new(0, 0, 0, 0),
                    58 => Color.new(0, 0, 0, 0),
                    59 => Color.new(0, 0, 0, 0),
                    60 => Color.new(0, 0, 0, 0),
                    61 => Color.new(0, 0, 0, 0),
                    62 => Color.new(0, 0, 0, 0),
                    63 => Color.new(0, 0, 0, 0)
                   }

  #--------------------------------------------------------------------------
  # * Public instance variables
  #--------------------------------------------------------------------------
  attr_reader :map_image
  attr_accessor :screen_local
  attr_accessor :scale
  attr_accessor :draw_layer0
  attr_accessor :draw_layer1
  attr_accessor :draw_layer2
  attr_accessor :draw_shadow
  attr_accessor :draw_regions
  attr_accessor :draw_damage
  attr_accessor :draw_vehicles
  attr_accessor :draw_events
  attr_accessor :draw_player
  
  def initialize(map_id=$game_map.map_id, x=$game_player.x, y=$game_player.y)
    @scale = 1
    @local_x = x
    @local_y = y
    @screen_local = false
    @shadow_bitmap = Bitmap.new(128, 128)
    @draw_layer0 = true
    @draw_layer1 = true
    @draw_layer2 = true
    @draw_events = Draw_Events
    @draw_vehicles = Draw_Vehicles
    @draw_player = Draw_Player
    @draw_followers = Draw_Followers
    @draw_shadow = Draw_Shadow
    @draw_damage = Highlight_Damage
    @draw_regions = Draw_Regions
    @tile = Bitmap.new(32, 32) #stores the current tile to be drawn
    @tilemap = nil
    @src_rect = Rect.new
    @auto_rect = Rect.new(0, 0, tilesize / 2, tilesize/ 2) #constant
    @tile_rect = Rect.new(0, 0, tilesize, tilesize)        #constant
  end
  
  def load_tilesets
    bitmaps = []
    tileset.tileset_names.each_with_index do |name, i|
      bitmaps[i] = Cache.tileset(name)
    end
    return bitmaps
  end
  
  #--------------------------------------------------------------------------
  # * Refresh, possibly with a new map
  #--------------------------------------------------------------------------
  def redraw(map_id=$game_map.map_id, x=$game_player.x, y=$game_player.y)
    @map_image.dispose if @map_image
    @map_id = map_id
    @local_x = x
    @local_y = y
    @map = load_data(sprintf("Data/Map%03d.rvdata2", @map_id))
    @map_info = $data_mapinfos[map_id]
    @screen = $game_map.screen
    @tileset_id = @map.tileset_id
    @bitmaps = load_tilesets
    
    get_bounds
    @map_image = Bitmap.new(@width * tilesize, @height * tilesize)
    draw_map
    scale_map if @scale != 1
  end
  
  #--------------------------------------------------------------------------
  # * Pre-process. These will never change when drawing the map.
 #--------------------------------------------------------------------------
  def get_bounds
    @start_x = start_x
    @start_y = start_y
    @end_x = end_x
    @end_y = end_y
    @width = width
    @height = height
    @tilesize = tilesize
  end
  
  def screen_tile_x
    Graphics.width / 32
  end
  
  def screen_tile_y
    Graphics.height / 32
  end
  
  #--------------------------------------------------------------------------
  # * Sets the scale for the map
  #--------------------------------------------------------------------------
  def set_scale(scale)
    @scale = scale
  end
  
  #--------------------------------------------------------------------------
  # * Size of a tile
  #--------------------------------------------------------------------------
  def tilesize
    32
  end
  
  #--------------------------------------------------------------------------
  # * Width and height of the map, both locally and globally
  #--------------------------------------------------------------------------
  def width
    end_x - @start_x
  end
  
  def height
    end_y - @start_y
  end
  
  #--------------------------------------------------------------------------
  # * Starting and end positions, relative to the screen or map
  #--------------------------------------------------------------------------
  def start_x
    @screen_local ? [[$game_player.x - screen_tile_x / 2, @map.width - screen_tile_x].min, 0].max : 0
  end

  def start_y
    @screen_local ? [[$game_player.y - screen_tile_y / 2, @map.height - screen_tile_y].min, 0].max : 0
  end
  
  def end_x
    @screen_local ? [[screen_tile_x, @local_x + screen_tile_x / 2 + 1].max, @map.width].min : @map.width
  end
  
  def end_y
    @screen_local ? [[screen_tile_y, @local_y + screen_tile_y / 2 + 1].max, @map.height].min : @map.height
  end

  #--------------------------------------------------------------------------
  # * Draw tile onto image. x and y values are absolute coords. They should
  # be re-mapped based on the start_x and start_y values
  #--------------------------------------------------------------------------
  def draw_tile(x, y, tile, rect)
    ox = (x - @start_x) * tilesize
    oy = (y - @start_y) * tilesize
    @map_image.blt(ox, oy, tile, rect)
  end
  
  #--------------------------------------------------------------------------
  # * Get bitmap for the specified character
  #--------------------------------------------------------------------------
  def get_character_bitmap(name)
    charmap = Cache.character(name)
    sign = name[/^[\!\$]./]
    if sign && sign.include?('$')
      cw = charmap.width / 3
      ch = charmap.height / 4
    else
      cw = charmap.width / 12
      ch = charmap.height / 8
    end
    return charmap, cw, ch
  end
  
  #--------------------------------------------------------------------------
  # * Draw the character onto the tile
  #--------------------------------------------------------------------------
  def set_character_bitmap(character, x, y)
    charmap, cw, ch = get_character_bitmap(character.character_name)
    index = character.character_index
    pattern = character.pattern < 3 ? character.pattern : 1
    sx = (index % 4 * 3 + pattern) * cw
    sy = (index / 4 * 4 + (character.direction - 2) / 2) * ch
    @src_rect.set(sx, sy, cw, ch)
    x -= cw / (@tilesize * 2) if cw >= @tilesize
    y -= ch / (@tilesize * 2) if ch >= @tilesize  
    draw_tile(x, y, charmap, @src_rect)
  end
  
  #--------------------------------------------------------------------------
  # * create the shadow map
  #--------------------------------------------------------------------------
  def make_shadow_map
    for s in 0 ... 16
      x = s % 4
      y = s / 4
      if s & 0b1000 == 0b1000
        @shadow_bitmap.fill_rect(x*tilesize+16, y*@tilesize+16, 16, 16, SHADOW_COLOR)
      end
      if s & 0b0100 == 0b0100
        @shadow_bitmap.fill_rect(x*tilesize, y*@tilesize+16, 16, 16, SHADOW_COLOR)
      end
      if s & 0b0010 == 0b0010
        @shadow_bitmap.fill_rect(x*tilesize+16, y*@tilesize, 16, 16, SHADOW_COLOR)
      end
      if s & 0b0001 == 0b0001
        @shadow_bitmap.fill_rect(x*tilesize, y*@tilesize, 16, 16, SHADOW_COLOR)
      end
    end
  end
  
  def draw_parallax
    image = Cache.parallax(@map.parallax_name)
    @src_rect.set(0, 0, image.width, image.height)
    @map_image.blt(0, 0, image, @src_rect)
  end
  
  #--------------------------------------------------------------------------
  # * Draw the shadow map
  #--------------------------------------------------------------------------
  def draw_shadow_map
    for x in @start_x ... @end_x
      for y in @start_y ... @end_y
      _x, _y = x*@tilesize, y*@tilesize
        s = @map.data[x, y, 3]  & 0b1111
        if s != 0
          x_ = (s % 4) * @tilesize
          y_ = (s / 4) * @tilesize
          @src_rect.set(x_, y_, @tilesize, @tilesize)
          draw_tile(x, y, @shadow_bitmap, @src_rect)
        end
      end
    end
  end
  
  #--------------------------------------------------------------------------
  # * Draw the specified layer
  #--------------------------------------------------------------------------
  def draw_layer(layer)
    for x in @start_x ... @end_x
      for y in @start_y ... @end_y
        _x, _y = x*@tilesize, y*@tilesize
        tile_id = @map.data[x, y, layer]
        next if tile_id == 0
        get_bitmap(tile_id)
        draw_tile(x, y, @tile, @tile_rect)
      end
    end
  end

  #--------------------------------------------------------------------------
  # * Draw the game player
  #--------------------------------------------------------------------------
  def draw_player
    set_character_bitmap($game_player, $game_player.x, $game_player.y) if @map_id == $game_map.map_id
  end
  
  def draw_followers
  end
  
  #--------------------------------------------------------------------------
  # * Draw map events
  #--------------------------------------------------------------------------
  def draw_events
    @map.events.values.each do |event|
      id = event.pages[0].graphic.tile_id
      char_name = event.pages[0].graphic.character_name
      if id > 0
        normal_tile(id)
        draw_tile(event.x, event.y, @tilemap, @src_rect)
      elsif char_name != ""
        set_character_bitmap(event.pages[0].graphic, event.x, event.y)
      end
    end
  end
  
  #--------------------------------------------------------------------------
  # * Draw map vehicles
  #--------------------------------------------------------------------------
  def draw_vehicles
    $game_map.vehicles.each do |vehicle|
      set_character_bitmap(vehicle, vehicle.x, vehicle.y,) if @map_id == vehicle.map_id
    end
  end
  
  #--------------------------------------------------------------------------
  # * Draw map sprites
  #--------------------------------------------------------------------------
  def draw_sprites
    draw_events if @draw_events
    draw_vehicles if @draw_vehicles
    draw_player if @draw_player
    draw_followers if @draw_followers
  end
  
  #--------------------------------------------------------------------------
  # * Highlight damage tiles
  #--------------------------------------------------------------------------
  def draw_damage
    @tile.clear
    @tile.fill_rect(0, 0, @tilesize, @tilesize, DAMAGE_COLOR)
    @src_rect.set(0, 0, @tilesize, @tilesize)
    for x in @start_x ... @end_x
      for y in @start_y ... @end_y
        _x, _y = x*@tilesize, y*@tilesize
        if damage_floor?(x, y)
          draw_tile(x, y, @tile, @src_rect)
        end
      end
    end
  end
  
  #--------------------------------------------------------------------------
  # * Highlight regions
  #--------------------------------------------------------------------------
  def draw_regions
    for x in @start_x ... @end_x
      for y in @start_y ... @end_y
        _x, _y = x*@tilesize, y*@tilesize
        @tile.fill_rect(0, 0, @tilesize, @tilesize, REGION_COLORS[region_id(x,y)])
        draw_tile(x, y, @tile, @src_rect)
      end
    end
  end
  
  def draw_screen_effects
  end
  #--------------------------------------------------------------------------
  # * Draw the map
  #--------------------------------------------------------------------------
  def draw_map
    make_shadow_map if @draw_shadow
    draw_parallax
    draw_layer(0)
    draw_layer(1)
    draw_shadow_map
    draw_layer(2)
    draw_damage if @draw_damage
    draw_regions if @draw_regions
    draw_sprites
    draw_screen_effects
  end
  
  #--------------------------------------------------------------------------
  # * Scale the map
  #--------------------------------------------------------------------------
  def scale_map
    nw = @width * @scale
    nh = @height * @scale
    @src_rect.set(0, 0, @width, @height)
    scaled_map = Bitmap.new(nw, nh)
    scaled_rect = Rect.new(0, 0, nw, nh)
    scaled_map.stretch_blt(scaled_rect, @map_image, @src_rect)
    @map_image = scaled_map
  end
  
  #--------------------------------------------------------------------------
  # * Take a mapshot of the map
  #--------------------------------------------------------------------------
  def mapshot
    @screen_local = false
    redraw
    export(Tsuki::Map_Saver::Mapshot_Directory)
    $game_message.add("Mapshot taken")
  end
    
  #--------------------------------------------------------------------------
  # * Take a screenshot of the map
  #--------------------------------------------------------------------------
  def screenshot
    @screen_local = true
    redraw
    export(Tsuki::Map_Saver::Screenshot_Directory)
    $game_message.add("Screenshot taken")
  end
  
  #--------------------------------------------------------------------------
  # * Get the format to export to
  #--------------------------------------------------------------------------
  def get_format
    if Tsuki::Map_Saver::Crashes
      format = Tsuki::Map_Saver::Crash_Format
    else
      format = Tsuki::Map_Saver::Export_Format
    end
  end
  
  #--------------------------------------------------------------------------
  # * Export the map to a file
  #--------------------------------------------------------------------------
  def export(dirName)
    format = get_format
    name = @map.display_name != "" ? @map.display_name : @map_info.name
    Dir.mkdir(dirName) unless File.directory?(dirName)
    filename = "%s\\%s.%s" %[dirName, name, format]
    t1 = Time.now
    @map_image.export(filename, format)
    t2 = Time.now
    $game_message.add("Exported in %f seconds" %[t2 - t1])
  end
end

module Zlib
  class Png_File < GzipWriter
    
    ARGB2BGRA = Win32API.new('System/argb2bgra.dll', 'ARGB2BGRA', 'PL', '')
    #--------------------------------------------------------------------------
    # ● Main
    #--------------------------------------------------------------------------
   def make_png(bitmap_Fx,mode)
      @mode = mode
      @bitmap_Fx = bitmap_Fx
      self.write(make_header)
      self.write(make_ihdr)
      self.write(make_idat)
      self.write(make_iend)
    end
    #--------------------------------------------------------------------------
    # ● PNG file header block
    #--------------------------------------------------------------------------
    def make_header
      return [0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a].pack("C*")
    end
    #--------------------------------------------------------------------------
    # ● PNG file data block header information (IHDR)
    #--------------------------------------------------------------------------
   def make_ihdr
      ih_size = [13].pack("N")
      ih_sign = "IHDR"
      ih_width = [@bitmap_Fx.width].pack("N")
      ih_height = [@bitmap_Fx.height].pack("N")
      ih_bit_depth = [8].pack("C")
      ih_color_type = [6].pack("C")
      ih_compression_method = [0].pack("C")
      ih_filter_method = [0].pack("C")
      ih_interlace_method = [0].pack("C")
      string = ih_sign + ih_width + ih_height + ih_bit_depth + ih_color_type +
               ih_compression_method + ih_filter_method + ih_interlace_method
      ih_crc = [Zlib.crc32(string)].pack("N")
      return ih_size + string + ih_crc
    end
    #--------------------------------------------------------------------------
    # ● Generated image data (IDAT)
    #--------------------------------------------------------------------------
   def make_idat
      header = "\x49\x44\x41\x54"
      case @mode # please 54 ~
      when 1
        data = make_bitmap_data # 1
      else
        data = make_bitmap_data
      end
      data = Zlib::Deflate.deflate(data,
     crc = [Zlib.crc32(header + data)].pack("N")
      size = [data.length].pack("N")
      return size + header + data + crc
    end
    #--------------------------------------------------------------------------
    # ● Requests from the Bitmap object 54 to generate image data in mode 1
   # (please 54 ~)
    #--------------------------------------------------------------------------
   def make_bitmap_data1
      w = @bitmap_Fx.width
      h = @bitmap_Fx.height
      data = []
      for y in 0...h
        data.push(0)
        for x in 0...w
          color = @bitmap_Fx.get_pixel(x, y)
          red = color.red
          green = color.green
          blue = color.blue
          alpha = color.alpha
          data.push(red)
          data.push(green)
          data.push(blue)
          data.push(alpha)
        end
      end
      return data.pack("C*")
    end
    #--------------------------------------------------------------------------
    # ● Bitmap object from the image data generated in mode 0
    #--------------------------------------------------------------------------
   def make_bitmap_data
      w, h = @bitmap_Fx.width, @bitmap_Fx.height
      w_4  = w * 4
      #-----
      rdata_ptr   = DL::CPtr.new((@bitmap_Fx.object_id<<1)+16, 4)[0, 4].unpack('I')[0]
      bm_info_ptr = DL::CPtr.new(rdata_ptr+8, 4)[0, 4].unpack('I')[0]
      bm_data_ptr = DL::CPtr.new(bm_info_ptr+12, 4)[0, 4].unpack('I')[0]
      data        = DL::CPtr.new(bm_data_ptr)
      s           = "\0" * (w_4 * h)
      s.clear
      for i in 0 ... h
        s << "\0"
        t_data = data[0, w_4]
        if Tsuki::Map_Saver::Crashes
          for ix in 0 ... w
          x = ix * 4
          t_data[x+2], t_data[x] = t_data[x], t_data[x+2]
          end
        else
          ARGB2BGRA.call(t_data, w)
        end
        data = data - (w_4)
        s.concat(t_data)
      end
      return s
    end
    
    #--------------------------------------------------------------------------
    # ● PNG end of the file data blocks (IEND)
    #--------------------------------------------------------------------------
   def make_iend
      ie_size = [0].pack("N")
      ie_sign = "IEND"
      ie_crc = [Zlib.crc32(ie_sign)].pack("N")
      return ie_size + ie_sign + ie_crc
    end
  end
end
#==============================================================================
# ■ Bitmap
#------------------------------------------------------------------------------
# Related to the Bitmap.
#==============================================================================
class Bitmap
  
  #--------------------------------------------------------------------------
  # ● Related
  #--------------------------------------------------------------------------
 def make_png(name="like", path="",mode=0)
    make_dir(path) if path != ""
    Zlib::Png_File.open("temp.gz") {|gz|
      gz.make_png(self,mode)
    }
    Zlib::GzipReader.open("temp.gz") {|gz|
      $read = gz.read
    }
    f = File.open(name,"wb")
    f.write($read)
    f.close
    File.delete('temp.gz')
   end
  #--------------------------------------------------------------------------
  # ● Save the path generated
  #--------------------------------------------------------------------------
 def make_dir(path)
    dir = path.split("/")
    for i in 0...dir.size
      unless dir == "."
        add_dir = dir[0..i].join("/")
        begin
          Dir.mkdir(add_dir)
        rescue
        end
      end
    end
  end
  
  def write_pixels(file)
    pixels = []
    for y in (self.height - 1).downto(0)
      for x in 0..self.width - 1
        pix = self.get_pixel(x,y)
        pixels.concat([pix.blue, pix.green, pix.red])
      end
    end
    file.write(pixels.pack('C%d' %pixels.length))
  end
  
  def make_bmp(filename)
    file = File.open(filename, 'wb')
    size = width*height*3
    file.write(['BM',size+54,0,54,40,width,height,1,24,0,size,0,0,0,0].pack('a2L6S2L6'))
    write_pixels(file)
    file.close
  end
  
  def export(name, format="png")
    if format == "png"
      make_png(name)
    elsif format == "bmp"
      make_bmp(name)
    elsif format == "tga" && !Tsuki::Map_Saver::Crashes
      Win32API.new('System/bitmap2file.dll', 'Bitmap2File', 'LP', '').call(self.object_id, name)
    else
      $game_message.add("Unsupported format")
    end
  end
end

#==============================================================================
# * Compatibility add-ons
#==============================================================================
#Yami overlays
if $imported["YSE-OverlayMapping"]
  class Map_Saver
    def draw_overlay_map_ground
      filename = YSA::OVERLAY::GROUND
      filename += $game_map.map_id.to_s
      filename += "-" + $game_variables[YSA::OVERLAY::GROUND_VARIABLE].to_s
      p filename
      image = Cache.overlay(filename)
      @src_rect.set(@start_x*tilesize, @start_y*tilesize, image.width, image.height)
      @map_image.blt(0, 0, image, @src_rect)
    end
    
    def draw_overlay_map_parallax
      filename = YSA::OVERLAY::PARALLAX
      filename += $game_map.map_id.to_s
      filename += "-" + $game_variables[YSA::OVERLAY::PARALLAX_VARIABLE].to_s
      image = Cache.overlay(filename)
      @src_rect.set(@start_x*tilesize, @start_y*tilesize, image.width, image.height)
      @map_image.blt(0, 0, image, @src_rect)
    end
    
    def draw_overlay_map_light
      filename = YSA::OVERLAY::LIGHT
      filename += $game_map.map_id.to_s
      filename += "-" + $game_variables[YSA::OVERLAY::LIGHT_VARIABLE].to_s
      image = Cache.overlay(filename)
      @src_rect.set(@start_x*tilesize, @start_y*tilesize, image.width, image.height)
      @map_image.blt(0, 0, image, @src_rect, 10)
    end
    
    def draw_overlay_map_shadow
      filename = YSA::OVERLAY::SHADOW
      filename += $game_map.map_id.to_s
      filename += "-" + $game_variables[YSA::OVERLAY::SHADOW_VARIABLE].to_s
      image = Cache.overlay(filename)
      @src_rect.set(@start_x*tilesize, @start_y*tilesize, image.width, image.height)
      @map_image.blt(0, 0, image, @src_rect, 10)
    end
  
    alias :th_map_overlay_draw_map :draw_map
    def draw_map
      th_map_overlay_draw_map
      draw_overlay_map_ground if $game_switches[YSA::OVERLAY::GROUND_SWITCH]
     draw_overlay_map_parallax if $game_switches[YSA::OVERLAY::PARALLAX_SWITCH]
     draw_overlay_map_shadow if $game_switches[YSA::OVERLAY::SHADOW_SWITCH]
      draw_overlay_map_light if $game_switches[YSA::OVERLAY::LIGHT_SWITCH]
    end
  end
end


Utilisation :

F6 : Fait un screenshot de ce que tu vois à l'écran.

F7 : Fait un screenshot de toute la carte sur laquelle tu te trouves.

Les images sont stockées dans le dossier de ton projet sous "Mapshots" et "Screenshots".
Heaven
Heaven
Staffeux retraité

Nombre de messages : 2441
Age : 23
Localisation : Alpes-Maritimes VIRILITÉ OLALA
Distinction : Aucune
Date d'inscription : 18/10/2012

Capture d'écran/Screenshot d'une map compléte Empty Re: Capture d'écran/Screenshot d'une map compléte

Ven 14 Juin 2013 - 22:24
Je connaissais pas ce script ^^
C'est pour quel RM =/ ?


Heav'n
Spytje
Spytje
Administrateur

Nombre de messages : 5935
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008

Capture d'écran/Screenshot d'une map compléte Empty Re: Capture d'écran/Screenshot d'une map compléte

Ven 14 Juin 2013 - 22:31
Il est pour Ace, mais il est possible de le trouver pour VX également et pas impossible sous XP.
emiya
emiya
Membre

Nombre de messages : 20
Distinction : aucune
Date d'inscription : 09/06/2013

Capture d'écran/Screenshot d'une map compléte Empty Re: Capture d'écran/Screenshot d'une map compléte

Ven 14 Juin 2013 - 22:34
Merci mais euh..tu pourrais m'expliquer comment utiliser ce script exactement ?
J'ai ouvert l'éditeur vx ace , je l'ai collé dans l'éditeur de script ( sur une page qui était vide ) et maintenant ? ça ne fait rien quand je clique sur F6 ou sur F7 . et je n'ai pas de dossier Mapshots..
Désolé de vous importuner
Spytje
Spytje
Administrateur

Nombre de messages : 5935
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008

Capture d'écran/Screenshot d'une map compléte Empty Re: Capture d'écran/Screenshot d'une map compléte

Ven 14 Juin 2013 - 22:40
Pas de soucis,

Pour commencer tu places ce script juste au dessus du script qui se nomme "main"

Ensuite tu commences ton jeu comme d'habitude, une fois sur une carte tu tapes F6 ou F7 pour faire un screenshot de la carte ou l'écran de jeu.

Tu dois avoir un message qui s'affiche lorsque tu tapes F6 ou F7, il te confirme que l'image a été créée.
emiya
emiya
Membre

Nombre de messages : 20
Distinction : aucune
Date d'inscription : 09/06/2013

Capture d'écran/Screenshot d'une map compléte Empty Re: Capture d'écran/Screenshot d'une map compléte

Ven 14 Juin 2013 - 22:45
D'accord merci Smile
Undweed
Undweed
Membre

Nombre de messages : 51
Distinction : aucune
Date d'inscription : 15/09/2012

Capture d'écran/Screenshot d'une map compléte Empty Re: Capture d'écran/Screenshot d'une map compléte

Sam 15 Juin 2013 - 23:59
Sinon tu peux aussi, dans l'éditeur changer l'échelle d'affichage de la map et prendre un screen, plus qu'à le recadrer Smile
Contenu sponsorisé

Capture d'écran/Screenshot d'une map compléte Empty Re: Capture d'écran/Screenshot d'une map compléte

Revenir en haut
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum