Page 1 of 1

[Solved]Gallery Error: Grid overfull

Posted: Wed Feb 07, 2018 12:38 pm
by starshine001
So, I've been trying to implement a gallery into my dating game using this tutorial: viewtopic.php?f=51&t=46976

Everything's working fine (Or so I think), exept the fact that I keep getting the following error message:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
Exception: Grid overfull.

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "renpy/common/_layout/screen_main_menu.rpym", line 28, in script
    python hide:
  File "D:\renpy-6.99.13-sdk\renpy\ast.py", line 827, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "D:\renpy-6.99.13-sdk\renpy\python.py", line 1764, in py_exec_bytecode
    exec bytecode in globals, locals
  File "renpy/common/_layout/screen_main_menu.rpym", line 35, in <module>
    ui.interact()
  File "D:\renpy-6.99.13-sdk\renpy\ui.py", line 287, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "D:\renpy-6.99.13-sdk\renpy\display\core.py", line 2553, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "D:\renpy-6.99.13-sdk\renpy\display\core.py", line 2916, in interact_core
    self.draw_screen(root_widget, fullscreen_video, (not fullscreen_video) or video_frame_drawn)
  File "D:\renpy-6.99.13-sdk\renpy\display\core.py", line 1980, in draw_screen
    renpy.config.screen_height,
  File "renpy/display/render.pyx", line 430, in renpy.display.render.render_screen (gen\renpy.display.render.c:6938)
    rv = render(root, width, height, 0, 0)
  File "renpy/display/render.pyx", line 196, in renpy.display.render.render (gen\renpy.display.render.c:2983)
    rv = d.render(widtho, heighto, st, at)
  File "D:\renpy-6.99.13-sdk\renpy\display\layout.py", line 702, in render
    surf = render(child, width, height, cst, cat)
  File "renpy/display/render.pyx", line 110, in renpy.display.render.render (gen\renpy.display.render.c:3445)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 196, in renpy.display.render.render (gen\renpy.display.render.c:2983)
    rv = d.render(widtho, heighto, st, at)
  File "D:\renpy-6.99.13-sdk\renpy\display\transition.py", line 361, in render
    top = render(self.new_widget, width, height, st, at)
  File "renpy/display/render.pyx", line 110, in renpy.display.render.render (gen\renpy.display.render.c:3445)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 196, in renpy.display.render.render (gen\renpy.display.render.c:2983)
    rv = d.render(widtho, heighto, st, at)
  File "D:\renpy-6.99.13-sdk\renpy\display\layout.py", line 702, in render
    surf = render(child, width, height, cst, cat)
  File "renpy/display/render.pyx", line 110, in renpy.display.render.render (gen\renpy.display.render.c:3445)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 196, in renpy.display.render.render (gen\renpy.display.render.c:2983)
    rv = d.render(widtho, heighto, st, at)
  File "D:\renpy-6.99.13-sdk\renpy\display\layout.py", line 702, in render
    surf = render(child, width, height, cst, cat)
  File "renpy/display/render.pyx", line 110, in renpy.display.render.render (gen\renpy.display.render.c:3445)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 196, in renpy.display.render.render (gen\renpy.display.render.c:2983)
    rv = d.render(widtho, heighto, st, at)
  File "D:\renpy-6.99.13-sdk\renpy\display\screen.py", line 625, in render
    child = renpy.display.render.render(self.child, w, h, st, at)
  File "renpy/display/render.pyx", line 110, in renpy.display.render.render (gen\renpy.display.render.c:3445)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 196, in renpy.display.render.render (gen\renpy.display.render.c:2983)
    rv = d.render(widtho, heighto, st, at)
  File "D:\renpy-6.99.13-sdk\renpy\display\layout.py", line 702, in render
    surf = render(child, width, height, cst, cat)
  File "renpy/display/render.pyx", line 110, in renpy.display.render.render (gen\renpy.display.render.c:3445)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 196, in renpy.display.render.render (gen\renpy.display.render.c:2983)
    rv = d.render(widtho, heighto, st, at)
  File "D:\renpy-6.99.13-sdk\renpy\display\layout.py", line 416, in render
    raise Exception("Grid overfull.")
Exception: Grid overfull.

Windows-8-6.2.9200
Ren'Py 6.99.13.2919
TestGame
Here's my code:

Code: Select all

screen gallery:

    # Ensure this replaces the main menu.
    tag menu

    # The background.
    add "cg_gallery.png"

    # A grid of buttons.
    grid 3 2:

        xfill True
        yfill True

        # Call make_button to show a particular button.
        
        add g.make_button("endA","cgAunlock.png", locked = "commonlock.png", xalign=0.5, yalign=0.5)
        add g.make_button("endR","cgRunlock.png", locked = "commonlock.png", xalign=0.5, yalign=0.5)       
        add g.make_button("endY","cgYunlock.png", locked = "commonlock.png", xalign=0.5, yalign=0.5)
        
        add g.make_button("endAn","cgAnunlock.png", locked = "commonlock.png", xalign=0.5, yalign=0.5)
        add g.make_button("endM","cgMunlock.png", locked = "commonlock.png", xalign=0.5, yalign=0.5)
        add g.make_button("endH","cgHunlock.png", locked = "commonlock.png", xalign=0.5, yalign=0.5)



        # The screen is responsible for returning to the main menu. It could also
        # navigate to other gallery screens.


        textbutton "Weiter" action ShowMenu("gallery2") xalign 1 yalign 0
        textbutton "Ende" action Return() xalign 0.5 yalign 0.5
I know that means that there are too many images for the grid, and at first I thought that it was 2 3 rather than 3 2, but even when I change the numbers I keep getting the same error message.

I'm probably just being stupid, but still, help is appreciated! :)

Re: Gallery Error: Grid overfull

Posted: Wed Feb 07, 2018 12:55 pm
by Ocelot
3x2 = 6. So you can place 6 children in the grid.

You have: 6 gallery buttons and 2 textbuttons = 8. More than grid allows.

Get two textbuttons out of the grid.

Re: Gallery Error: Grid overfull

Posted: Wed Feb 07, 2018 1:00 pm
by starshine001
Thank you so much! :)

I don't know why, but I never realized that the "Back" and "Previous" buttons were taken into account too!

Re: [Solved]Gallery Error: Grid overfull

Posted: Thu Feb 15, 2018 11:47 pm
by rayminator
this should work

it worked

replace the grid with this

Code: Select all

vpgrid:

        cols 5
        spacing 5
        draggable True
        mousewheel False
        xfill False
        yfill False
        ypos 40
        xpos 200