Imagemap and window problems

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
BlueLakeKylie
Newbie
Posts: 17
Joined: Thu Oct 22, 2015 3:24 pm
Contact:

Imagemap and window problems

#1 Post by BlueLakeKylie » Thu Oct 22, 2015 4:08 pm

So I've been messing around with Renpy for a while now, and I've got a lot of the basics and some other things, but there are a few things that I've been having issues with that I'd really like help with.

First issue. Not exactly an issue with development, but a while after getting the program, the window that allows you to access your game files and script files shrunk to about a fourth of the normal size. I redownloaded the program and it didn't help. While the issue is very minor, it would be nice to find a solution. I'm a Mac user and I'm using the program through Wine (because for some reason the mac application wouldn't open no matter what after being opened once), so that might complicate things, but maybe it's something can be easily fixed.

Second issue, the main issue I'm having here. I can't figure out how to use imagemap menu screens, like the main menu or the options menu. When I put in the code to create the imagemap, all I get is the chosen image suck at the top left corner of the screen, regardless of the coordinates I've put in. I can't interact with anything; there aren't any buttons.

What I'm trying to accomplish with my current test project is a main menu that looks like this. (with a white background because that's not the problem)

Image

Firstly, I have no idea how to have my buttons (the text is part of the button by the way) be separate, all I've heard about is how to have one base for all the buttons. I have all the needed buttons ready, hover and select ones for all of them, but I have no idea how to code it. Even if I put in the code for one of the buttons, I get the result I explained earlier; it appears in the top left corner, and can't be interacted with.

Like so:

Image

The screen for this test game is 600x450, but it doesn't matter which size the screen is; it's always just stuck in the corner like that.

Third question… Is it possible to keep the say who box open even with the narrator speaking? I tried to define the narrator as a character and added (show_two_window=True) to it, but it still doesn't appear.

On the subject of text boxes, I have another small question: How do you center the text in the text box? I just want the specific code to make ALL the text in the text boxes centered; I'm sure it's very simple, but I just want to be sure what works.

STILL on the subject of text boxes (I'm having a lot of trouble with this apparently), how do I make the say who box appear in front of the text box, so it can be coordinated on top of it? At the moment, it appears behind the text box in the place that it's in. How do I fix it?

One more little thing: How do you make it play a sound when you hover over a button? I have this code entered in my options file: (style.hotspot.hover_sound = "MenuCursor.wav") but it doesn't do anything.

User avatar
Jae
Regular
Posts: 192
Joined: Sun Sep 13, 2015 5:41 pm
Projects: Pokémon Academy Life
Location: New York, NY
Contact:

Re: Imagemap and window problems

#2 Post by Jae » Thu Oct 22, 2015 5:03 pm

You should always show your code since there could be a dozen things that can trigger an issue.

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Imagemap and window problems

#3 Post by PyTom » Thu Oct 22, 2015 5:10 pm

Okay, for the first issue, you want to delete the persistent data file. For the windows version, It's in %APPDATA%/Ren'Py/launcher-1 , but I don't know where it will be under wine. Actually, the use of wine is unsupported - you might want to check log.txt to see whty the mac version isn't working.

For the second question, post code and images.

For the third question:

Code: Select all

define narrator = Character(" ", say_two_window=Tre)
And for the last one:

Code: Select all

style button:
     hover_sound "MenuCursor.wav"
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
BlueLakeKylie
Newbie
Posts: 17
Joined: Thu Oct 22, 2015 3:24 pm
Contact:

Re: Imagemap and window problems

#4 Post by BlueLakeKylie » Thu Oct 22, 2015 8:10 pm

Ah, sorry about that. I have no idea how to code the imagemap I want, with the multiple images, but like I said, even for a basic imagemap menu, it's not working. Here's the code I've been trying to use for that:

Code: Select all

 imagemap:
        ground "ground.png"
        idle "idle.png"
        hover "hover.png"
       
        hotspot (#, #, #, #) action Start()
        hotspot (#, #, #, #) action ShowMenu("load")
        hotspot (#, #, #, #) action ShowMenu("preferences")
        hotspot (#, #, #, #) action Help()
        hotspot (#, #, #, #) action Quit(confirm=True)
# being coordinates.

Of course, this could be outdated…

The code gets me that image in the corner, like that picture I put up in the other post. It doesn't get me any errors, it just gets me an unusable main menu.

And what do you mean by images? Do you mean the images for the multi-image map that I wanted…?

User avatar
Jae
Regular
Posts: 192
Joined: Sun Sep 13, 2015 5:41 pm
Projects: Pokémon Academy Life
Location: New York, NY
Contact:

Re: Imagemap and window problems

#5 Post by Jae » Thu Oct 22, 2015 8:22 pm

Yeah, you should post what the images are.

Also, the coordinates are extremely important. The wrong coordinates could end up displaying only parts of your image or nothing at all, so your should definitely share the exact ones you're using instead of #, #, #, #.

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Imagemap and window problems

#6 Post by trooper6 » Thu Oct 22, 2015 8:40 pm

If you have a bunch of separate images, and each image is one of the clickables. Then you don't want an image map...you want imagebuttons. There is an imagebutton framework in the cookbook section. I can't link to it because I'm on my iPad, but go to the cookbook section and search for imagebutton framework. You could also just go to the screen language page of the documentation.

Because it looks to me like what you want is a small screen with a vbox with imagebuttons.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
BlueLakeKylie
Newbie
Posts: 17
Joined: Thu Oct 22, 2015 3:24 pm
Contact:

Re: Imagemap and window problems

#7 Post by BlueLakeKylie » Thu Oct 22, 2015 9:28 pm

Thanks, I'm working on it now, but… answers for these?
On the subject of text boxes, I have another small question: How do you center the text in the text box? I just want the specific code to make ALL the text in the text boxes centered; I'm sure it's very simple, but I just want to be sure what works.

STILL on the subject of text boxes (I'm having a lot of trouble with this apparently), how do I make the say who box appear in front of the text box, so it can be coordinated on top of it? At the moment, it appears behind the text box in the place that it's in. How do I fix it?
sorry I have a lot of questions haha

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Imagemap and window problems

#8 Post by trooper6 » Thu Oct 22, 2015 10:24 pm

Name box in front of text box question is answered here: http://lemmasoft.renai.us/forums/viewto ... se#p309221
Centering text in the text box situationally is answered here: http://lemmasoft.renai.us/forums/viewto ... enter+text
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
BlueLakeKylie
Newbie
Posts: 17
Joined: Thu Oct 22, 2015 3:24 pm
Contact:

Re: Imagemap and window problems

#9 Post by BlueLakeKylie » Fri Oct 23, 2015 8:45 pm

All right, thanks.

So I figured out the imagebutton thing, and now I've been able to get the working buttons to appear on the screen, but now it's continuously crashing whenever I hover over the buttons, or sometimes before I even have a chance to do anything. Crashing as in, the window just closes instantly. No error message. Is there a reason for this?

User avatar
Jae
Regular
Posts: 192
Joined: Sun Sep 13, 2015 5:41 pm
Projects: Pokémon Academy Life
Location: New York, NY
Contact:

Re: Imagemap and window problems

#10 Post by Jae » Fri Oct 23, 2015 9:01 pm

Show your code :/

User avatar
BlueLakeKylie
Newbie
Posts: 17
Joined: Thu Oct 22, 2015 3:24 pm
Contact:

Re: Imagemap and window problems

#11 Post by BlueLakeKylie » Sat Oct 24, 2015 11:36 am

Augh. Never mind, I found out the problem. There was a typo in one of the hover button files I coded in. It works now.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], _ticlock_