Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Menu Help

TheOrc

Member

-I did use the search feature, so you can't hold that against me. :P-
Screenshot

Alright, I'll get to the point.
I'm making a menu system to go along with a game I'm designing with the ZTBS.

I customized the menu so far, to display up to 9 characters at once.
But there's a problem that could cause me to have to remove my "9Character-Menu" part, and edit that back to 4.

As you can see in the screenshot, I'm on the Equips function.
It works fine, but the selector rectangle is causing me some problems.

It's huge, basically; but what I want it to do, is have it only take up 1/9th of the window, and not 1/4. What happens is, when I get to the fifth person on the equip screen, the rectangle goes off-screen, but it still selects the character if I hit enter.

I'm assuming it has something to do with Window_Selectable, but I'm not sure about that.

What I did exactly, was copy the Window_Selectable script, and paste a new one, renaming it to Window_MSelectable. (MenuSelectable)
Then for my menu system, I did the same for Window_MenuStatus, renaming it Window_CharInfo, because that's what it is.

Here's my Window_CharInfo script if you need it.
#==============================================================================
# â–  Window_CharInfo
#------------------------------------------------------------------------------
#
#==============================================================================

class Window_CharInfo < Window_MSelectable

def initialize
super(0, 0, 640, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = $defaultfontsize
refresh
self.active = false
self.index = -1
self.contents.draw_text(495, 145, 100, 100, "Commands")
end

def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 64
y = i * 50
actor = $game_party.actors
draw_actor_graphic(actor, x - 47, y + 45)

draw_actor_name(actor, x - 30, y - 5)
draw_actor_class(actor, x + 45, y - 5)
draw_actor_level(actor, x - 30, y + 17)

draw_actor_exp(actor, x + 120, y - 5)
draw_actor_hp(actor, x + 50, y + 17)
draw_actor_sp(actor, x + 210, y + 17)
end
end

def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
end
end
end


Also note that I did not make any changes in Window_MSelectable; it's the same as Window_Selectable.

So, if anyone thinks they know/does know the solution to fitting the rectangle on screen, please reply.

Thanks in advance.
 

Anonymous

Guest

Try changing this.
Code:
self.cursor_rect.set(0, @index * 116, self.width - 32, 96)

to this.
Code:
self.cursor_rect.set(0, @index * 50, self.width - 32, 10)

Lower the * 50 if it is still not highlighting the sprite properly also the height is the last number in the above code.
 

TheOrc

Member

Ah, that was a quick reply; thank you.
It failed, but I changed the height value from 10 to 50, and that came out okay.

Now it looks like it's supposed to, so that's a good thing.
Thanks again.
 

Anonymous

Guest

Well, it was just a rough guess on the co-ordinates, but anyway, you will find just messing with co-ordinates usually fixes problems like that. Good luck on the menu.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top