Is a transparent imagemap quickmenu possible?

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
AERenoir
Veteran
Posts: 320
Joined: Fri May 27, 2011 8:23 pm
Contact:

Is a transparent imagemap quickmenu possible?

#1 Post by AERenoir »

So, I have this textbox that's semi-transparent. After doing some mockups about the placement of the quickmenu, the one I like has the quickmenu buttons sitting on the textbox, like so:
quickmenu help.jpg
(please don't mind the sample dumb text or the BG that's highly likely ripped from some commercial VN, it's just a mockup to see the textbox in "action")

Anyways, when I try to do the usual imagemap, the transparent areas will not become active and so I have to be super duper precise about positioning my cursor on the very-thin-text to click :( You can click on the sakura icons, I suppose, but It would be nice if I can click on the general area on the text too. Is it possible to make transparent areas into hotspots?

If not, then I can always rearrange the layouting, but it would be nice if I can do what I said up there.

User avatar
feathersnake
Regular
Posts: 104
Joined: Fri Apr 13, 2012 8:05 pm
Completed: A Rose by Any Other Name
Projects: Color, You've Got Mail!
Organization: Olfix Productions
Tumblr: olfix
Deviantart: olfix
Contact:

Re: Is a transparent imagemap quickmenu possible?

#2 Post by feathersnake »

*edit* Arowana's answer below is a much more simple fix to this question. :) I'll leave this here in case anyone happens to find it useful though. (minus the image examples because I think it's pretty straightforward.) This method is probably better suited to people that have oddly shaped buttons/hover areas with transparency. */edit*

If you're not dead-set on imagemaps, then this is really easy to do with imagebuttons. ^^ Hopefully this example is clear because I'm pretty much copy-pasting from a PM I sent a while ago.

Open your imagebuttons in whatever image program you use. Then add a new layer underneath whichever button you are currently editing. Make sure the area you want hovered is completely white on that new layer. Then go to the opacity for the new layer and turn it all the way down to 1. (Or even less, like .5, if you really want to make sure it doesn't show up. As long as it's a higher number than 0 )

Then merge your layers and save and tada! The player can now hover over the button in the area you put white under even though the white isn't visible. (You might want to save it in a different file just so you have the original somewhere if you decide to do something different. Or have the original copied somewhere else.) If you do this and have problems with it though, let me know. It's been a while since I've worked with GUI now.

It's also assumed that you have focus-mask set to True.

As for the use of imagebuttons in coding if you don't already know: http://lemmasoft.renai.us/forums/viewto ... 51&t=22565
Last edited by feathersnake on Wed Sep 24, 2014 4:07 pm, edited 2 times in total.
Olfix Productions:
Tumblr | itch.io
Complete Projects:
A Rose by Any Other Name
In-progress:
Color | You've Got Mail!

User avatar
Arowana
Miko-Class Veteran
Posts: 531
Joined: Thu May 31, 2012 11:17 pm
Completed: a2 ~a due~
Projects: AXIOM.01, The Pirate Mermaid
Organization: Variable X, Navigame
Tumblr: navigame-media
itch: navigame
Contact:

Re: Is a transparent imagemap quickmenu possible?

#3 Post by Arowana »

I think all you have to do is use alpha False for the imagemap. So something like:

Code: Select all

imagemap:
   blah blah code

   alpha False

   blah blah hotspots
Not sure about the imagebutton example - I think you can set focus_mask to get a similar effect for imagebuttons?
Complete: a2 ~a due~ (music, language, love)
In progress: The Pirate Mermaid (fairytale otome)
On hold: AXIOM.01 (girl detective game)

Image

User avatar
feathersnake
Regular
Posts: 104
Joined: Fri Apr 13, 2012 8:05 pm
Completed: A Rose by Any Other Name
Projects: Color, You've Got Mail!
Organization: Olfix Productions
Tumblr: olfix
Deviantart: olfix
Contact:

Re: Is a transparent imagemap quickmenu possible?

#4 Post by feathersnake »

Arowana wrote: Not sure about the imagebutton example - I think you can set focus_mask to get a similar effect for imagebuttons?
Probably should have mentioned that method with imagebuttons assumes focus_mask is set to True. ^^; Contrary to the example, I was using this for some odd shapes and areas. Which probably makes it pretty useless for something like this. Haha. A lovely lapse in judgment on my part.

I didn't even know about alpha False for imagemaps. :)
Olfix Productions:
Tumblr | itch.io
Complete Projects:
A Rose by Any Other Name
In-progress:
Color | You've Got Mail!

User avatar
AERenoir
Veteran
Posts: 320
Joined: Fri May 27, 2011 8:23 pm
Contact:

Re: Is a transparent imagemap quickmenu possible?

#5 Post by AERenoir »

Arowana wrote:I think all you have to do is use alpha False for the imagemap. So something like:

Code: Select all

imagemap:
   blah blah code

   alpha False

   blah blah hotspots
Not sure about the imagebutton example - I think you can set focus_mask to get a similar effect for imagebuttons?
Ooooh!! I didn't know about this! Based on the description I think this works fine for me. I'll try it!

User avatar
johandark
Veteran
Posts: 356
Joined: Sat Apr 30, 2016 11:04 am
Completed: Wild Guards, In Dreams
Projects: Pact with a witch
Deviantart: johandarkweb
Location: Barcelona
Contact:

Re: Is a transparent imagemap quickmenu possible?

#6 Post by johandark »

Is it possible make

Code: Select all

define gui.idle_color = '#555'
that text below textbox with 50% transparency?

I´ve tried this:

Code: Select all

define gui.idle_alpha = 0.5
But it doesn´t work.

I know this post is about "imagempas" but since is something very similar... I was just wondering :P
Image

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]