질문과 답변

Extra Form

현재 아래와같은 아이템창 스크립트를 적용중입니다

문제점은 아이템을 다수로습득하였을때 스크롤이밀려 아이템 정보를 표시해주는 부분까지

밀고내려가버려서 그런데

스크립트 보실줄아시는분중에 지금아이템 표시줄이 14줄표시되는데;;c45e9421cf5a33ff2bb5ce0ec30c4cbc.png

Comment '7'
  • ?
    [고구려 삼족오] 2011.10.09 09:09

    삼국지 신[新]영걸전 공식 카페 매니저로 있는 [고구려 삼족오] 입니다.

    저 역시 게임 제작자로써 게임을 제작하다 보면 스크립트 때문에 문제가 많이 있는데..

    자세한건 잘 모르겠고 제 추측으로는 83번째 줄

    self.contents.font.size = 14

    만 현재 14 라는 숫자가 나오는걸로 봐서는 이 부분을 수정하시면 될것 같습니다.

    p.s 안될 경우에는 다른 분들의 조언을 들으시는것을 적극 권장.

  • profile
    NewSet 2011.10.09 10:19

    스압이라고 써놓지

     

    #_______________________________________________________________________________
    # SEL SCENE ITEM MENU V2.0
    #_______________________________________________________________________________
    # By Selacius
    # Graphics by lomastul, MOGHUNTER
    # Original XP Script by MOGHUNTER
    #_______________________________________________________________________________

    module Cache
     def self.menu(filename)
       load_bitmap("Graphics/Menus/", filename)
     end
    end

    ###############
    # Window_Base #
    ###############
    class Window_Base < Window
      def draw_maphp3(actor, x, y)
        back = Cache.menu("MeterBack")
        cw = back.width
        ch = back.height
        src_rect = Rect.new(0, 0, cw, ch)
        self.contents.blt(x + 65, y - ch + 30, back, src_rect)
        meter = Cache.menu("HPMeter")
        cw = meter.width * actor.hp / actor.maxhp
        ch = meter.height
        src_rect = Rect.new(0, 0, cw, ch)
        self.contents.blt(x + 65, y - ch + 30, meter, src_rect)
        text = Cache.menu("HP_Text")
        cw = text.width
        ch = text.height
        src_rect = Rect.new(0, 0, cw, ch)
        self.contents.blt(x + 35, y - ch + 30, text, src_rect)
        self.contents.font.color = Color.new(0,0,0,255)
        self.contents.draw_text(x + 81, y - 1, 48, 32, actor.hp.to_s, 2)
        self.contents.font.color = Color.new(255,255,255,255)
        self.contents.draw_text(x + 80, y - 2, 48, 32, actor.hp.to_s, 2)
      end
      def draw_mapsp3(actor, x, y)
        back = Cache.menu("MeterBack")
        cw = back.width
        ch = back.height
        src_rect = Rect.new(0, 0, cw, ch)
        self.contents.blt(x + 65, y - ch + 30, back, src_rect)
        meter = Cache.menu("MPMeter")
        cw = meter.width * actor.mp / actor.maxmp
        ch = meter.height
        src_rect = Rect.new(0, 0, cw, ch)
        self.contents.blt(x + 65, y - ch + 30, meter, src_rect)
        text = Cache.menu("MP_Text")
        cw = text.width
        ch = text.height
        src_rect = Rect.new(0, 0, cw, ch)
        self.contents.blt(x + 35, y - ch + 30, text, src_rect)
        self.contents.font.color = Color.new(0,0,0,255)
        self.contents.draw_text(x + 81, y - 1, 48, 32, actor.mp.to_s, 2)
        self.contents.font.color = Color.new(255,255,255,255)
        self.contents.draw_text(x + 80, y - 2, 48, 32, actor.mp.to_s, 2)
      end
      def draw_mexp_it(actor, x, y)
        lv_tx = Cache.menu("LV_tx")
        cw = lv_tx.width
        ch = lv_tx.height
        src_rect = Rect.new(0, 0, cw, ch)
        self.contents.blt(x + 60 , y - ch + 32, lv_tx, src_rect)
        self.contents.font.color = Color.new(0,0,0,255)
        self.contents.draw_text(x + 91, y + 5, 24, 32, actor.level.to_s, 1)
        self.contents.font.color = Color.new(255,255,255,255)
        self.contents.draw_text(x + 90, y + 4, 24, 32, actor.level.to_s, 1)
        end
    end

    #################################################
    # Window_Target_Item  - Status screen of players#
    #################################################
    class Window_Target_Item < Window_Selectable
      def initialize
        super(0, 40, 260, 410)
        self.contents = Bitmap.new(width - 32, height - 32)
        self.contents.font.bold = true
        self.contents.font.shadow = true
        self.contents.font.size = 14
        refresh
      end
      def refresh
        self.contents.clear
        @item_max = $game_party.members.size
        for actor in $game_party.members
          x = -4
          y = actor.index * 72
          draw_actor_face(actor,x,y,72)
          draw_actor_name(actor,x + 80,y)
          draw_mexp_it(actor, x + 110, y-10)
          draw_actor_state(actor,x + 125,y)
          draw_maphp3(actor, x + 20, y + 20)
          draw_mapsp3(actor, x + 20, y + 40)
        end
      end
      def update_cursor
        if @index < 0               # No cursor
          self.cursor_rect.empty
        elsif @index < @item_max    # Normal
          self.cursor_rect.set(0, @index * 72, contents.width, 72)
        elsif @index >= 100         # Self
          self.cursor_rect.set(0, (@index - 100) * 72, contents.width, 72)
        else                        # All
          self.cursor_rect.set(0, 0, contents.width, @item_max * 72)
        end
      end
    end

    #==============================================================================
    # ** MOD_Window_Item - Displays general items
    #------------------------------------------------------------------------------
    class MOG_Window_Item < Window_Selectable
      def initialize(x, y, width, height)
        super(x, y, width, height)
        @column_max = 1
        self.index = 0
        refresh
      end
      def item
        return @data[self.index]
      end
      def include?(item)
        return false if item == nil
        if $game_temp.in_battle
          return false unless item.is_a?(RPG::Item)
        end
        return true
      end
      def enable?(item)
        return $game_party.item_can_use?(item)
      end
      def refresh
        @data = []
        for item in $game_party.items
          next unless include?(item)
          if item.is_a?(RPG::Item) and !item.is_a?(RPG::Weapon) and !item.is_a?(RPG::Weapon)
            @data.push(item)
            if item.id == $game_party.last_item_id
              self.index = @data.size - 1
            end
          end
        end
        @data.push(nil) if include?(nil)
        @item_max = @data.size
        create_contents
        for i in 0...@item_max
          draw_item(i)
        end
      end
      def draw_item(index)
        rect = item_rect(index)
        self.contents.clear_rect(rect)
        item = @data[index]
        if item != nil
          number = $game_party.item_number(item)
          enabled = enable?(item)
          rect.width -= 4
          self.contents.font.bold = true
          self.contents.font.shadow = true
          self.contents.font.size = 14
          draw_item_name(item, rect.x, rect.y, enabled)
          self.contents.draw_text(rect, sprintf(":%2d", number), 2)
        end
      end
      def update_help
        @help_window.set_text(item == nil ? "" : item.description)
      end
    end

    #==============================================================================
    # ** Window_Weapon - Displays Weapon Items
    #------------------------------------------------------------------------------
    class Window_Weapon < Window_Selectable
      def initialize(x, y, width, height)
        super(x, y, width, height)
        @column_max = 1
        self.index = 0
        refresh
      end
      def item
        return @data[self.index]
      end
      def include?(item)
        return false if item == nil
        if $game_temp.in_battle
          return false unless item.is_a?(RPG::Weapon)
        end
        return true
      end
      def enable?(item)
        return $game_party.item_can_use?(item)
      end
      def refresh
        @data = []
        for item in $game_party.items
          next unless include?(item)
          if item.is_a?(RPG::Weapon)
            @data.push(item)
            if item.id == $game_party.last_item_id
              self.index = @data.size - 1
            end
          end
        end
        @data.push(nil) if include?(nil)
        @item_max = @data.size
        create_contents
        for i in 0...@item_max
          draw_item(i)
        end
      end
      def draw_item(index)
        rect = item_rect(index)
        self.contents.clear_rect(rect)
        item = @data[index]
        if item != nil
          number = $game_party.item_number(item)
          enabled = enable?(item)
          rect.width -= 4
          self.contents.font.bold = true
          self.contents.font.shadow = true
          self.contents.font.size = 14     
          draw_item_name(item, rect.x, rect.y, enabled)
          self.contents.draw_text(rect, sprintf(":%2d", number), 2)
        end
      end
      def update_help
        @help_window.set_text(item == nil ? "" : item.description)
      end
    end

    #==============================================================================
    # ** Window_Armor - Displays Armor Items
    #------------------------------------------------------------------------------
    class Window_Armor < Window_Selectable
      def initialize(x, y, width, height)
        super(x, y, width, height)
        @column_max = 1
        self.index = 0
        refresh
      end
      def item
        return @data[self.index]
      end
      def include?(item)
        return false if item == nil
        if $game_temp.in_battle
          return false unless item.is_a?(RPG::Armor)
        end
        return true
      end
      def enable?(item)
        return $game_party.item_can_use?(item)
      end
      def refresh
        @data = []
        for item in $game_party.items
          next unless include?(item)
          if item.is_a?(RPG::Armor)
            @data.push(item)
            if item.id == $game_party.last_item_id
              self.index = @data.size - 1
            end
          end
        end
        @data.push(nil) if include?(nil)
        @item_max = @data.size
        create_contents
        for i in 0...@item_max
          draw_item(i)
        end
      end
      def draw_item(index)
        rect = item_rect(index)
        self.contents.clear_rect(rect)
        item = @data[index]
        if item != nil
          number = $game_party.item_number(item)
          enabled = enable?(item)
          rect.width -= 4
          self.contents.font.bold = true
          self.contents.font.shadow = true
          self.contents.font.size = 14
          draw_item_name(item, rect.x, rect.y, enabled)
          self.contents.draw_text(rect, sprintf(":%2d", number), 2)
        end
      end
      def update_help
        @help_window.set_text(item == nil ? "" : item.description)
      end
    end

    #==============================================================================
    # ** Scene_Item
    #------------------------------------------------------------------------------
    class Scene_Item < Scene_Base
      def start
        @back = Plane.new
        @back.bitmap = Cache.menu("Background")
        @item_lay = Sprite.new
        @item_lay.bitmap = Cache.menu("Item_Lay")
        @item_com = Sprite.new
        @item_com.bitmap = Cache.menu("Item_com01")
        @viewport = Viewport.new(0, 0, 544, 416)
        @help_window = Window_Help.new(42,350)
        @help_window.viewport = @viewport
        @item_window = MOG_Window_Item.new(250, 70, 295, 350)
        @item_window.viewport = @viewport
        @item_window.help_window = @help_window
        @item_window.visible = true
        @item_window.active = true
        @weapon_window = Window_Weapon.new(250, 70, 295, 350)
        @weapon_window.viewport = @viewport
        @weapon_window.help_window = @help_window
        @weapon_window.visible = false
        @weapon_window.active = false
        @armor_window = Window_Armor.new(250, 70, 295, 350)
        @armor_window.viewport = @viewport
        @armor_window.help_window = @help_window
        @armor_window.visible = false
        @armor_window.active = false
        @target_window = Window_Target_Item.new
        @target_window.visible = true
        @target_window.active = false
        @help_window.opacity = 0
        @item_window.opacity = 0
        @weapon_window.opacity = 0
        @armor_window.opacity = 0
        @target_window.opacity = 0
        @window_index = 0
      end
      def terminate
        @help_window.dispose
        @item_window.dispose
        @weapon_window.dispose
        @armor_window.dispose
        @target_window.dispose
        @item_lay.dispose
        @back.dispose
        @item_com.dispose
      end
      def return_scene
        $scene = Scene_Menu.new(0)
      end
      def update
        @back.ox += 1
        @help_window.update
        @item_window.update
        @weapon_window.update
        @armor_window.update
        @target_window.update
        update_item_target
        if @item_window.active  and @item_window.visible
          update_item_selection
          return
        end
        if @target_window.active
          update_target_selection
        end 
        if @weapon_window.active and @weapon_window.visible
          update_weapon
          return
        end
        if @armor_window.active and @armor_window.visible
          update_armor
          return
        end
      end 
      def update_weapon
        if Input.trigger?(Input::B)
          Sound.play_cancel
          return_scene
        end
      end
      def update_armor
        if Input.trigger?(Input::B)
          Sound.play_cancel
          return_scene
        end
      end
      def update_item_target
        if Input.trigger?(Input::R) or Input.trigger?(Input::RIGHT)
          case @window_index
          when 0
            @item_com.bitmap = Cache.menu("Item_com02")
            @item_window.active = false
            @item_window.visible = false
            @weapon_window.visible = true
            @weapon_window.active = true
            @window_index += 1
          when 1
            @item_com.bitmap = Cache.menu("Item_com03")
            @weapon_window.visible = false
            @weapon_window.active = false
            @armor_window.visible = true
            @armor_window.active = true       
            @window_index += 1
          when 2
            @item_com.bitmap = Cache.menu("Item_com01")
            @armor_window.visible = false
            @armor_window.active = false
            @item_window.visible = true
            @item_window.active = true
            @window_index = 0
          end
        end
      if Input.trigger?(Input::L) or Input.trigger?(Input::LEFT)
          case @window_index
          when 0       
            @item_com.bitmap = Cache.menu("Item_com03")
            @item_window.active = false
            @item_window.visible = false
            @armor_window.visible = true
            @armor_window.active = true
            @window_index = 2
          when 1
            @item_com.bitmap = Cache.menu("Item_com01")
            @weapon_window.visible = false
            @weapon_window.active = false       
            @item_window.visible = true
            @item_window.active = true       
            @window_index -= 1
          when 2
            @item_com.bitmap = Cache.menu("Item_com02")
            @armor_window.visible = false
            @armor_window.active = false
            @weapon_window.visible = true
            @weapon_window.active = true
            @window_index -= 1
          end
        end 
      end
      def update_item_selection
        if Input.trigger?(Input::B)
          Sound.play_cancel
          return_scene
        elsif Input.trigger?(Input::C)
          @item = @item_window.item
          if @item != nil
            $game_party.last_item_id = @item.id
          end
          if $game_party.item_can_use?(@item)
            Sound.play_decision
            determine_item
          else
            Sound.play_buzzer
          end
        end
      end
      def determine_item
        if @item.for_friend?
            @target_window.active = true
            @item_window.active = false
          if @item.for_all?
            @target_window.index = 99 ps.이건 최대 수량
          else
            if $game_party.last_target_index < @target_window.item_max
              @target_window.index = $game_party.last_target_index
            else
              @target_window.index = 0
            end
          end
        else
          use_item_nontarget
        end
      end
      def update_target_selection
        if Input.trigger?(Input::B)
          Sound.play_cancel
          if $game_party.item_number(@item) == 0    # If item is used up
            @item_window.refresh                    # Recreate the window contents
          end
          @target_window.active = false
          @item_window.active = true
        elsif Input.trigger?(Input::C)
          if not $game_party.item_can_use?(@item)
            Sound.play_buzzer
          else
            determine_target
          end
        end
      end
      def determine_target
        used = false
        if @item.for_all?
          for target in $game_party.members
            target.item_effect(target, @item)
            used = true unless target.skipped
          end
        else
          $game_party.last_target_index = @target_window.index
          target = $game_party.members[@target_window.index]
          target.item_effect(target, @item)
          used = true unless target.skipped
        end
        if used
          use_item_nontarget
        else
          Sound.play_buzzer
        end
      end
      def use_item_nontarget
        Sound.play_use_item
        $game_party.consume_item(@item)
        @item_window.draw_item(@item_window.index)
        @target_window.refresh
        if $game_party.all_dead?
          $scene = Scene_Gameover.new
        elsif @item.common_event_id > 0
          $game_temp.common_event_id = @item.common_event_id
          $scene = Scene_Map.new
        end
      end
    end

     

    빨갛게 그어논거 11로 고치면 아마 될꺼에요

  • ?
    라스트루마 2011.10.09 10:32

    글자크기만줄어들고 줄수는그대로네용;

  • ?
    Alkaid 2011.10.09 18:30

    빨갛게 그어놓은 거는 말 그대로 폰트 크기네요.

  • profile
    NewSet 2011.10.12 17:13

    헐 사실 스크립트 몬함

  • profile
    습작 2011.10.09 12:03

    우선 아래와 같은 부분을 검색하세요.

    @item_window = MOG_Window_Item.new(250, 70, 295, 350)


    그리고 아래와 같이 수정하세요.

    @item_window = MOG_Window_Item.new(250, 70, 295, 296)

  • ?
    라스트루마 2011.10.09 17:13

    진정 진심 진심 감사합니다.


List of Articles
종류 분류 제목 글쓴이 날짜 조회 수
공지 묻고 답하기 가이드 습작 2014.06.14 13181
기타 우스이의 회 홈페이지 주소... 1 허브한잎 2011.10.17 2304
RMXP RPG XP에서 RPG2k, RPG2k3 BGM 사용하기 (mid파일) 2 뮤리온。 2011.10.17 2641
RMXP 아오오니같은 게임만들때.... 3 이지눙 2011.10.17 2805
RMXP XP버전에서 얼굴그래픽 넣는 방법 2 m양 2011.10.16 2343
RMVX rpg vx 벽만들기 1 판다냐옹 2011.10.15 2051
RMVX 스크립트 쓸때 alias 1 EuclidE 2011.10.15 1561
GM rpg만들기 제일쉬운거 4 cerod 2011.10.14 1911
RMXP 스크립트폍집기에서 1 곱등이틀러 2011.10.12 2184
RMVX vampyr SBABS-Requiem ABS 9버전 오류.. 다시올립니다. 3 이런게상세 2011.10.12 2293
기타 아방스에서 완성작게임자료실,일반게임자료실의 차이점은 무엇인가요? 1 라유 2011.10.12 1186
RMVX 스크립트 짜기 12 Jhon 2011.10.11 1474
RMXP XP게임 만들기 질문이요!! 2 로돌프 2011.10.10 1839
RMXP 윈도우7의 알만툴XP 페이드아웃 오류 1 겨울별 2011.10.10 3023
RMVX 도감 스크립트 추가질문입니다. 1 라스트루마 2011.10.10 1675
RMVX 액션 알피지에 대해.... 1 꼬마게이머 2011.10.09 1838
RMXP 보스랑 전투할때... 2 Lord Justice 2011.10.09 2015
RMVX 로드 오류나네요ㅠ 3 file 라유 2011.10.09 1712
RMXP 예기치못한포맷에대해 4 김김김ㄱ미 2011.10.09 1561
기타 RPG만들기로 만든 게임은 에디트를 사용못하나요? 5 키키두두키 2011.10.09 13480
RMVX 아이템창 문제;;(고수분의도움으로 해결되었습니다.) 7 file 라스트루마 2011.10.09 1154
Board Pagination Prev 1 ... 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 ... 517 Next
/ 517