How to fix my game window?

Mparagames

Amateur developer trying to be awesome
Member
Joined
Jan 8, 2018
Messages
16
Reaction score
4
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.
 

MushroomCake28

KAMO Studio
Global Mod
Joined
Nov 18, 2015
Messages
3,729
Reaction score
4,682
First Language
English
Primarily Uses
RMMZ
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.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,592
Reaction score
6,522
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
meaning that if you keep the item height, it will only fit 3/4 of the original amount, meaning 3.
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?
 

Mparagames

Amateur developer trying to be awesome
Member
Joined
Jan 8, 2018
Messages
16
Reaction score
4
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?
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,592
Reaction score
6,522
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
 

Mparagames

Amateur developer trying to be awesome
Member
Joined
Jan 8, 2018
Messages
16
Reaction score
4
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.


 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,592
Reaction score
6,522
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
 

Mparagames

Amateur developer trying to be awesome
Member
Joined
Jan 8, 2018
Messages
16
Reaction score
4
First Language
Portuguese(BRA)
Primarily Uses
RMMV
Works perfectly! Thanks.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,859
Messages
1,017,030
Members
137,566
Latest member
Fl0shVS
Top