Problem with imagemap(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
roswell
Newbie
Posts: 9
Joined: Thu Mar 29, 2012 7:36 pm
Contact:

Problem with imagemap(Solved)

#1 Post by roswell » Thu Jun 20, 2013 3:11 pm

Hello i´m having problems with changing the preferences menu
i use imagemap and the code i used is this

Code: Select all

screen preferences:
    tag menu
    
    imagemap:
        ground 'Menus/Cground.png'
        idle 'Menus/Configidle.png'
        hover 'Menus/Confighover.png'
        selected_idle 'Menus/configselectedidle.png'
        selected_hover 'Menus/Configselectedhover.png'

        hotspot (162,452,277,489) action Preference('display', 'window') 
        hotspot (162,404,277,442) action Preference('display', 'fullscreen')
        hotspot (533,453,652,490) action Preference('transitions', 'none')  
        hotspot (533,403,652,443) action Preference('transitions', 'all')  
                
        hotbar (289,153,499,190) value Preference('music volume') 
        hotbar (17,155,226,190) value Preference('sound volume') 
        hotbar (580,153,788,191) value Preference('text speed')
 
        
        hotspot (28,274,129,325) action ShowMenu('save') 
        hotspot (318,274,419,326) action ShowMenu('load') 
        hotspot (640,274,732,327) action ShowMenu('preferences') 
        hotspot (185,531,359,582) action MainMenu() 
        hotspot (45,532,151,582) action Return() 
        hotspot (392,531,479,582) action Quit() 
i thought i did it right.
But at the time i start playing and enter to this menu the options seems act weird.
http://subefotos.com/ver/?ba8589d9a7aa9 ... 2a095o.png
i hope somebody can help me
Last edited by roswell on Fri Jun 21, 2013 4:25 pm, edited 1 time in total.

User avatar
Suwamoto
Regular
Posts: 66
Joined: Wed Sep 05, 2012 7:36 am
Contact:

Re: Problem with imagemap

#2 Post by Suwamoto » Thu Jun 20, 2013 3:31 pm

Could you also attach the other files you are using for the imagemap? oxo So I can compare how it should look like and how it actually looks.

pwisaguacate
Veteran
Posts: 356
Joined: Mon Mar 11, 2013 11:03 pm
Contact:

Re: Problem with imagemap

#3 Post by pwisaguacate » Thu Jun 20, 2013 3:32 pm

Hotspots go by (x, y, width, height) rather than (x1, y1, x2, y2).


roswell
Newbie
Posts: 9
Joined: Thu Mar 29, 2012 7:36 pm
Contact:

Re: Problem with imagemap

#5 Post by roswell » Thu Jun 20, 2013 3:49 pm

pwisaguacate wrote:Hotspots go by (x, y, width, height) rather than (x1, y1, x2, y2).
Could you give me an example?

pwisaguacate
Veteran
Posts: 356
Joined: Mon Mar 11, 2013 11:03 pm
Contact:

Re: Problem with imagemap

#6 Post by pwisaguacate » Thu Jun 20, 2013 4:46 pm

roswell wrote:Could you give me an example?
Sure. Here are two random 200x100 rectangles:
example_hotspots.png
Assuming you had your coordinates exactly the way you want it to be, part of your code should look like this:

Code: Select all

        hotspot (162,452,116,38) action Preference('display', 'window') # 277 - 162 + 1 = 116; 489 - 452 + 1 = 38
        hotspot (162,404,116,39) action Preference('display', 'fullscreen')
        hotspot (533,453,120,38) action Preference('transitions', 'none')  
        hotspot (533,403,120,41) action Preference('transitions', 'all')  
Note how all your hotspot sizes are close but not same.

roswell
Newbie
Posts: 9
Joined: Thu Mar 29, 2012 7:36 pm
Contact:

Re: Problem with imagemap

#7 Post by roswell » Thu Jun 20, 2013 6:16 pm

pwisaguacate wrote:
roswell wrote:Could you give me an example?
Sure. Here are two random 200x100 rectangles:
example_hotspots.png
Assuming you had your coordinates exactly the way you want it to be, part of your code should look like this:

Code: Select all

        hotspot (162,452,116,38) action Preference('display', 'window') # 277 - 162 + 1 = 116; 489 - 452 + 1 = 38
        hotspot (162,404,116,39) action Preference('display', 'fullscreen')
        hotspot (533,453,120,38) action Preference('transitions', 'none')  
        hotspot (533,403,120,41) action Preference('transitions', 'all')  
Note how all your hotspot sizes are close but not same.



Oh! thank you!!
guess i understand, but how can i get the x and y??

User avatar
Suwamoto
Regular
Posts: 66
Joined: Wed Sep 05, 2012 7:36 am
Contact:

Re: Problem with imagemap

#8 Post by Suwamoto » Fri Jun 21, 2013 3:18 am

Oh! thank you!!
guess i understand, but how can i get the x and y??
Launch your game -> Press Shift + D -> Image Location Picker -> Select your image -> x and y coordinates are on the left bottom

Or do that with Photoshop XD

roswell
Newbie
Posts: 9
Joined: Thu Mar 29, 2012 7:36 pm
Contact:

Re: Problem with imagemap

#9 Post by roswell » Fri Jun 21, 2013 10:55 am

Suwamoto wrote:
Oh! thank you!!
guess i understand, but how can i get the x and y??
Launch your game -> Press Shift + D -> Image Location Picker -> Select your image -> x and y coordinates are on the left bottom

Or do that with Photoshop XD
Oh thank you so much i fix the problem :D

Post Reply

Who is online

Users browsing this forum: Google [Bot]