Page 1 of 1

Problems with Imagemaps

Posted: Sun Apr 05, 2020 12:27 am
by martinA123_05
Good night! Again I seek your help. This time, they are the famous ImageMaps.

I'm actually a novice with the Renpy operating system, but I try to learn with tutorials and blogs, however, more than once they fail me.

The problem arises, as I mentioned earlier, when I try to press an access point of the ImageMap and this does not lead me to the corresponding information. For example, I try to modify the main interface of my game, and when I press the button that takes me to the "configuration" the following error occurs.

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "renpy/common/00action_menu.rpy", line 100, in __call__
    raise Exception("%r is not a screen or a label." % orig_screen)
Exception: u'acerca de' is not a screen or a label.

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

Full traceback:
  File "renpy/common/_layout/screen_main_menu.rpym", line 28, in script
    python hide:
  File "C:\Users\Alumno\Desktop\renpy-7.3.5-sdk\renpy\ast.py", line 914, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "C:\Users\Alumno\Desktop\renpy-7.3.5-sdk\renpy\python.py", line 2028, in py_exec_bytecode
    exec bytecode in globals, locals
  File "renpy/common/_layout/screen_main_menu.rpym", line 28, in <module>
    python hide:
  File "renpy/common/_layout/screen_main_menu.rpym", line 35, in _execute_python_hide
    ui.interact()
  File "C:\Users\Alumno\Desktop\renpy-7.3.5-sdk\renpy\ui.py", line 297, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "C:\Users\Alumno\Desktop\renpy-7.3.5-sdk\renpy\display\core.py", line 2702, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "C:\Users\Alumno\Desktop\renpy-7.3.5-sdk\renpy\display\core.py", line 3518, in interact_core
    rv = root_widget.event(ev, x, y, 0)
  File "C:\Users\Alumno\Desktop\renpy-7.3.5-sdk\renpy\display\layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "C:\Users\Alumno\Desktop\renpy-7.3.5-sdk\renpy\display\layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "C:\Users\Alumno\Desktop\renpy-7.3.5-sdk\renpy\display\layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "C:\Users\Alumno\Desktop\renpy-7.3.5-sdk\renpy\display\screen.py", line 714, in event
    rv = self.child.event(ev, x, y, st)
  File "C:\Users\Alumno\Desktop\renpy-7.3.5-sdk\renpy\display\layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "C:\Users\Alumno\Desktop\renpy-7.3.5-sdk\renpy\display\layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "C:\Users\Alumno\Desktop\renpy-7.3.5-sdk\renpy\display\layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "C:\Users\Alumno\Desktop\renpy-7.3.5-sdk\renpy\display\behavior.py", line 962, in event
    return handle_click(self.clicked)
  File "C:\Users\Alumno\Desktop\renpy-7.3.5-sdk\renpy\display\behavior.py", line 897, in handle_click
    rv = run(action)
  File "C:\Users\Alumno\Desktop\renpy-7.3.5-sdk\renpy\display\behavior.py", line 320, in run
    return action(*args, **kwargs)
  File "renpy/common/00action_menu.rpy", line 100, in __call__
    raise Exception("%r is not a screen or a label." % orig_screen)
Exception: u'acerca de' is not a screen or a label.

Windows-8-6.2.9200
Ren'Py 7.3.5.606
my_question 1.0
Sun Apr 05 00:26:06 2020
This is the code I worked with

imagemap:
ground "GUI/mm/mm_ground.png"
idle "GUI/mm/mm_idle.png"
hover "GUI/mm/mm_hover.png"

# This is so that everything transparent is invisible to the cursor.

hotspot (#, #, #, #) action Start()
hotspot (#, #, #, #) action ShowMenu("load")
hotspot (#, #, #, #) action ShowMenu("preferences")
hotspot (#, #, #, #) action ShowMenu("bonus")
hotspot (#, #, #, #) action Help()
hotspot (#, #, #, #) action Quit(confirm=False)

And this is the code that I wrote in "screen.rpy"
imagemap:

ground "images/ground_lol.png"
idle "images/idle.png"
hover "images/hover.png"

# Esto es para que todo lo transparente sea invisible para el cursor.

hotspot (11, 156, 222, 61) action Start ()
hotspot (11, 232, 224, 56) action ShowMenu ("acerca de")
hotspot (14, 307, 220, 60) action ShowMenu ("Ayuda")
hotspot (11, 381, 218, 62) action Quit (confirm = False)


Everything is fine, the image changes when the cursor is over it, but it does not take me to the corresponding information.

I would seriously appreciate your help and guidance in this situation. I wait for your answers, I wish you good night <3

Re: Problems with Imagemaps

Posted: Sun Apr 05, 2020 4:19 am
by korova
Do you have a menu/screen or a label in your code called "Ayuda" or "acerca de" ? (that's what is complainig about I think)

Re: Problems with Imagemaps

Posted: Sun Apr 05, 2020 10:25 am
by isobellesophia
make a label or a screen. That'll do easily.

Re: Problems with Imagemaps

Posted: Sun Apr 05, 2020 11:44 am
by rayminator
this what it should look like and make sure you put the underline _ if there is a blank space

Code: Select all

hotspot (11, 232, 224, 56) action ShowMenu("acerca_de")

Code: Select all

label acerca_de: or screen acerca_de:

Re: Problems with Imagemaps

Posted: Mon Apr 06, 2020 12:05 am
by martinA123_05
korova wrote:
Sun Apr 05, 2020 4:19 am
Do you have a menu/screen or a label in your code called "Ayuda" or "acerca de" ? (that's what is complainig about I think)
I think there is not! Is that I copied as it was on the internet, could you explain me how to do it :(?

Re: Problems with Imagemaps

Posted: Mon Apr 06, 2020 3:32 am
by isobellesophia
rayminator already explained above, along with the code.

Re: Problems with Imagemaps

Posted: Mon Apr 06, 2020 10:27 am
by rayminator
this is also wrong by the way

Code: Select all

hotspot (11, 156, 222, 61) action Start ()
hotspot (11, 232, 224, 56) action ShowMenu ("acerca de")
hotspot (14, 307, 220, 60) action ShowMenu ("Ayuda")
hotspot (11, 381, 218, 62) action Quit (confirm = False)
there shouldn't be a space between

Start ()
ShowMenu ("acerca de")
ShowMenu ("Ayuda")
Quit (confirm = False)

should be like this

Code: Select all

hotspot (11, 156, 222, 61) action Start()
hotspot (11, 232, 224, 56) action ShowMenu("acerca_de")
hotspot (14, 307, 220, 60) action ShowMenu("Ayuda")
hotspot (11, 381, 218, 62) action Quit(confirm = False)

Re: Problems with Imagemaps

Posted: Mon Apr 06, 2020 6:04 pm
by martinA123_05
rayminator wrote:
Mon Apr 06, 2020 10:27 am
this is also wrong by the way

Code: Select all

hotspot (11, 156, 222, 61) action Start ()
hotspot (11, 232, 224, 56) action ShowMenu ("acerca de")
hotspot (14, 307, 220, 60) action ShowMenu ("Ayuda")
hotspot (11, 381, 218, 62) action Quit (confirm = False)
there shouldn't be a space between

Start ()
ShowMenu ("acerca de")
ShowMenu ("Ayuda")
Quit (confirm = False)

should be like this

Code: Select all

hotspot (11, 156, 222, 61) action Start()
hotspot (11, 232, 224, 56) action ShowMenu("acerca_de")
hotspot (14, 307, 220, 60) action ShowMenu("Ayuda")
hotspot (11, 381, 218, 62) action Quit(confirm = False)


Ohh! thanks!