Weird Screen Based Imagemap Behavior [SOLVED]

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
mugenjohncel
Hentai Poofter
Posts: 2117
Joined: Sat Feb 04, 2006 11:13 pm
Organization: Studio Mugenjohncel
Location: Philippines
Contact:

Weird Screen Based Imagemap Behavior [SOLVED]

#1 Post by mugenjohncel » Sun May 08, 2011 5:15 pm

I think I encountered a really weird screenbased imagemap behaviour...

Here's the code I used...

Code: Select all

screen preferences:
    tag menu
    
    imagemap:
        ground 'gui/preferences_ground.png'
        idle 'gui/preferences_idle.png'
        hover 'gui/preferences_hover.png'
        selected_idle 'gui/preferences_selected_idle.png'
        selected_hover 'gui/preferences_selected_hover.png'

        hotspot (429, 239, 170, 56) action Preference('display', 'window') hover_sound "sfx/tok.ogg"
        hotspot (429, 307, 170, 56) action Preference('display', 'fullscreen') hover_sound "sfx/tok.ogg"
        hotspot (671, 239, 170, 56) action Preference('transitions', 'none') hover_sound "sfx/tok.ogg"
        hotspot (671, 307, 170, 56) action Preference('transitions', 'all') hover_sound "sfx/tok.ogg"
        
        #hotspot (-1, -1, -1, -1) action Preference('joystick') hover_sound "sfx/tok.ogg"
        
        hotspot (429, 434, 170, 56) action Preference('after choices', 'stop') hover_sound "sfx/tok.ogg"
        hotspot (429, 501, 170, 56) action Preference('after choices', 'skip') hover_sound "sfx/tok.ogg"
        hotspot (671, 434, 170, 56) action Preference('skip', 'seen') hover_sound "sfx/tok.ogg"
        hotspot (671, 502, 170, 56) action Preference('skip', 'all') hover_sound "sfx/tok.ogg"
        
        #hotspot (424, 58, 154, 100) action Preference('begin skipping') hover_sound "sfx/tok.ogg"
        
        hotbar (53, 101, 297, 29) value Preference('music volume') 
        hotbar (53, 175, 297, 29) value Preference('sound volume') 
        hotbar (53, 249, 297, 29) value Preference('voice volume') 
        hotbar (53, 417, 297, 29) value Preference('auto-forward time') 
        hotbar (53, 495, 297, 29) value Preference('text speed') 
        
        hotspot (885, 250, 151, 45) action Return() hover_sound "sfx/tok.ogg"
        hotspot (885, 305, 151, 44) action ShowMenu('save') hover_sound "sfx/tok.ogg"
        hotspot (885, 358, 151, 45) action ShowMenu('load') hover_sound "sfx/tok.ogg"
        hotspot (885, 413, 151, 44) action ShowMenu('preferences') hover_sound "sfx/tok.ogg"
        hotspot (885, 466, 151, 44) action MainMenu() hover_sound "sfx/tok.ogg"
        hotspot (885, 521, 151, 45) action Quit() hover_sound "sfx/tok.ogg"
Notice that I commented the begin skipping hotspot?... Inside the game, it will look like this sans the begin skipping button... (see image below)

Image

Now I shall remove the hash to enable the begin skipping button...

Code: Select all

screen preferences:
    tag menu
    
    imagemap:
        ground 'gui/preferences_ground.png'
        idle 'gui/preferences_idle.png'
        hover 'gui/preferences_hover.png'
        selected_idle 'gui/preferences_selected_idle.png'
        selected_hover 'gui/preferences_selected_hover.png'

        hotspot (429, 239, 170, 56) action Preference('display', 'window') hover_sound "sfx/tok.ogg"
        hotspot (429, 307, 170, 56) action Preference('display', 'fullscreen') hover_sound "sfx/tok.ogg"
        hotspot (671, 239, 170, 56) action Preference('transitions', 'none') hover_sound "sfx/tok.ogg"
        hotspot (671, 307, 170, 56) action Preference('transitions', 'all') hover_sound "sfx/tok.ogg"
        
        #hotspot (-1, -1, -1, -1) action Preference('joystick') hover_sound "sfx/tok.ogg"
        
        hotspot (429, 434, 170, 56) action Preference('after choices', 'stop') hover_sound "sfx/tok.ogg"
        hotspot (429, 501, 170, 56) action Preference('after choices', 'skip') hover_sound "sfx/tok.ogg"
        hotspot (671, 434, 170, 56) action Preference('skip', 'seen') hover_sound "sfx/tok.ogg"
        hotspot (671, 502, 170, 56) action Preference('skip', 'all') hover_sound "sfx/tok.ogg"
        
        hotspot (424, 58, 154, 100) action Preference('begin skipping') hover_sound "sfx/tok.ogg"
        
        hotbar (53, 101, 297, 29) value Preference('music volume') 
        hotbar (53, 175, 297, 29) value Preference('sound volume') 
        hotbar (53, 249, 297, 29) value Preference('voice volume') 
        hotbar (53, 417, 297, 29) value Preference('auto-forward time') 
        hotbar (53, 495, 297, 29) value Preference('text speed') 
        
        hotspot (885, 250, 151, 45) action Return() hover_sound "sfx/tok.ogg"
        hotspot (885, 305, 151, 44) action ShowMenu('save') hover_sound "sfx/tok.ogg"
        hotspot (885, 358, 151, 45) action ShowMenu('load') hover_sound "sfx/tok.ogg"
        hotspot (885, 413, 151, 44) action ShowMenu('preferences') hover_sound "sfx/tok.ogg"
        hotspot (885, 466, 151, 44) action MainMenu() hover_sound "sfx/tok.ogg"
        hotspot (885, 521, 151, 45) action Quit() hover_sound "sfx/tok.ogg"
And get this really odd looking behavior... (see image below)

Image

Rest of the hotspot now are... well... screwed up with some having their alignment messed up... and the really odd part is that the begin skipping hotspot is now the only correctly placed hotspot "but" the only hoverable parts are the odd graphical glitches present on 4 sides of the hotspot... and to top it all, this behavior not only messes up alignment but does so in a really randomized manner... meaning alignment is messed up but no two glitch are the same... meaning, same as the code above, I just relaunched the game and got this instead... (see image below)

Image

The more times I restart the game the more messed up it becomes...

Now I know I'm generally a klutz and one of the dumber renpy user in this forum but I swear I am 100% correct about these numbers and I fully understand that the first two numbers are the X and Y position and the last two are the width and height and make sure none of the hotspots overlap...

Just to be sure I also am not using cache pins...

Re-Commenting the begin skipping removes the problem. This behaviour can be recreated by simply removing the comment on the begin skipping section and only affects the config/option imagemap... the rest are working fine...

"POOF" (Disappears)
Last edited by mugenjohncel on Mon May 09, 2011 5:35 am, edited 1 time in total.

User avatar
Aleema
Lemma-Class Veteran
Posts: 2677
Joined: Fri May 23, 2008 2:11 pm
Organization: happyB
Tumblr: happybackwards
Contact:

Re: Weird Screen Based Imagemap Behavior...

#2 Post by Aleema » Sun May 08, 2011 5:29 pm

It's your cache images conflicting, probably? Maybe set caching to false and see if it still does that. I can't remember the code off the top of my head ... Oh, here it is, I think: http://www.renpy.org/dev-doc/html/confi ... emap_cache
And delete the cache in the game folder, too.

User avatar
mugenjohncel
Hentai Poofter
Posts: 2117
Joined: Sat Feb 04, 2006 11:13 pm
Organization: Studio Mugenjohncel
Location: Philippines
Contact:

Re: Weird Screen Based Imagemap Behavior...

#3 Post by mugenjohncel » Sun May 08, 2011 5:36 pm

Aleema wrote:delete the cache in the game folder
WHOA!... Everything magically works now!... I didn't know Renpy saves physical images in the cache folder...

But seriously, what happened there?...

Anyway... Thanks a LOT! :D

"POOF" (Oh man! I could give you a hug and a kiss right now!)

Post Reply

Who is online

Users browsing this forum: Google [Bot]