Page 2 of 2

Re: Custom Menu

Posted: Sun Nov 16, 2008 2:06 pm
by Vatina
EvilDragon wrote:Read PyTom's reply.

You do like this:

Code: Select all

init python:
    theme.image_buttons({
        "Name of the button" : ("button_not_pressed.png", "button_hovered.png", "button_selected.png", "button_selected_and_hovered.png", "button_not_sensitive.png"),
        "Another button" : (order images the same way),
        # ... add other buttons like so
    })
It's important to order the image files correct way. So first you put "idle" image, then "hovered", then "selected", then "selected+hovered", then "insensitive".


I've tried this to customize my own menu, but all I get is a traceback with this message: AttributeError: 'RevertableObject' object has no attribute 'image_buttons'

I have the newest renpy. Is my options code just outdated or something? Or is there something in all the code examples I have read that I just don't get? (In all honesty, I don't get any of this imagemap stuff... so I'm just trying to paste in what everyone else says. I'm too dumb for the tutorial it seems :P )

Here is the full traceback in case you need it:

Code: Select all

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

AttributeError: 'RevertableObject' object has no attribute 'image_buttons'

While executing init code:
 - script at line 3 of C:\Documents and Settings\Lonnie Brandt\My Documents\Andet\OEL vn\renpy-6.8.0\glass_wings/game/script.rpy
 - python at line 4 of C:\Documents and Settings\Lonnie Brandt\My Documents\Andet\OEL vn\renpy-6.8.0\glass_wings/game/script.rpy.

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

  File "C:\Documents and Settings\****\My Documents\Andet\OEL vn\renpy-6.8.0\renpy\bootstrap.py", line 247, in bootstrap
  File "C:\Documents and Settings\****\My Documents\Andet\OEL vn\renpy-6.8.0\renpy\main.py", line 253, in main
  File "C:\Documents and Settings\****\My Documents\Andet\OEL vn\renpy-6.8.0\renpy\execution.py", line 199, in run
  File "C:\Documents and Settings\****\My Documents\Andet\OEL vn\renpy-6.8.0\renpy\ast.py", line 554, in execute
  File "C:\Documents and Settings\****\My Documents\Andet\OEL vn\renpy-6.8.0\renpy\python.py", line 880, in py_exec_bytecode
  File "C:\Documents and Settings\****\My Documents\Andet\OEL vn\renpy-6.8.0\glass_wings/game/script.rpy", line 4, in <module>
AttributeError: 'RevertableObject' object has no attribute 'image_buttons'

While executing init code:

Ren'Py Version: Ren'Py 6.8.0f

Re: Custom Menu

Posted: Sun Nov 16, 2008 2:35 pm
by PyTom
Are you in compat mode (either by calling layout.compat, or by setting config.script_version)? Alternatively, do you somehow define theme yourself?

Also, image_buttons is different from image_maps. The latter is newer, and is probably easier to use for someone with an artistic bent.

Re: Custom Menu

Posted: Sun Nov 23, 2008 1:25 pm
by Vatina
Oh yeah, image buttons ^^;

About compat mode - no I don't think so. I've tried searching through my scripts with both those commands, and nothing turned up. Although I seem to remember something about that quite a while ago when my cg gallery code didn't work together with a new renpy version, before a fix came out for that. I wonder if I removed it again after the fix? Or if this is even related?

Meh... better try again, I guess.



EDIT: No wait! I found this in my "New Gallery" code:

Code: Select all

init -1 python hide:
    layout.compat()
Is that why it's not working?

EDIT2: Nevermind - I updated the gallery code and removed compat mode. Now it works :) Thanks.

Re: Custom Menu

Posted: Thu Nov 27, 2008 7:17 pm
by Gouka
I tried your code Pytom but it doesn't seem to work.
I want my main menu to look something like this:

what is the full code?

(Please be patient with me. I'm new at this)

Re: Custom Menu

Posted: Mon Jan 12, 2009 3:21 pm
by JQuartz
Gouka wrote:I want my main menu to look something like this:

what is the full code?
(Shameless promo):Use the main menu generator! I cpmpleted it so it can make transparent buttons as well (press change frame then change solid color then type 0000)