XP 스크립트

이실형이 만들었다네요....

 

5번째 줄과 6번째 줄을이용해 해상도를 조정할수있습니다.... ^^

 

유용히쓰세요 ^^

 

#====================바로밑줄부터복사=====================#

 

# Written by Squall (squall@loeher.znn.com)
# 할 일: 1. GetSystemMetrics 함수
#        2. ??

WINDOW_WIDTH = 1020
WINDOW_HEIGHT = 740
class Win32API
  GAME_INI_FILE = ".Game.ini"
  HWND_TOPMOST = 0
  HWND_TOP = -1
  SWP_NOMOVE = 0
  def Win32API.GetPrivateProfileString(section, key)
    val = "" * 256
    gps = Win32API.new("kernel32", "GetPrivateProfileString", ['P', 'P', 'P', 'P', 'L', 'P'], 'L')
    gps.call(section, key, '', val, 256, GAME_INI_FILE)
    val.delete!("")
    return val
  end
  def Win32API.FindWindow(class_name, title)
    fw = Win32API.new("user32", "FindWindow", ['P', 'P'], 'I')
    hwnd = fw.call(class_name, title)
    return hwnd
  end
  def Win32API.SetWindowPos(w, h)
    title = Win32API.GetPrivateProfileString("Game", "Title")
    hwnd = Win32API.FindWindow("RGSS Player", title)
    swp = Win32API.new("user32", "SetWindowPos", ['L', 'L', 'I', 'I', 'I', 'I', 'I'], 'I')
    win = swp.call(hwnd, HWND_TOP, 0, 0, w + 6, h + 32, 0)
#    win = swp.call(hwnd, HWND_TOPMOST, 0, 0, w + 6, h + 32, SWP_NOMOVE)
    return win
  end
end
$window_width = WINDOW_WIDTH
$window_height = WINDOW_HEIGHT
class Game_Map
  def scroll_down(distance)
    if $window_height / 32.0 < self.height - 1
      @display_y = [@display_y + distance, (self.height - ($window_height / 32.0)) * 128].min
    else
      @display_y = [@display_y + distance, (self.height - 15) * 128].min
    end
  end
  def scroll_left(distance)
    @display_x = [@display_x - distance, 0].max
  end
  def scroll_right(distance)
    if $window_width / 32.0 < self.width - 1
      @display_x = [@display_x + distance, (self.width - ($window_width / 32.0)) * 128].min
    else
      @display_x = [@display_x + distance, (self.width - 20) * 128].min
    end
  end
  def scroll_up(distance)
    @display_y = [@display_y - distance, 0].max
  end
end
class Game_Player < Game_Character
  CENTER_X = ($window_width / 2 - 16) * 4
  CENTER_Y = ($window_height / 2 - 16) * 4
end
class Spriteset_Map
  def initialize
    if $game_map.width >= 25 and $game_map.height >= 19
      $window_width2 = $window_width
      $window_height2 = $window_height
    elsif $game_map.width >= 25 and $game_map.height < 19
      $window_width2 = $window_width
      $window_height2 = 480
    elsif $game_map.width < 25 and $game_map.height >= 19
      $window_width2 = 640
      $window_height2 = $window_height
    elsif $game_map.width < 25 and $game_map.height < 19
      $window_width2 = 640
      $window_height2 = 480
    else
      $window_width2 = $window_width
      $window_height2 = $window_height
    end
    @viewport1 = Viewport.new(0, 0, $window_width2, $window_height2)
    @viewport2 = Viewport.new(0, 0, $window_width2, $window_height2)
    @viewport3 = Viewport.new(0, 0, $window_width2, $window_height2)
    @viewport4 = Viewport.new(640, 0, $window_width2 - 640, 480)
    @viewport5 = Viewport.new(0, 480, 640, $window_height2 - 480)
    @viewport6 = Viewport.new(640, 480, $window_width2 - 640, $window_height2 - 480)
    @viewport2.z = 200
    @viewport3.z = 5000
    @tilemap = Tilemap.new(@viewport2)
    @tilemap.tileset = RPG::Cache.tileset($game_map.tileset_name)
    for i in 0..6
      autotile_name = $game_map.autotile_names[i]
      @tilemap.autotiles[i] = RPG::Cache.autotile(autotile_name)
    end
    @tilemap.map_data = $game_map.data
    @tilemap.priorities = $game_map.priorities
    @panorama = Plane.new(@viewport2)
    @panorama.z = -1000
    @fog = Plane.new(@viewport2)
    @fog.z = 3000
    @character_sprites = []
    for i in $game_map.events.keys.sort
      sprite = Sprite_Character.new(@viewport2, $game_map.events[i])
      @character_sprites.push(sprite)
    end
    @character_sprites.push(Sprite_Character.new(@viewport2, $game_player))
    @weather = RPG::Weather.new(@viewport2)
    @picture_sprites = []
    for i in 1..50
      @picture_sprites.push(Sprite_Picture.new(@viewport2, $game_screen.pictures[i]))
    end
    @timer_sprite = Sprite_Timer.new
    @tilemap2 = Tilemap.new(@viewport4)
    @tilemap2.tileset = RPG::Cache.tileset($game_map.tileset_name)
    @tilemap3 = Tilemap.new(@viewport5)
    @tilemap3.tileset = RPG::Cache.tileset($game_map.tileset_name)
    @tilemap4 = Tilemap.new(@viewport6)
    @tilemap4.tileset = RPG::Cache.tileset($game_map.tileset_name)
    for i in 0..6
      autotile_name = $game_map.autotile_names[i]
      @tilemap2.autotiles[i] = RPG::Cache.autotile(autotile_name)
      @tilemap3.autotiles[i] = RPG::Cache.autotile(autotile_name)
      @tilemap4.autotiles[i] = RPG::Cache.autotile(autotile_name)
    end
    @tilemap2.map_data = $game_map.data
    @tilemap3.map_data = $game_map.data
    @tilemap4.map_data = $game_map.data
    update
  end
  def dispose
    @tilemap.tileset.dispose
    @tilemap2.tileset.dispose
    @tilemap3.tileset.dispose
    @tilemap4.tileset.dispose
    for i in 0..6
      @tilemap.autotiles[i].dispose
      @tilemap2.autotiles[i].dispose
      @tilemap3.autotiles[i].dispose
      @tilemap4.autotiles[i].dispose
    end
    @tilemap.dispose
    @tilemap2.dispose
    @tilemap3.dispose
    @tilemap4.dispose
    @panorama.dispose
    @fog.dispose
    for sprite in @character_sprites
      sprite.dispose
    end
    @weather.dispose
    for sprite in @picture_sprites
      sprite.dispose
    end
    @timer_sprite.dispose
    @viewport1.dispose
    @viewport2.dispose
    @viewport3.dispose
    @viewport4.dispose
    @viewport5.dispose
    @viewport6.dispose
  end
  def update
    if @panorama_name != $game_map.panorama_name or
       @panorama_hue != $game_map.panorama_hue
      @panorama_name = $game_map.panorama_name
      @panorama_hue = $game_map.panorama_hue
      if @panorama.bitmap != nil
        @panorama.bitmap.dispose
        @panorama.bitmap = nil
      end
      if @panorama_name != ""
        @panorama.bitmap = RPG::Cache.panorama(@panorama_name, @panorama_hue)
      end
      Graphics.frame_reset
    end
    if @fog_name != $game_map.fog_name or @fog_hue != $game_map.fog_hue
      @fog_name = $game_map.fog_name
      @fog_hue = $game_map.fog_hue
      if @fog.bitmap != nil
        @fog.bitmap.dispose
        @fog.bitmap = nil
      end
      if @fog_name != ""
        @fog.bitmap = RPG::Cache.fog(@fog_name, @fog_hue)
      end
      Graphics.frame_reset
    end
    @tilemap.ox = $game_map.display_x / 4
    @tilemap.oy = $game_map.display_y / 4
    @tilemap.update
    @tilemap2.ox = @tilemap.ox + 640
    @tilemap2.oy = @tilemap.oy
    @tilemap2.update
    @tilemap3.ox = @tilemap.ox
    @tilemap3.oy = @tilemap.oy + 480
    @tilemap3.update
    @tilemap4.ox = @tilemap.ox + 640
    @tilemap4.oy = @tilemap.oy + 480
    @tilemap4.update
    @panorama.ox = $game_map.display_x / 8
    @panorama.oy = $game_map.display_y / 8
    @fog.zoom_x = $game_map.fog_zoom / 100.0
    @fog.zoom_y = $game_map.fog_zoom / 100.0
    @fog.opacity = $game_map.fog_opacity
    @fog.blend_type = $game_map.fog_blend_type
    @fog.ox = $game_map.display_x / 4 + $game_map.fog_ox
    @fog.oy = $game_map.display_y / 4 + $game_map.fog_oy
    @fog.tone = $game_map.fog_tone
    for sprite in @character_sprites
      sprite.update
    end
    @weather.type = $game_screen.weather_type
    @weather.max = $game_screen.weather_max
    @weather.ox = $game_map.display_x / 4
    @weather.oy = $game_map.display_y / 4
    @weather.update
    for sprite in @picture_sprites
      sprite.update
    end
    @timer_sprite.update
    @viewport3.tone = $game_screen.tone
    @viewport1.ox = $game_screen.shake
    @viewport3.color = $game_screen.flash_color
    @viewport1.update
    @viewport3.update
   
    win = Win32API.SetWindowPos($window_width, $window_height)
    if win == 0
      print("창 크기 변경에 실패하였습니다.")
      exit
    end
  end
end
#ㅇ이거 ㅗ좀 쩔드라 ㅋㅋㅋㅋㅋ뻉바밥ㅏㅂ뺴

 

#==========================위에까지복사=============================#

Comment '6'
  • ?
    피아노맨 2009.08.07 00:36
    괜찮은 스크립트네요 감사한데,, 이걸 적용하게되니깐 그림의 표시가 재대로 표시가 안되네요 ;; 왜그러죠;; 맵에 부분적으로 가려서나옵니다;
  • ?
    제로스S2 2009.08.07 13:19

    아... 그건 말이죠 ... 해상도에 따라 그림의 크기를 변환해주어야 하는데... ㅎㅎ

     

    좀 기찮은듯? ㅎ

  • ?
    누군가 2009.08.07 14:36

    아...엄청난 오류가.. 뜨네...

     

  • ?
    '알중_ 2009.08.08 14:19
    오류가 좀 많네요.. 좋은데..;
  • ?
    멋지다준기 2010.02.13 20:42

    귀찮군... 아

  • ?
    알피지에엑스피 2013.08.24 15:11
    감사해요.

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
861 기타 엔딩후 캐릭터 이어서 새로운 게임시작 스크립트 1 file 백호 2009.02.21 1263
860 메뉴 개별 메뉴 호출 단축키 스크립트 5 file 백호 2009.02.21 1965
859 전투 사이드뷰 전투(보행그래픽) 15 file 백호 2009.02.21 4243
858 전투 액티브 타임 배틀(보행그래픽) file 백호 2009.02.21 2104
857 전투 마법검 스크립트 file 백호 2009.02.21 1116
856 전투 마법반사 스크립트 1 file 백호 2009.02.21 1216
855 장비 장비 착용 효과 스크립트 14 file 백호 2009.02.21 2322
854 기타 상점 변동시세 적용 스크립트 3 file 백호 2009.02.21 1159
853 이동 및 탈것 데쉬 기능 스크립트 8 file 백호 2009.02.21 1506
852 전투 배틀 스테이터스·클리어 디자인 13 file 백호 2009.02.21 2467
851 전투 레벨 상승 화면 개조 스크립트 4 file 백호 2009.02.21 1882
850 메뉴 FF7형식의 메뉴로 변경하는 스크립트 1 file 백호 2009.02.21 1462
849 전투 렙업했을때 포인트 주고 스탯 올리기 7 file 백호 2009.02.21 1684
848 상태/속성 순간 적으로 무적상태되는 스크립트 백호 2009.02.21 1161
847 기타 모험 일기 스크립트 2 file 백호 2009.02.21 1433
846 기타 요리 시스템 스크립트 12 file 백호 2009.02.21 2022
845 이동 및 탈것 기차스크립트 6 백호 2009.02.21 1757
844 메뉴 링메뉴 스크립트 file 백호 2009.02.21 1391
843 상점 상점 직접 장비 스크립트 1 file 백호 2009.02.21 1771
842 전투 전투 특수효과 ActionEX 스크립트 1 file 백호 2009.02.21 1659
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 52 Next
/ 52