设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
12
返回列表 发新帖
楼主: 酷酷小老恭
打印 上一主题 下一主题

怎么使战斗背景 满屏显示?

 关闭 [复制链接]
11
乌有君  发表于 2007-8-30 17:22:35
  1. #==============================================================================
  2. # ■ Game_Actor
  3. #------------------------------------------------------------------------------
  4. #  アクターを扱うクラスです。このクラスは Game_Actors クラス ($game_actors)
  5. # の内部で使用され、Game_Party クラス ($game_party) からも参照されます。
  6. #==============================================================================
  7. =begin
  8. class Game_Actor < Game_Battler
  9. #--------------------------------------------------------------------------
  10. # ● バトル画面 X 座標の取得
  11. #--------------------------------------------------------------------------
  12. def screen_x
  13.    # パーティ内の並び順から X 座標を計算して返す
  14.    if self.index != nil
  15.      return self.index * 160 + (4 - $game_party.actors.size) * 80 + 80
  16.    else
  17.      return 0
  18.    end
  19. end
  20. =end

  21. #==============================================================================
  22. # ■ Spriteset_Battle
  23. #------------------------------------------------------------------------------
  24. #  バトル画面のスプライトをまとめたクラスです。このクラスは Scene_Battle クラ
  25. # スの内部で使用されます。
  26. #==============================================================================

  27. class Spriteset_Battle
  28. #--------------------------------------------------------------------------
  29. # ● オブジェクト初期化
  30. #--------------------------------------------------------------------------
  31. def initialize
  32.    # ビューポートを作成
  33.    @viewport1 = Viewport.new(0, 0, 640, 480)
  34.    @viewport2 = Viewport.new(0, 0, 640, 480)
  35.    @viewport3 = Viewport.new(0, 0, 640, 480)
  36.    @viewport4 = Viewport.new(0, 0, 640, 480)
  37.    @viewport2.z = 101
  38.    @viewport3.z = 200
  39.    @viewport4.z = 5000
  40.    # バトルバックスプライトを作成
  41.    @battleback_sprite = Sprite.new(@viewport1)
  42.    # エネミースプライトを作成
  43.    @enemy_sprites = []
  44.    for enemy in $game_troop.enemies.reverse
  45.      @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
  46.    end
  47.    # アクタースプライトを作成
  48.    @actor_sprites = []
  49.    @actor_sprites.push(Sprite_Battler.new(@viewport2))
  50.    @actor_sprites.push(Sprite_Battler.new(@viewport2))
  51.    @actor_sprites.push(Sprite_Battler.new(@viewport2))
  52.    @actor_sprites.push(Sprite_Battler.new(@viewport2))
  53.    # 天候を作成
  54.    @weather = RPG::Weather.new(@viewport1)
  55.    # ピクチャスプライトを作成
  56.    @picture_sprites = []
  57.    for i in 51..100
  58.      @picture_sprites.push(Sprite_Picture.new(@viewport3,
  59.        $game_screen.pictures[i]))
  60.    end
  61.    # タイマースプライトを作成
  62.    @timer_sprite = Sprite_Timer.new
  63.    # フレーム更新
  64.    update
  65. end
  66. #--------------------------------------------------------------------------
  67. # ● フレーム更新
  68. #--------------------------------------------------------------------------
  69. def update
  70.    # アクタースプライトの内容を更新 (アクターの入れ替えに対応)
  71.    @actor_sprites[0].battler = $game_party.actors[0]
  72.    @actor_sprites[1].battler = $game_party.actors[1]
  73.    @actor_sprites[2].battler = $game_party.actors[2]
  74.    @actor_sprites[3].battler = $game_party.actors[3]
  75.    # バトルバックのファイル名が現在のものと違う場合
  76.    if @battleback_name != $game_temp.battleback_name
  77.      @battleback_name = $game_temp.battleback_name
  78.      if @battleback_sprite.bitmap != nil
  79.        @battleback_sprite.bitmap.dispose
  80.      end
  81.      @battleback_sprite.bitmap = RPG::Cache.battleback(@battleback_name)
  82.      @battleback_sprite.src_rect.set(0, 0, 640, 480)
  83.      if @battleback_sprite.bitmap.height == 320
  84.        @battleback_sprite.zoom_x = 2.0
  85.        @battleback_sprite.zoom_y = 2.0
  86.        @battleback_sprite.x = 320
  87.        @battleback_sprite.y = 480
  88.        @battleback_sprite.ox = @battleback_sprite.bitmap.width / 2
  89.        @battleback_sprite.oy = @battleback_sprite.bitmap.height
  90.      else
  91.        @battleback_sprite.x = 0
  92.        @battleback_sprite.y = 0
  93.        @battleback_sprite.ox = 0
  94.        @battleback_sprite.oy = 0
  95.        @battleback_sprite.zoom_x = 1
  96.        @battleback_sprite.zoom_y = 1
  97.      end
  98.    end
  99.    # バトラースプライトを更新
  100.    for sprite in @enemy_sprites + @actor_sprites
  101.      sprite.update
  102.    end
  103.    # 天候グラフィックを更新
  104.    @weather.type = $game_screen.weather_type
  105.    @weather.max = $game_screen.weather_max
  106.    @weather.update
  107.    # ピクチャスプライトを更新
  108.    for sprite in @picture_sprites
  109.      sprite.update
  110.    end
  111.    # タイマースプライトを更新
  112.    @timer_sprite.update
  113.    # 画面の色調とシェイク位置を設定
  114.    @viewport1.tone = $game_screen.tone
  115.    @viewport1.ox = $game_screen.shake
  116.    # 画面のフラッシュ色を設定
  117.    @viewport4.color = $game_screen.flash_color
  118.    # ビューポートを更新
  119.    @viewport1.update
  120.    @viewport2.update
  121.    @viewport4.update
  122. end
  123. end
复制代码
回复 支持 反对

使用道具

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2026-6-24 06:13

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表