- Aug 4, 2020
- 925
- 1,460
Hi, I have a problem with creating a photo book.
I want it to make a grid of smaller images and when I click on that image it opens the image to its actual size.
I have coded this:
And it presents me the grid on screen with the reduced images without any problem.
The problem appears when it tries to execute the "action" instruction.
What I don't know is what I'm doing wrong.
I get this error:
I want it to make a grid of smaller images and when I click on that image it opens the image to its actual size.
I have coded this:
Code:
grid gui.file_slot_cols gui.file_slot_rows: #grid 3 3 --> 9x9
style_prefix "slot"
xalign 0.5
yalign 0.5
xoffset 160
spacing gui.slot_spacing
imagebutton: idle Transform("images/album/raquel/raquel31.webp", zoom=0.2) action Show("images/album/raquel/raquel31.webp")
imagebutton: idle Transform("images/album/raquel/raquel32.webp", zoom=0.2) action Show("images/album/raquel/raquel32.webp")
imagebutton: idle Transform("images/album/raquel/raquel33.webp", zoom=0.2) action Show("images/album/raquel/raquel33.webp")
imagebutton: idle Transform("images/album/raquel/raquel34.webp", zoom=0.2) action Show("images/album/raquel/raquel34.webp")
imagebutton: idle Transform("images/album/raquel/raquel35.webp", zoom=0.2) action Show("images/album/raquel/raquel35.webp")
imagebutton: idle Transform("images/album/raquel/raquel36.webp", zoom=0.2) action Show("images/album/raquel/raquel36.webp")
imagebutton: idle Transform("images/album/raquel/raquel37.webp", zoom=0.2) action Show("images/album/raquel/raquel37.webp")
imagebutton: idle Transform("images/album/raquel/raquel38.webp", zoom=0.2) action Show("images/album/raquel/raquel38.webp")
The problem appears when it tries to execute the "action" instruction.
What I don't know is what I'm doing wrong.
I get this error:
Code:
I'm sorry, but an uncaught exception occurred.
While running game code:
File "renpy/common/00gamemenu.rpy", line 173, in script
$ ui.interact()
File "renpy/common/00gamemenu.rpy", line 173, in <module>
$ ui.interact()
File "renpy/common/00action_control.rpy", line 126, in __call__
renpy.show_screen(self.screen, *self.args, **self.kwargs)
Exception: Screen images/album/raquel/raquel11.webp is not known.
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "renpy/common/00gamemenu.rpy", line 173, in script
$ ui.interact()
File "renpy/ast.py", line 913, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "renpy/python.py", line 2111, in py_exec_bytecode
exec(bytecode, globals, locals)
File "renpy/common/00gamemenu.rpy", line 173, in <module>
$ ui.interact()
File "renpy/ui.py", line 298, in interact
rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
File "renpy/display/core.py", line 2978, in interact
repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
File "renpy/display/core.py", line 3776, in interact_core
rv = root_widget.event(ev, x, y, 0)
File "renpy/display/layout.py", line 1027, in event
rv = i.event(ev, x - xo, y - yo, cst)
File "renpy/display/transition.py", line 48, in event
return self.new_widget.event(ev, x, y, st) # E1101
File "renpy/display/layout.py", line 1027, in event
rv = i.event(ev, x - xo, y - yo, cst)
File "renpy/display/layout.py", line 1027, in event
rv = i.event(ev, x - xo, y - yo, cst)
File "renpy/display/screen.py", line 720, in event
rv = self.child.event(ev, x, y, st)
File "renpy/display/layout.py", line 1027, in event
rv = i.event(ev, x - xo, y - yo, cst)
File "renpy/display/layout.py", line 245, in event
rv = d.event(ev, x - xo, y - yo, st)
File "renpy/display/behavior.py", line 969, in event
return handle_click(self.clicked)
File "renpy/display/behavior.py", line 904, in handle_click
rv = run(action)
File "renpy/display/behavior.py", line 323, in run
return action(*args, **kwargs)
File "renpy/common/00action_control.rpy", line 126, in __call__
renpy.show_screen(self.screen, *self.args, **self.kwargs)
File "renpy/display/screen.py", line 1115, in show_screen
raise Exception("Screen %s is not known.\n" % (name[0],))
Exception: Screen images/album/raquel/raquel11.webp is not known.
[code]
Thanks for your help.