VX 스크립트

Screen Resolution
Version 0.4 (beta)

Introduction

This is extremely simple, and not tested. But this will change the window size and what is displayed by the map. You will still need to remodel the menu and battle scenes to fit in the screen.

v0.3 - I've added code that will automatically center any windows if you up the screen resolution. Note that this will not work if you make the screen resolution smaller. If you want to turn off automatic centering, just find this:
스크립트
WIDTH = 640
HEIGHT = 480
DELTA_WIDTH   = (WIDTH - 544).abs
DELTA_HEIGHT = (HEIGHT - 416).abs

class Game_Map
  def calc_parallax_x(bitmap)
    if bitmap == nil
      return 0
    elsif @parallax_loop_x
      return @parallax_x / 16
    elsif loop_horizontal?
      return 0
    else
      w1 = bitmap.width - WIDTH
      w2 = @map.width * 32 - WIDTH
      if w1 <= 0 or w2 <= 0
        return 0
      else
        return @parallax_x * w1 / w2 / 8
      end
    end
  end
end

class Spriteset_Map
  def create_viewports
    @viewport1 = Viewport.new(0, 0, WIDTH, HEIGHT)
    @viewport2 = Viewport.new(0, 0, WIDTH, HEIGHT)
    @viewport3 = Viewport.new(0, 0, WIDTH, HEIGHT)
    @viewport2.z = 50
    @viewport3.z = 100
  end
end

class Spriteset_Battle
  def create_viewports
    @viewport1 = Viewport.new(0, 0, WIDTH, HEIGHT)
    @viewport2 = Viewport.new(0, 0, WIDTH, HEIGHT)
    @viewport3 = Viewport.new(0, 0, WIDTH, HEIGHT)
    @viewport2.z = 50
    @viewport3.z = 100
  end
end

class Game_Player < Game_Character
  CENTER_X = (WIDTH / 2 - 16) * 8     # 画面中央の X 座標 * 8
  CENTER_Y = (HEIGHT / 2 - 16) * 8
end

class Sprite_Timer < Sprite
  def initialize(viewport)
    super(viewport)
    self.bitmap = Bitmap.new(88, 48)
    self.bitmap.font.name = "Arial"
    self.bitmap.font.size = 32
    self.x = WIDTH - self.bitmap.width
    self.y = 0
    self.z = 200
    update
  end
end

class Sprite_Base < Sprite
  def start_animation(animation, mirror = false)
    dispose_animation
    @animation = animation
    return if @animation == nil
    @animation_mirror = mirror
    @animation_duration = @animation.frame_max * 4 + 1
    load_animation_bitmap
    @animation_sprites = []
    if @animation.position != 3 or not @@animations.include?(animation)
      if @use_sprite
        for i in 0..15
          sprite = ::Sprite.new(viewport)
          sprite.visible = false
          @animation_sprites.push(sprite)
        end
        unless @@animations.include?(animation)
          @@animations.push(animation)
        end
      end
    end
    if @animation.position == 3
      if viewport == nil
        @animation_ox = WIDTH / 2
        @animation_oy = HEIGHT / 2
      else
        @animation_ox = viewport.rect.width / 2
        @animation_oy = viewport.rect.height / 2
      end
    else
      @animation_ox = x - ox + width / 2
      @animation_oy = y - oy + height / 2
      if @animation.position == 0
        @animation_oy -= height / 2
      elsif @animation.position == 2
        @animation_oy += height / 2
      end
    end
  end

end

class Window_Base < Window
  def x=(x)
    super(x + DELTA_WIDTH / 2)
  end
  
  def y=(y)
    super(y + DELTA_HEIGHT/ 2)
  end
end


class Scene_Battle < Scene_Base
  def create_info_viewport
    @info_viewport = Viewport.new(0, 288, WIDTH, HEIGHT)
    @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 = 544
    @info_viewport.visible = false
  end
end

class Scene_Item < Scene_Base
   def start
    super
    create_menu_background
    @viewport = Viewport.new(0, 0, WIDTH, HEIGHT)
    @help_window = Window_Help.new
    @help_window.viewport = @viewport
    @item_window = Window_Item.new(0, 56, 544, 360)
    @item_window.help_window = @help_window
    @item_window.active = false
    @target_window = Window_MenuStatus.new(0,  0)
    hide_target_window
  end
  
  def show_target_window(right)
    @item_window.active = false
    width_remain = WIDTH - @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, HEIGHT)
      @viewport.ox = 0
    else
      @viewport.rect.set(@target_window.width, 0, width_remain, HEIGHT)
      @viewport.ox = @target_window.width
    end
  end
  
  def hide_target_window
    @item_window.active = true
    @target_window.visible = false
    @target_window.active = false
    @viewport.rect.set(0, 0, WIDTH, HEIGHT)
    @viewport.ox = 0
  end
end

class Scene_Skill < Scene_Base
  def start
    super
    create_menu_background
    @actor = $game_party.members[@actor_index]
    @viewport = Viewport.new(0, 0, WIDTH, HEIGHT)
    @help_window = Window_Help.new
    @help_window.viewport = @viewport
    @status_window = Window_SkillStatus.new(0, 56, @actor)
    @status_window.viewport = @viewport
    @skill_window = Window_Skill.new(0, 112, 544, 304, @actor)
    @skill_window.viewport = @viewport
    @skill_window.help_window = @help_window
    @target_window = Window_MenuStatus.new(0, 0)
    hide_target_window
  end
  
  def show_target_window(right)
    @skill_window.active = false
    width_remain = WIDTH - @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, HEIGHT)
      @viewport.ox = 0
    else
      @viewport.rect.set(@target_window.width, 0, width_remain, HEIGHT)
      @viewport.ox = @target_window.width
    end
  end

  def hide_target_window
    @skill_window.active = true
    @target_window.visible = false
    @target_window.active = false
    @viewport.rect.set(0, 0, WIDTH, HEIGHT)
    @viewport.ox = 0
  end
end
Comment '3'
  • ?
    백년술사 2009.01.07 12:41
    뭐하는 스크립트??
    화면 결심?
  • ?
    Soul Breaker 2009.01.07 18:36
    최소한 "무엇에 대한 스크립트 입니다.' 라고만 써주셔도 좋을텐데 ㅜ
  • ?
    훈덕 2009.01.30 08:46
    화면 해상도 변경 스크립트인데 0.4버전인만큼 아직

    메뉴 화면 등이 해상도에 맞지 않는다고 하네요.

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 3 습작 2012.12.24 5398
217 빠른 스킬사용 6 file RPGbooster 2008.10.08 2814
216 오디오 사운드 자동 변환 설정 rukan 2009.07.01 1461
215 오디오 사운드테스트 스크립트 13 file 카르와푸딩의아틀리에 2009.08.19 2106
214 전투 사이드 뷰 시스템 [시트르산님 제공] 56 아방스 2010.11.29 7499
213 전투 사이드뷰 스크립트 [2003 전투 방식] 39 아방스 2008.03.09 8406
212 전투 사이드뷰 애드온 7 비극ㆍ 2010.08.21 6758
211 전투 사이드뷰배틀3.3 + ATB1.1 스크립트. 65 할렘 2009.02.01 10946
210 전투 사이드뷰배틀에서 시각적으로 위치 지정하기 9 file 078656577er 2009.10.14 4910
209 전투 사이드뷰배틀에서 찌르기 공격 가능하게 7 078656577er 2009.09.16 3223
208 기타 사이드뷰배틀에서 찌르기 공격 가능하게(Upgrade!) 6 078656577er 2009.10.15 2838
207 상점 상점 무기, 방어구 능력치 비교 스크립트! 18 불독 2008.12.25 3611
206 상점 상점 아이템 목록 정리 14 정의로운녀석 2008.07.22 3771
205 상점 상점 할인 스크립트(변수를 이용한 물건 가격 조정) 9 달표범 2009.09.04 3185
204 상점 상점에서 아이템 분류 5 file 파이어 2011.01.23 3510
203 상점 상점을 색다르게 바꿔주는 스크립트 34 file 할렘 2009.02.02 6301
202 상점 상점의 자세한 표시 32 file RPGbooster 2008.10.11 4008
201 상태/속성 상태 메뉴 변경 스크립트 45 죄송해욧! 2008.03.01 4284
200 맵/타일 새로운 월드맵 만들기 (로맨싱사가풍) 37 file 078656577er 2009.10.09 6151
199 전투 새로운 전투돌입효과 29 file RPGbooster 2008.10.08 5079
198 새로운 종류의 세이브 스크립트!! 8 Man... 2008.10.28 3517
Board Pagination Prev 1 ... 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 Next
/ 32