[Solved]Gallery Error: Grid overfull

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
starshine001
Newbie
Posts: 23
Joined: Fri Feb 02, 2018 9:16 am
Completed: None
Projects: The Nightfall [Vampire Thriller]
Organization: None
Contact:

[Solved]Gallery Error: Grid overfull

#1 Post 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! :)
Last edited by starshine001 on Wed Feb 07, 2018 1:01 pm, edited 1 time in total.
Looking cool, Joker!
-Morgana, 2017
----------------------------------------------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------
My dreams dictate my reality

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2400
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Gallery Error: Grid overfull

#2 Post 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.
< < insert Rick Cook quote here > >

User avatar
starshine001
Newbie
Posts: 23
Joined: Fri Feb 02, 2018 9:16 am
Completed: None
Projects: The Nightfall [Vampire Thriller]
Organization: None
Contact:

Re: Gallery Error: Grid overfull

#3 Post 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!
Looking cool, Joker!
-Morgana, 2017
----------------------------------------------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------
My dreams dictate my reality

rayminator
Miko-Class Veteran
Posts: 793
Joined: Fri Feb 09, 2018 12:05 am
Location: Canada
Contact:

Re: [Solved]Gallery Error: Grid overfull

#4 Post 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

Post Reply

Who is online

Users browsing this forum: Google [Bot], tim640