How do I Set Different XY Values on ImageMaps?

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
Mikomi
Veteran
Posts: 324
Joined: Tue Jun 24, 2014 11:45 pm
Completed: That Which Binds Us, Enamored Risks, Alice in Stardom
Projects: Asterism, Magicanna
Organization: Crystal Game Works
itch: CrystalGameWorks
Contact:

How do I Set Different XY Values on ImageMaps?

#1 Post by Mikomi » Thu Feb 05, 2015 12:20 am

So, I've ran into a problem. I have no clue how to set different x align and y align values for the various buttons on an image map. Here's a screenshot of my code so far.
Attachments
uuuggh.PNG
(8.25 KiB) Not downloaded yet

philat
Eileen-Class Veteran
Posts: 1853
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: How do I Set Different XY Values on ImageMaps?

#2 Post by philat » Thu Feb 05, 2015 12:35 am

Why are the buttons in an hbox? I also find that xalign/yalign is trickier to use for fine positioning than xpos/ypos, although ymmv.

Btw, imagebuttons and imagemaps are different. Depending on what you want to do with this screen, you may find an imagemap easier to set up.

User avatar
Mikomi
Veteran
Posts: 324
Joined: Tue Jun 24, 2014 11:45 pm
Completed: That Which Binds Us, Enamored Risks, Alice in Stardom
Projects: Asterism, Magicanna
Organization: Crystal Game Works
itch: CrystalGameWorks
Contact:

Re: How do I Set Different XY Values on ImageMaps?

#3 Post by Mikomi » Thu Feb 05, 2015 9:24 pm

philat wrote:Why are the buttons in an hbox? I also find that xalign/yalign is trickier to use for fine positioning than xpos/ypos, although ymmv.

Btw, imagebuttons and imagemaps are different. Depending on what you want to do with this screen, you may find an imagemap easier to set up.
Well, the person who taught me this used hbox, so I used it too. I had the first one aligned perfectly but once I put in the second xalign and yalign by the second one it threw them both off center.

The person who taught me this told me this was imagemaps.

philat
Eileen-Class Veteran
Posts: 1853
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: How do I Set Different XY Values on ImageMaps?

#4 Post by philat » Thu Feb 05, 2015 9:28 pm

An hbox wants to force its children to be side by side horizontally. When you attempt to mess with that, it won't react very nicely.

I recommend that you use an imagemap; pretty sure be easier for a renpy beginner. http://lemmasoft.renai.us/forums/viewto ... 51&t=14237

User avatar
Mikomi
Veteran
Posts: 324
Joined: Tue Jun 24, 2014 11:45 pm
Completed: That Which Binds Us, Enamored Risks, Alice in Stardom
Projects: Asterism, Magicanna
Organization: Crystal Game Works
itch: CrystalGameWorks
Contact:

Re: How do I Set Different XY Values on ImageMaps?

#5 Post by Mikomi » Thu Feb 05, 2015 10:28 pm

philat wrote:An hbox wants to force its children to be side by side horizontally. When you attempt to mess with that, it won't react very nicely.

I recommend that you use an imagemap; pretty sure be easier for a renpy beginner. http://lemmasoft.renai.us/forums/viewto ... 51&t=14237
You're kinda confusing me- you keep saying imagemaps would be easier, but haven't told me what I was doing. Was I taught wrong, or is the code I showed an imagemap?

I'm sorry if I sound like a newbie, I'm really not.

philat
Eileen-Class Veteran
Posts: 1853
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: How do I Set Different XY Values on ImageMaps?

#6 Post by philat » Thu Feb 05, 2015 10:40 pm

You were taught wrong.

As I said before, the code you posted uses imageBUTTONS. The topic I linked you to shows how to use an imageMAP. The primary difference is that with the imagemap, instead of positioning each hotspot manually you designate hotspots in relation to a fixed image (the hotspots are easy to find using the image location picker in the dev tools, which you can bring up using shift+d), so that your specific problem -- positioning hotspots -- mostly goes away. There are other things that imagebuttons are better for, but they generally require more effort than an imagemap, which is why I recommended one over the other.

On the other hand, if you would rather position each element separately, you could also just get rid of the hbox. Literally, delete the hbox, un-indent your imagebuttons and it will probably work.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], nyeowmi