創作內容

0 GP

系統腳本五 視窗解析度變化

作者:雷茵 ; ???│2011-07-12 22:24:29│贊助:0│人氣:453
痾~~怎說呢? 出了事責任推卸先,先.掐住那嬰兒再說 
 
此大大所提供的東西是,首先,我們得要有一個遊戲解析度的視窗驅動檔案
如果沒有這個,我想...啟動遊戲把遊戲程式改成1024*768應該還是會變成遊戲系統認識錯誤而關掉遊戲。
 
痾~~怎說呢? 就像是你有好遊戲可是沒有好主機那樣,不是啟動不了遊戲就是遊戲發生了BUG、或遲緩現象。
 
因此,我下載了。
接著我到腳本區,按下CTRL+F 然後開始搜尋竄改544跟416的數字。
 
以上,請祝我成功。
測試完再上來說改了哪個部分。

<诶~~好麻煩耶! > 
別嫌煩,這一切都為了自己,孩子家教不好做父母的有義務責任。(其實我也覺得很煩

喀喀,以下只顯示有更改的部分,
 
●Game_Troop
  #--------------------------------------------------------------------------
  # * 設置
  #     troop_id : 敵人隊伍編號
  #--------------------------------------------------------------------------
    enemy.screen_x = member.x+0.5*member.x  #<--enemy.screen_x = member.x
    enemy.screen_y = member.y+0.5*member.y  #<--enemy.screen_y = member.y
 
●Game_Map
  #--------------------------------------------------------------------------
  # * 滾動設置
  #--------------------------------------------------------------------------
    @margin_x = (width - 32) * 256 / 2      # 畫面未顯示的部分的寬度 /2
    @margin_y = (height - 24) * 256 / 2     # 畫面未顯示的部分的高度 /2
  #--------------------------------------------------------------------------
  # * 計算遠景圖顯示的X座標
  #     bitmap : 遠景圖
  #--------------------------------------------------------------------------
      w1 = bitmap.width - 1024
      w2 = @map.width * 32 - 1024
      if w1 <= 0 or w2 <= 0
        return 0
  #--------------------------------------------------------------------------
  # * 計算遠景圖顯示的Y座標
  #     bitmap : 遠景圖
  #--------------------------------------------------------------------------
    else
      h1 = bitmap.height - 768
      h2 = @map.height * 32 - 768
      if h1 <= 0 or h2 <= 0
        return 0
      else
  #--------------------------------------------------------------------------
  # * 向下滾動
  #     distance : 滾動距離
  #--------------------------------------------------------------------------
      @display_y = [@display_y + distance, (height - 24) * 256].min
 
  #--------------------------------------------------------------------------
  # * 向右滾動
  #     distance : 滾動距離
  #--------------------------------------------------------------------------
      @display_x = [@display_x + distance, (width - 32) * 256].min
 
●Game_Player
  #--------------------------------------------------------------------------
  # * 常數
  #--------------------------------------------------------------------------
  CENTER_X = (1024 / 2 - 16) * 8     # 画面中央 X 座标 * 8
  CENTER_Y = (768 / 2 - 16) * 8     # 画面中央 Y 座标 * 8
  #--------------------------------------------------------------------------
  # * 將地圖顯示位置設置於螢幕正中央
  #     x : X座標
  #     y : Y座標
  #--------------------------------------------------------------------------      
     max_x = ($game_map.width - 32) * 256    
    #  max_x = ($game_map.width - 17) * 256    # 記算最大值
      max_y = ($game_map.height - 24) * 256
    # max_y = ($game_map.height - 13) * 256           # 記算最大值
 
●Spriteset_Battle
  #--------------------------------------------------------------------------
  # * 開始播放動畫
  #--------------------------------------------------------------------------
         @animation_ox = 1024 / 2
        @animation_oy = 768 / 2
  #--------------------------------------------------------------------------
  # * 設置動畫精靈物設
  #     frame : 幀數據(RPG::Animation::Frame)
  #--------------------------------------------------------------------------
  def animation_set_sprites(frame)
    cell_data = frame.cell_data
    for i in 0..15
      sprite = @animation_sprites[i]
      next if sprite == nil
      pattern = cell_data[i, 0]
      if pattern == nil or pattern == -1
        sprite.visible = false
        next
      end
      if pattern < 100
        sprite.bitmap = @animation_bitmap1
      else
        sprite.bitmap = @animation_bitmap2
      end
      sprite.visible = true
      sprite.src_rect.set(pattern % 5 * 192,
        pattern % 100 / 5 * 192, 192, 192)
      if @animation_mirror
        sprite.x = @animation_ox - cell_data[i, 1]
        sprite.y = @animation_oy + cell_data[i, 2]
        sprite.angle = (360 - cell_data[i, 4])
        sprite.mirror = (cell_data[i, 5] == 0)
      else
        sprite.x = @animation_ox + cell_data[i, 1]
        sprite.y = @animation_oy + cell_data[i, 2]
        sprite.angle = cell_data[i, 4]
        sprite.mirror = (cell_data[i, 5] == 1)
      end
      sprite.z = self.z + 300 + i
      sprite.ox = 96
      sprite.oy = 96
      sprite.zoom_x = cell_data[i, 3] / 100.0
      sprite.zoom_y = cell_data[i, 3] / 100.0
      sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
      sprite.blend_type = cell_data[i, 7]
    end
  end
 
●Sprite_Timer
  def initialize(viewport)
    super(viewport)
    self.bitmap = Bitmap.new(88, 48)
    self.bitmap.font.name = "Arial"
    self.bitmap.font.size = 32
    self.x = 1024 - self.bitmap.width
    self.y = 0
    self.z = 200
    update
  end
 
●Spriteset_Map
  #--------------------------------------------------------------------------
  # * 創建視口
  #--------------------------------------------------------------------------
    @viewport1 = Viewport.new(0, 0, 1024, 768)
    @viewport2 = Viewport.new(0, 0, 1024, 768)
    @viewport3 = Viewport.new(0, 0, 1024, 768)
 
●Spriteset_Battle
  #--------------------------------------------------------------------------
  # * 創建視口
  #--------------------------------------------------------------------------
    @viewport1 = Viewport.new(0, 0, 1024, 768)
    @viewport2 = Viewport.new(0, 0, 1024, 768)
    @viewport3 = Viewport.new(0, 0, 1024, 768)
  #--------------------------------------------------------------------------
  # * 創建作戰背景精靈物設
  #--------------------------------------------------------------------------
  def create_battleback
    source = $game_temp.background_bitmap
    bitmap = Bitmap.new(1088, 832)
  #--------------------------------------------------------------------------
  # * 創建作戰地面圖形精靈物設
  #--------------------------------------------------------------------------
  def create_battlefloor
    @battlefloor_sprite = Sprite.new(@viewport1)
    @battlefloor_sprite.bitmap = Cache.system("BattleFloor")
    @battlefloor_sprite.x = 0
    @battlefloor_sprite.y = 192+108
 
●Window_Help
    super(240, 192-56, 544, WLH + 32)  #  修改super(0, 0, 544, WLH + 32)
 
●Window_MenuStatus
     super(240+x, 80, 384, 416+112)   #  修改super(x, y, 384, 416)
 
●Window_Item
    super(240, 192, 544, 416)  # 修改super(x, y, width, height)
 
●Window_Skill
    super(240, 192, 544, 416)  # 修改super(x, y, width, height)
 
●Window_SkillStatus
    super(240, 80, 544, WLH + 32) # 修改super(x, y, 1024, WLH + 32)
 
●Window_Equip
    super(240+x, 400, 336, WLH * 5 + 32) # super(x, y, 336, WLH * 5 + 32)
 
●Window_EquipItem
    super(240, 192, width, height)  # super(x, y, width, height)
 
●Window_EquipStatus
    super(240, 400, 208, WLH * 5 + 32) # (x, y, 208, WLH * 5 + 32)
 
●Window_Status
    super(240 ,192,544, 416)  # super(0, 0, 544, 416)
 
●Window_SaveFile
    super(240, 192 + file_index % 4 * 90, 544, 90)
    # super(0, 56 + file_index % 4 * 90, 544, 90)
 
●Window_ShopBuy
    super(240,192, 304, 304)  # super(x, y, 304, 304)
 
●Window_ShopSell
    super(240, 192, width, height)  # super(x, y, width, height)
 
●Window_ShopNumber
    super(240, 192, 304, 304)  # super(x, y, 304, 304)
 
●Window_ShopStatus
    super(544, 192, 240, 304)  # super(x, y, 240, 304)
 
●Window_NameEdit
     super(240+88, 192+20, 368, 128)  # super(88, 20, 368, 128)
 
●Window_NameInput
CHINESE1 = ['一','二','三','四','五',  '','','','','',
              '六','七','八','九','十',  '','','','','',
              'K','L','M','N','O',  'k','l','m','n','o',
              'P','Q','R','S','T',  'p','q','r','s','t',
              'U','V','W','X','Y',  'u','v','w','x','y',
              'Z',' ',' ',' ',' ',  'z',' ',' ',' ',' ',
              ' ',' ',' ',' ',' ',  ' ',' ',' ',' ',' ',
              '1','2','3','4','5',  ' ',' ',' ',' ',' ',
              '6','7','8','9','0',  ' ',' ',' ',' ','確定']
  CHINESE2 = ['A','B','C','D','E',  'a','b','c','d','e',
              'F','G','H','I','J',  'f','g','h','i','j',
              'K','L','M','N','O',  'k','l','m','n','o',
              'P','Q','R','S','T',  'p','q','r','s','t',
              'U','V','W','X','Y',  'u','v','w','x','y',
              'Z',' ',' ',' ',' ',  'z',' ',' ',' ',' ',
              ' ',' ',' ',' ',' ',  ' ',' ',' ',' ',' ',
              '1','2','3','4','5',  ' ',' ',' ',' ',' ',
              '6','7','8','9','0',  ' ',' ',' ',' ','確定']
  CHINESE3 = ['A','B','C','D','E',  'a','b','c','d','e',
              'F','G','H','I','J',  'f','g','h','i','j',
              'K','L','M','N','O',  'k','l','m','n','o',
              'P','Q','R','S','T',  'p','q','r','s','t',
              'U','V','W','X','Y',  'u','v','w','x','y',
              'Z',' ',' ',' ',' ',  'z',' ',' ',' ',' ',
              ' ',' ',' ',' ',' ',  ' ',' ',' ',' ',' ',
              '1','2','3','4','5',  ' ',' ',' ',' ',' ',
              '6','7','8','9','0',  ' ',' ',' ',' ','確定']
  ENGLISH  = ['A','B','C','D','E',  'a','b','c','d','e',
              'F','G','H','I','J',  'f','g','h','i','j',
              'K','L','M','N','O',  'k','l','m','n','o',
              'P','Q','R','S','T',  'p','q','r','s','t',
              'U','V','W','X','Y',  'u','v','w','x','y',
              'Z',' ',' ',' ',' ',  'z',' ',' ',' ',' ',
              ' ',' ',' ',' ',' ',  ' ',' ',' ',' ',' ',
              '1','2','3','4','5',  '6','7','8','9','0',
              ' ',' ',' ',' ','英',  '数',' ',' ',' ','確定']
  SYMBOL   = ['!','?','˙','#','&',  '*','※','§','○','●',
              '△','▽','▼','▲','■',  '□','◇','◆','♀','♂',
              '☆','★','◎','⊙','〤',  ',',';',':','『','』',
              '↑','↓','←','→','↖',  '↗','↙','↘','「','」',
              '1','2','3','4','5',  '6','7','8','9','0',
              '|','…','.','、','-',  '(',')','〔','〕',' ',
              '+','-','*','/','\',  '',' ',' ',' ',' ',
              ' ',' ',' ',' ',' ',  ' ',' ',' ',' ',' ',
              ' ',' ',' ',' ','符',  '号',' ',' ',' ','確定']
  TABLE = [CHINESE1, CHINESE2, CHINESE3, ENGLISH, SYMBOL]
  #--------------------------------------------------------------------------
  # * 物件初始化
  #     mode : 預設輸入模式(0為大寫,1為小寫)
  #--------------------------------------------------------------------------
    super(240+88, 192+148, 368, 248)  # super(88, 148, 368, 248)
  #--------------------------------------------------------------------------
  # * 獲取字元
  #--------------------------------------------------------------------------
    if @index < 88
  #--------------------------------------------------------------------------
  # * 判斷游標位置:輸入模式切換
  #--------------------------------------------------------------------------
    return (@index == 88)
  #--------------------------------------------------------------------------
  # * 判斷游標位置:選擇[確定]命令
  #--------------------------------------------------------------------------
    return (@index == 89)
  #--------------------------------------------------------------------------
  # * 獲取條目顯示所需的矩形區域資訊
  #     index : 條目編號
  #--------------------------------------------------------------------------
def item_rect(index)
    rect = Rect.new(0, 0, 0, 0)
    rect.x = index % 10 * 32 + index % 10 / 5 * 16
    rect.y = index / 10 * WLH
    rect.width = 32
    rect.height = WLH
    return rect
  end
  #--------------------------------------------------------------------------
  # * 更新內容顯示
  #--------------------------------------------------------------------------
    for i in 0..89
  #--------------------------------------------------------------------------
  # * 游標下移
  #     wrap : 允許自動換行
  #--------------------------------------------------------------------------
    if @index < 80
      @index += 10
    elsif wrap
      @index -= 80
  #--------------------------------------------------------------------------
  # * 游標上移
  #     wrap : 允許自動換行
  #--------------------------------------------------------------------------
    if @index >= 10
      @index -= 10
    elsif wrap
  #--------------------------------------------------------------------------
  # * 游標右移
  #     wrap : 允許自動換行
  #--------------------------------------------------------------------------
      @index += 80
    if @index % 10 < 9
      @index += 1
    elsif wrap
      @index -= 9
  #--------------------------------------------------------------------------
  # * 游標左移
  #     wrap : 允許自動換行
  #--------------------------------------------------------------------------
    if @index % 10 > 0
      @index -= 1
    elsif wrap
      @index += 9
#--------------------------------------------------------------------------
  # * 游標移至[確定]
  #--------------------------------------------------------------------------
  def cursor_to_decision
    @index = 89
 
●Window_NumberInput
    super(240, 192,544, 64)  # super(0, 0,544, 64)

●Window_Message
    super(0, 640, 1024, 128)  # super(0, 288, 544, 128)
#--------------------------------------------------------------------------
  # * 設置視窗顯示類型及視窗位置
  #--------------------------------------------------------------------------
    @background = $game_message.background
    @position = $game_message.position
    if @background == 0   # 普通視窗
      self.opacity = 255
    else                  # 圖片視窗和透明視窗的情況下
      self.opacity = 0
    end
    case @position
    when 0  # 螢幕上部
      self.y = 0      #  self.y = 0
      @gold_window.y = 360
    when 1  # 螢幕中心
      self.y = 320    #  self.y = 144
      @gold_window.y = 0
    when 2  # 螢幕底部
      self.y = 640    #  self.y = 288
      @gold_window.y = 0
 
●Window_TargetEnemy
    super(1024-128, commands, 2, 4)   # super(416, commands, 2, 4)
 
●Window_BattleStatus
     super(0, 0, 1024-128, 128)  # super(0, 0, 416, 128)
 
●Window_DebugLeft
     super(x, y, 176, 768)
 
●Scene_Title
  #--------------------------------------------------------------------------
  # * 創建命令視窗
  #--------------------------------------------------------------------------
    @command_window = Window_Command.new(270, [s1, s2, s3])
    # @command_window = Window_Command.new(172, [s1, s2, s3])
    @command_window.x = (1024 - @command_window.width) / 2
    @command_window.y = 450   # @command_window.y = 288
 
●Scene_Menu
    super
    create_menu_background
    create_command_window
    @gold_window = Window_Gold.new(240, 553)  # 菜单金钱窗口座標
    # 修改  @gold_window = Window_Gold.new(0, 360)  
    @status_window = Window_MenuStatus.new(160, 0)
    @command_window.x = 240    # 新增 菜单選擇窗口座標x
    @command_window.y = 80    # 新增 菜单選擇窗口座標y
 
●Scene_Item
    @viewport = Viewport.new(0, 0, 1024, 768)
    @item_window = Window_Item.new(0, 56, 1024, 768)
  #--------------------------------------------------------------------------
  # * 顯示目標選擇視窗
  #     right : 視窗右對齊標幟(如果為false,則視窗左對齊)
  #--------------------------------------------------------------------------
    @item_window.active = false
    width_remain = 1024 - @target_window.width
    @target_window.x = right ? width_remain : 0
    @target_window.visible = true
    @target_window.active = true
    if right
      @viewport.rect.set(0, 0, width_remain, 768)
      @viewport.ox = 0
    else
      @viewport.rect.set(@target_window.width, 0, width_remain, 768)
      @viewport.ox = @target_window.width
  #--------------------------------------------------------------------------
  # * 隱藏目標選擇視窗
  #--------------------------------------------------------------------------
    @viewport.rect.set(0, 0, 1024, 768)
 
●Scene_Skill
   @viewport = Viewport.new(0, 0, 1024, 768)
    @skill_window = Window_Skill.new(0, 112, 1024, 768, @actor)
  #--------------------------------------------------------------------------
  # * 顯示目標選擇視窗
  #     right : 視窗右對齊標幟(如果為false,則視窗左對齊)
  #--------------------------------------------------------------------------
def show_target_window(right)
    @skill_window.active = false
    width_remain = 1024 - @target_window.width
    @target_window.x = right ? width_remain : 0
    @target_window.visible = true
    @target_window.active = true
    if right
      @viewport.rect.set(0, 0, width_remain, 768)
      @viewport.ox = 0
    else
      @viewport.rect.set(@target_window.width, 0, width_remain, 768)
      @viewport.ox = @target_window.width
    end
  end
  #--------------------------------------------------------------------------
  # * 隱藏目標選擇視窗
  #--------------------------------------------------------------------------
    @viewport.rect.set(0, 0, 1024, 768)
 
●Scene_Equip
     @item_windows = []
    for i in 0...EQUIP_TYPE_MAX
      @item_windows[i] = Window_EquipItem.new(0, 208, 1024, 768, @actor, i)
      @item_windows[i].help_window = @help_window
      @item_windows[i].visible = (@equip_index == i)
      @item_windows[i].y = 192   # @item_windows[i].y = 208
      @item_windows[i].height = 208
      @item_windows[i].active = false
      @item_windows[i].index = -1
 
●Scene_End
    @command_window.x = (1024 - @command_window.width) / 2
    @command_window.y = (768 - @command_window.height) / 2
 
 
 
●Scene_Shop
    super
    create_menu_background
    create_command_window
    @help_window = Window_Help.new
    @gold_window = Window_Gold.new(624, 80)    
    #  @gold_window = Window_Gold.new(384, 56)
    @dummy_window = Window_Base.new(240, 190, 544, 416)
    #  @dummy_window = Window_Base.new(0, 112, 544, 304)
    @buy_window = Window_ShopBuy.new(0, 112-56)
    #  @buy_window = Window_ShopBuy.new(0, 112)
    @buy_window.active = false
    @buy_window.visible = false
    @buy_window.help_window = @help_window
    @sell_window = Window_ShopSell.new(240, 190, 544, 416)
    #  @sell_window = Window_ShopSell.new(0, 112, 544, 304)
    @sell_window.active = false
    @sell_window.visible = false
    @sell_window.help_window = @help_window
    @number_window = Window_ShopNumber.new(0, 112-56)
    #  @number_window = Window_ShopNumber.new(0, 112)
    @number_window.active = false
    @number_window.visible = false
    @status_window = Window_ShopStatus.new(304, 112-56)
    #  @status_window = Window_ShopStatus.new(304, 112)
    @status_window.visible = false
  #--------------------------------------------------------------------------
  # * 創建命令視窗
  #--------------------------------------------------------------------------
    @command_window = Window_Command.new(384, [s1, s2, s3], 3)
    @command_window.y = 80  # @command_window.y = 56
    @command_window.x = 240  # 新增
    if $game_temp.shop_purchase_only
      @command_window.draw_item(1, false)
 
●Scene_Battle
   $game_temp.in_battle = true
    @spriteset = Spriteset_Battle.new
    @message_window = Window_BattleMessage.new
    @action_battlers = []
    create_info_viewport
    @message_window.y=640 # 新增
#--------------------------------------------------------------------------
  # * 創建資訊顯示視口
  #--------------------------------------------------------------------------
    @info_viewport = Viewport.new(0, 640, 1024, 128)
    @info_viewport.z = 100
    @status_window = Window_BattleStatus.new
    @party_command_window = Window_PartyCommand.new
    @actor_command_window = Window_ActorCommand.new
    @status_window.viewport = @info_viewport
    @party_command_window.viewport = @info_viewport
    @actor_command_window.viewport = @info_viewport
    @status_window.x = 128
    @actor_command_window.x = 1024
    @info_viewport.visible = false
  #--------------------------------------------------------------------------
  # * 開始接收技能選擇的指令輸入資訊
  #--------------------------------------------------------------------------
    @skill_window = Window_Skill.new(0, 56, 1024, 232, @active_battler)
  #--------------------------------------------------------------------------
  # * 開始接收物品選擇的指令輸入資訊
  #--------------------------------------------------------------------------
    @item_window = Window_Item.new(0, 56, 1024, 232)
 
 
 
 
 
 
引用網址:https://home.gamer.com.tw/TrackBack.php?sn=1361199
All rights reserved. 版權所有,保留一切權利

相關創作

留言共 0 篇留言

我要留言提醒:您尚未登入,請先登入再留言

喜歡★sro730615 可決定是否刪除您的留言,請勿發表違反站規文字。

前一篇:系統腳本四 Window... 後一篇:モスター勉強中...

追蹤私訊

作品資料夾

grass891101迷納桑
歡迎看看繪圖看更多我要大聲說昨天11:02


face基於日前微軟官方表示 Internet Explorer 不再支援新的網路標準,可能無法使用新的應用程式來呈現網站內容,在瀏覽器支援度及網站安全性的雙重考量下,為了讓巴友們有更好的使用體驗,巴哈姆特即將於 2019年9月2日 停止支援 Internet Explorer 瀏覽器的頁面呈現和功能。
屆時建議您使用下述瀏覽器來瀏覽巴哈姆特:
。Google Chrome(推薦)
。Mozilla Firefox
。Microsoft Edge(Windows10以上的作業系統版本才可使用)

face我們了解您不想看到廣告的心情⋯ 若您願意支持巴哈姆特永續經營,請將 gamer.com.tw 加入廣告阻擋工具的白名單中,謝謝 !【教學】