Page 1 of 1

Imagemapping Help

Posted: Mon Jul 13, 2009 7:22 pm
by undertone09
I can't get the imagemapping for the main menu to work.

Here is my code

Code: Select all

init -2 python:
    layout.imagemap_main_menu("mainmenu,jpg", [
        (165.1, 55.6, 191.3, 66.7, "Start Game"),
        (165.6, 74.3, 194.5, 88.6, "Load Game"),
        (165.9, 93.7, 196.3, 104.8, "Extra"),
        (156.6, 107.4, 190, 121.7, "Quit"),
        ])
And here is the traceback error

Code: Select all

I'm sorry, but an exception occured while executing your Ren'Py
script.

TypeError: imagemap_main_menu() takes exactly 3 arguments (2 given)

While executing init code:
 - script at line 267 of C:\Users\Jordan\Desktop\Apps\renpy-6.9.2\The Game/game/options.rpy
 - python at line 272 of C:\Users\Jordan\Desktop\Apps\renpy-6.9.2\The Game/game/options.rpy.

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

  File "C:\Users\Jordan\Desktop\renpy-6.9.2\renpy\bootstrap.py", line 255, in bootstrap
  File "C:\Users\Jordan\Desktop\renpy-6.9.2\renpy\main.py", line 253, in main
  File "C:\Users\Jordan\Desktop\renpy-6.9.2\renpy\execution.py", line 230, in run
  File "C:\Users\Jordan\Desktop\renpy-6.9.2\renpy\ast.py", line 558, in execute
  File "C:\Users\Jordan\Desktop\renpy-6.9.2\renpy\python.py", line 921, in py_exec_bytecode
  File "C:\Users\Jordan\Desktop\Apps\renpy-6.9.2\The Game/game/options.rpy", line 272, in <module>
TypeError: imagemap_main_menu() takes exactly 3 arguments (2 given)

While executing init code:
 - script at line 267 of C:\Users\Jordan\Desktop\Apps\renpy-6.9.2\The Game/game/options.rpy
 - python at line 272 of C:\Users\Jordan\Desktop\Apps\renpy-6.9.2\The Game/game/options.rpy.

Ren'Py Version: Ren'Py 6.9.2a
If you can't tell, I'm not very good with programming code. What argument am I missing?
Thank you

Re: Imagemapping Help

Posted: Mon Jul 13, 2009 9:23 pm
by JQuartz

Re: Imagemapping Help

Posted: Sun Jul 26, 2009 6:50 pm
by Mew151
It's because you haven't a hover image.

If you don't want anything to change, just post the same image like this:

Code: Select all

init -2 python:
    layout.imagemap_main_menu("mainmenu.jpg", "mainmenu.jpg", [
        (165.1, 55.6, 191.3, 66.7, "Start Game"),
        (165.6, 74.3, 194.5, 88.6, "Load Game"),
        (165.9, 93.7, 196.3, 104.8, "Extra"),
        (156.6, 107.4, 190, 121.7, "Quit"),
        ])
Also note that you put a comma in "mainmenu.jpg" instead of a period. :wink: