Project1

标题: 有关板凳优先级的问题。。 [打印本页]

作者: 绯红の夜魔    时间: 2015-1-2 22:26
标题: 有关板凳优先级的问题。。


像这样的。。。该怎么让它不会盖住头QAQ?
作者: 三途亚梦    时间: 2015-1-2 22:35
把板凳的素材做成一个“character”图像素材,用事件来显示。
作者: 绯红の夜魔    时间: 2015-1-2 22:46
三途亚梦 发表于 2015-1-2 22:35
把板凳的素材做成一个“character”图像素材,用事件来显示。

character是什么呀。。
那个截图就是事件显示的。。可是要怎么设置。。
作者: 绯红の夜魔    时间: 2015-1-2 23:48
绯红の夜魔 发表于 2015-1-2 22:46
character是什么呀。。
那个截图就是事件显示的。。可是要怎么设置。。


这样后面就无法通行哎。。
作者: 绯红の夜魔    时间: 2015-1-3 00:03
三途亚梦 发表于 2015-1-2 22:35
把板凳的素材做成一个“character”图像素材,用事件来显示。

不会裁剪QAQ。素材不会弄。。。你说的方法我理解了。感谢的说。。不过还有其他办法么。。
如果没有我就去琢磨一下PS了QAQ。。
作者: 绯红の夜魔    时间: 2015-1-3 01:43

大概明白了。。。不过又出现这样的问题。。先水平32垂直就无法32.。先垂直32也同样。。是PS问题么?
作者: 企鹅达达    时间: 2015-1-6 09:28
本帖最后由 企鹅达达 于 2015-1-6 09:31 编辑
  1. ##-----------------------------------------------------------------------------
  2. #  Large Sprite ☆ Display Fix v1.3
  3. #  Created by Neon Black at request of seita
  4. #  v1.3 - 1.12.14 - Viewport/position issue fixes
  5. #  v1.1 - 8.18.13 - Fixed an odd lag issue
  6. #  v1.0 - 8.17.13 - Main script completed
  7. #  For both commercial and non-commercial use as long as credit is given to
  8. #  Neon Black and any additional authors.  Licensed under Creative Commons
  9. #  CC BY 4.0 - http://creativecommons.org/licenses/by/4.0/
  10. ##-----------------------------------------------------------------------------

  11. ##------
  12. ## By default, this script only affects the player.  To allow it to affect
  13. ## an event page as well, add a comment with the tag <large sprite> to the page
  14. ## of the event you would like to have affected by this.

  15. class Sprite_Character < Sprite_Base
  16.   ##------
  17.   ## The ID of the terrain used to display the large character above ☆ tiles.
  18.   ## If the player is below this tile (y position), the sprite will appear
  19.   ## above all tiles and events from that y position up.  If the player is on
  20.   ## the same tile or above (y position) the event will appear BELOW ☆ tiles
  21.   ## from that position up.
  22.   ##------
  23.   UpperTerrain = 3
  24.   
  25.   alias :cp_011214_update_bitmap :update_bitmap
  26.   def update_bitmap(*args)
  27.     if graphic_changed? && @set_upper_area_sprite
  28.       @force_no_gfx_change = true
  29.     else
  30.       @force_no_gfx_change = false
  31.     end
  32.     cp_011214_update_bitmap(*args)
  33.   end

  34.   ## Alias the update method to add in the new graphic check.
  35.   alias :cp_073013_update_pos :update_position
  36.   def update_position(*args)
  37.     cp_073013_update_pos(*args)
  38.     check_encompassed_area if sprite_is_onscreen?
  39.   end

  40.   ## Alias the dispose to dispose the upper sprite.
  41.   alias :cp_073013_dispose :dispose
  42.   def dispose(*args)
  43.     @upper_area_sprite.dispose if @upper_area_sprite
  44.     cp_073013_dispose(*args)
  45.   end

  46. #~   ## Alias the graphic changed method to allow the sprite to revent to what it
  47. #~   ## was during the last frame.  This allows the check to work again.
  48. #~   alias :cp_073013_graphic_changed? :graphic_changed?
  49. #~   def graphic_changed?(*args)
  50. #~     cp_073013_graphic_changed?(*args) || @set_upper_area_sprite
  51. #~   end

  52.   ## Check if the sprite is onscreen.  Reduces redundant drawing.
  53.   def sprite_is_onscreen?
  54. #~     return false if @character.is_a?(Game_Vehicle) || @character.is_a?(Game_Follower)
  55. #~     return false unless @character.is_a?(Game_Player) || @character.large_sprite
  56.     return false if @character.is_a?(Game_Vehicle)
  57.     return false unless @character.is_a?(Game_Player) || @character.is_a?(Game_Follower) || @character.large_sprite
  58.     return false if @character.screen_z >= 200
  59.     top_left, bot_right = get_edge_corner_dis
  60.     return false if top_left[0] > Graphics.width
  61.     return false if top_left[1] > Graphics.height
  62.     return false if bot_right[0] < 0
  63.     return false if bot_right[1] < 0
  64.     return true
  65.   end

  66.   ## Get the top left and bottom right positions.
  67.   def get_edge_corner_dis
  68.     top_left = [self.x - self.ox, self.y - self.oy]
  69.     bot_right = [top_left[0] + self.width, top_left[1] + self.height]
  70.     return [top_left, bot_right]
  71.   end

  72.   ## Long method that checks each position and draws the upper sprite.
  73.   def check_encompassed_area
  74.     if @set_upper_area_sprite && !@force_no_gfx_change
  75.       old_src = self.src_rect.clone
  76.       self.bitmap = @old_bitmap
  77.       self.src_rect = old_src
  78.     end
  79.     @set_upper_area_sprite = false
  80.     top_left, bot_right = get_edge_corner_dis
  81.     last_x, last_y, copy_region = nil, nil, 0
  82.     map_xd, map_yd = $game_map.display_x * 32, $game_map.display_y * 32
  83.     total_height = (self.height + @character.jump_height).round
  84.     self.width.times do |x|
  85.       xp = map_xd.to_i + top_left[0] + x
  86.       unless xp / 32 == last_x
  87.         last_x = xp / 32
  88.         last_y, copy_region = nil, 0
  89.         total_height.times do |y|
  90.           yp = map_yd.to_i + bot_right[1] + @character.jump_height - y
  91.           next if yp.to_i / 32 == last_y
  92.           last_y = yp.to_i / 32
  93.           if last_y == (@character.screen_y + @character.jump_height +
  94.                         map_yd).to_i / 32
  95.             break if $game_map.terrain_tag(last_x, last_y) == UpperTerrain
  96.             next
  97.           end
  98.           next if $game_map.terrain_tag(last_x, last_y) != UpperTerrain
  99.           copy_region = [self.height, total_height - y + 1].min
  100.           set_upper_sprite
  101.           break
  102.         end
  103.       end
  104.       next if copy_region == 0
  105.       rect = Rect.new(src_rect.x + x, src_rect.y, 1, copy_region)
  106.       @upper_area_sprite.bitmap.blt(x, 0, self.bitmap, rect)
  107.       self.bitmap.clear_rect(rect)
  108.     end
  109.     if !@set_upper_area_sprite && @upper_area_sprite
  110.       @upper_area_sprite.visible = false
  111.     end
  112.   end

  113.   ## Creates the upper sprite that's a copy of the current sprite.
  114.   def set_upper_sprite
  115.     return if @set_upper_area_sprite
  116.     @upper_area_sprite ||= Sprite.new
  117.     @upper_area_sprite.bitmap = Bitmap.new(self.width, self.height)
  118.     props = ["x", "y", "ox", "oy", "zoom_x", "zoom_y", "angle", "mirror",
  119.              "bush_depth", "opacity", "blend_type", "color", "tone", "visible",
  120.              "viewport"]
  121.     props.each do |meth|
  122.       @upper_area_sprite.method("#{meth}=").call(self.method(meth).call)
  123.     end
  124.     @upper_area_sprite.z = 200
  125.     @set_upper_area_sprite = true
  126.     @old_bitmap, old_src_rect = self.bitmap, self.src_rect.clone
  127.     self.bitmap = Bitmap.new(@old_bitmap.width, @old_bitmap.height)
  128.     self.bitmap.blt(0, 0, @old_bitmap, @old_bitmap.rect)
  129.     self.src_rect = old_src_rect
  130.   end
  131. end

  132. class Game_Event < Game_Character
  133.   attr_reader :large_sprite

  134.   alias :cp_081713_setup_page_settings :setup_page_settings
  135.   def setup_page_settings(*args)
  136.     cp_081713_setup_page_settings(*args)
  137.     get_large_sprite_conditions
  138.   end

  139.   def get_large_sprite_conditions
  140.     @large_sprite = false
  141.     return if @list.nil? || @list.empty?
  142.     @list.each do |line|
  143.       next unless line.code == 108 || line.code == 408
  144.       case line.parameters[0]
  145.       when /<large sprite>/i
  146.         @large_sprite = true
  147.       end
  148.     end
  149.   end
  150. end
复制代码
插入脚本,把椅背的图块“地形标志”标为3。这个脚本如果人物行走图太宽会出问题,不过默认大小没关系

代理出了问题所以直接贴上来了。来源请看脚本里的网址




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1