Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
  • 0
MateriaBlade

Help with fixing my main menu

Question

I fixed up my main menu by making two rows of two characters, Its works fine and I can select whoever I want, but only the first characters info displays correctly. If there's anyone out there who can help me fix it up and allow me to display the other characters info, it'd be appreciated. Thanks.

 

post-23070-0-23307200-1341033297_thumb.png

Share this post


Link to post
Share on other sites

9 answers to this question

Recommended Posts

  • 0

I edited the Window_MenuStatus, I thought I did a pretty good job with it until I hit a brick wall. I tried many times to fix it myself, but had no luck on my own. As far as I know, the Window MenuStatus can only display the characters in a straight row, either up and down or right to left, but I made it into two rows, which was where I hit the brick wall, lol.

Share this post


Link to post
Share on other sites
  • 0

Do all four characters of yours have the same stats? If so, it might be that you just forgot to change the text's position according to the ID of the actor and they all display at the same place (which does not show since the same text is drawn over again and again).

Share this post


Link to post
Share on other sites
  • 0

@moonpearl, if you take a peek at the pic that came with this post, in every screenshot taken, all four characters have different levels, leading to different stats, in exhibit B (the middle pic) you can see I've fixed it so their info is displayed sideways which displayed the third and fourth characters info off-menu which is bad, the same happens when I fix it so their info is displayed vertical too, and finally, in exhibit C (the bottom pic) I've set the cursor on the fourth character, which if I could fix it, two characters would be in the top row and the other two would be in the bottom row.

 

Exactly what I'm having trouble with is that I can't get their info to display in rows so all four slots have their respective characters info. I hope that helps clarify what I'm having trouble with and can earn me the help I need, lol.

 

post-23070-0-42801200-1341072424_thumb.png

Share this post


Link to post
Share on other sites
  • 0

Are you only refreshing the current character, and the other characters are never getting drawn? Actual code would make it rather simple to spot your mistake more than just pictures.

Share this post


Link to post
Share on other sites
  • 0

@ForeverZerO, Now that you mention it, I think you're right and seeing the actual coding would help more than pictures can, lol. Here's my edited Window_MenuStatus.

 

#==============================================================================

# ** Window_MenuStatus

#------------------------------------------------------------------------------

# This window displays party member status on the menu screen.

#==============================================================================

 

class Window_MenuStatus < Window_Selectable

#--------------------------------------------------------------------------

# * Object Initialization

#--------------------------------------------------------------------------

def initialize

super(0, 0, 416, 160)

self.contents = Bitmap.new(width - 32, height - 32)

@column_max = 2

@item_max = 2

@item_max = $game_party.actors.size

refresh

self.active = false

self.index = -1

end

#--------------------------------------------------------------------------

# * Refresh

#--------------------------------------------------------------------------

def refresh

self.contents.clear

@item_max = $game_party.actors.size

for i in 0...$game_party.actors.size

x = 4

y = @item_max / 2 * 64

actor = $game_party.actors

# draw_actor_graphic(actor, x - 40, y + 80)

# draw_actor_name(actor, x, y)

# draw_actor_class(actor, x + 144, y)

draw_actor_level(actor, x + 40, 32)

# draw_actor_state(actor, x + 90, y + 32)

# draw_actor_exp(actor, x, y + 64)

draw_actor_hp(actor, x + 56, 0)

draw_actor_sp(actor, x + 56, 32)

end

end

#--------------------------------------------------------------------------

# * Update Cursor Rectangle

#--------------------------------------------------------------------------

def update_cursor_rect

# If cursor position is less than 0

if @index < 0

self.cursor_rect.empty

return

end

# Get current row

row = @index / @column_max

# If current row is before top row

if row < self.top_row

# Scroll so that current row becomes top row

self.top_row = row

end

# If current row is more to back than back row

if row > self.top_row + (self.page_row_max - 1)

# Scroll so that current row becomes back row

self.top_row = row - (self.page_row_max - 1)

end

# Calculate cursor width

cursor_width = self.width / @column_max - 32

# Calculate cursor coordinates

x = @index % @column_max * (cursor_width + 32)

y = @index / @column_max * 64 - self.oy

# Update cursor rectangle

self.cursor_rect.set(x, y, cursor_width, 64)

end

end

Share this post


Link to post
Share on other sites
  • 0

I think moonpearl is correct, it looks like you are drawing all the stats in the same location.

Try changing this

x = 4
y = @item_max / 2 * 64

to

x = (i % @column_max) * (self.bitmap.width / @column_max)
y = (i / self.row_max) * (self.bitmap.height / self.row_max)

 

The positioning may be a *little* bit off, but you need to calculate the ( x, y ) values from the current actor index ( i ) rather than using static values (which will draw every actor info at the same ( x, y ))

 

This calculations should evenly distribute the actor info across each row and column, like this:

[ actor 1 ][ actor 2 ]
[ actor 3 ][ actor 4 ]

 

if you need to slightly shift the positioning, you can do something like this:

x = (i % @column_max) * (self.bitmap.width / @column_max) + x_offset
y = (i / self.row_max) * (self.bitmap.height / @column_max) + y_offset

just substitute ( x_offset, y_offset ) for actual integers (or make sure you store them as integer variables first)

Share this post


Link to post
Share on other sites
  • 0

@everyone, Mystery solved and it looks great! Thanks everyone, for helping me out with this. I know I never could've achieved this without everyone's help. I may have other things I'll need help with along the way and know I can turn to all of you.

 

post-23070-0-05810900-1341087854_thumb.png

Share this post


Link to post
Share on other sites
  • 0

This was actually pretty helpful for me. I was wanting to do a simular thing with the columns and it worked great, now it's just to tweek it to the perfect spaces. Thanks guys for posting the stuff.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...