How to fix my game window?

Discussion in 'RPG Maker VX Ace' started by Mparagames, Aug 14, 2018.

  1. Mparagames

    Mparagames Amateur developer trying to be awesome Member

    Messages:
    16
    Likes Received:
    4
    Location:
    Brazil
    First Language:
    Portuguese(BRA)
    Primarily Uses:
    RMMV
    So, in the script "Window_MenuStatus" of my game, I changed these lanes

    def window_height
    Graphics.height
    end

    to this:

    def window_height
    Graphics.height * 0.75
    end

    and the lanes

    def item_height
    (height - standard_padding * 2) / 4
    end

    to this:

    def item_height
    (height - standard_padding * 2) / 3
    end

    in order to achieve this specific character window size:



    However, there exists an unwanted graphical bug. There's a "blank space" in the menu from the window that gets cut, which I don't desire at all. So, how could I fix that, by preventing that space of the window from being cut?

    Thanks in regard.
     
    #1
  2. MushroomCake28

    MushroomCake28 KAMO Studio Veteran

    Messages:
    1,833
    Likes Received:
    3,264
    Location:
    Montreal, Canada
    First Language:
    English
    Primarily Uses:
    RMMV
    So if I understand correctly, you want the window on the right to be 3/4 of the height and show 3 characters instead of being 4 characters in a window with full height.

    The changes you made to the window_height are good. No problem there. The problem comes from the change you made to the item_height. You should have just leave it as it was. To display 3 characters, meaning to cut the fourth one, you reduced the size of the window to 3/4 of its original size, meaning that if you keep the item height, it will only fit 3/4 of the original amount, meaning 3.
     
    #2
  3. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,504
    Likes Received:
    5,109
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    I checked my own project, I did exactly the same. Although instead I use this
    Code:
      alias ed_window_height window_height
      def window_height
        ed_window_height - (24 * 4)
      end
    
    The code is explicitly state height minus padding, means the blinking cursor will be divided by 4.
    It's the correct way of changing item height.

    -------
    However, I'm here fail to understand the "blank space". There're a lot of blank space and I don't know which one are you referring to. The way you code, you want it to fit 3 characters, and you don't display 3 characters. It could be means the blank space on the status menu (which again I fail to understand why if it's was your intention anyway?)

    Or is it the blank space between window gold and status? or menu command with whatever the new window is?
     
    #3
  4. Mparagames

    Mparagames Amateur developer trying to be awesome Member

    Messages:
    16
    Likes Received:
    4
    Location:
    Brazil
    First Language:
    Portuguese(BRA)
    Primarily Uses:
    RMMV
    TheoAllen, you are right. I actually forgot to add the image of the item menu.

    Here it is:



    Can you help me?
     
    #4
  5. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,504
    Likes Received:
    5,109
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    I forgot how it works, but it taken from my game that solve the problem, I need to re-learn what I've done though
    Code:
    class Window_MenuStatus
     
      alias ed_window_height window_height
      def window_height
        ed_window_height - (24 * 4)
      end
     
     
      def item_height
        (height - standard_padding * 2) / 3
      end
    
    end
    
    class Scene_Item
     
      alias ed_menu_start start
      def start
        ed_menu_start
        y = @actor_window.height
        @exview = Viewport.new(0,y,0,0)
        @dummy = Window_Base.new(0,-@actor_window.height,
          Graphics.width,Graphics.height)
        @dummy.viewport = @exview
      end
        
      alias ed_menu_update update
      def update
        ed_menu_update
        @dummy.x = (cursor_left? ?  -(Graphics.width - @actor_window.width) : 0)
      end
     
      alias ed_menu_terminate terminate
      def terminate
        ed_menu_terminate
        @exview.dispose
      end
     
      def show_sub_window(window)
        width_remain = Graphics.width - window.width
        window.x = cursor_left? ? width_remain : 0
        @viewport.rect.x = @viewport.ox = cursor_left? ? 0 : window.width
        @viewport.rect.width = width_remain
        window.show.activate
        @exview.rect.x = width_remain
        @exview.rect.width = Graphics.width - width_remain
        @exview.rect.height = Graphics.height - @actor_window.height
      end
     
      def hide_sub_window(window)
        @viewport.rect.x = @viewport.ox = 0
        @viewport.rect.width = Graphics.width
        window.hide.deactivate
        activate_item_window
        @exview.rect.width = 0
        @exview.rect.height = 0
      end
     
    end
    
    EDIT:
    This only works if you have few item in your game though
     
    #5
  6. Mparagames

    Mparagames Amateur developer trying to be awesome Member

    Messages:
    16
    Likes Received:
    4
    Location:
    Brazil
    First Language:
    Portuguese(BRA)
    Primarily Uses:
    RMMV
    It's just as I wanted when I select items from the left column, but it still bugs out when selected out from right column.



    [​IMG]
     
    #6
  7. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,504
    Likes Received:
    5,109
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    This is a random guess, try to change this
    Code:
    @exview.rect.x = width_remain
    
    into this?
    Code:
    @exview.rect.x = cursor_left? ? width_remain : 0
    
     
    #7
  8. Mparagames

    Mparagames Amateur developer trying to be awesome Member

    Messages:
    16
    Likes Received:
    4
    Location:
    Brazil
    First Language:
    Portuguese(BRA)
    Primarily Uses:
    RMMV
    Works perfectly! Thanks.
     
    #8

Share This Page