Transparent image over an imagemap
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.
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.
Transparent image over an imagemap
I'm starting to wonder if it's even possible. I'm trying to get a transparent image to show up over my main menus image map so I can use a transform on it. Can anyone help me out?
- trooper6
- Lemma-Class Veteran
- Posts: 3712
- Joined: Sat Jul 09, 2011 10:33 pm
- Projects: A Close Shave
- Location: Medford, MA
- Contact:
Re: Transparent image over an imagemap
Could you explain this a bit more?
You have a transparent image that shows nothing. And then you want to transform this transparent image? But no one can see what you did?
Anyway, what I'd say is, just put your image on a screen and then show the screen wherever you want.
You have a transparent image that shows nothing. And then you want to transform this transparent image? But no one can see what you did?
Anyway, what I'd say is, just put your image on a screen and then show the screen wherever you want.
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
*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
- xavimat
- Eileen-Class Veteran
- Posts: 1458
- Joined: Sat Feb 25, 2012 8:45 pm
- Completed: Yeshua, Jesus Life, Cops&Robbers
- Projects: Fear&Love, unknown
- Organization: Pilgrim Creations
- Github: xavi-mat
- itch: pilgrimcreations
- Location: Spain
- Contact:
Re: Transparent image over an imagemap
Maybe imagebuttons are more versatile for your needs, instead of an imagemap
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Re: Transparent image over an imagemap
trooper6 wrote:Could you explain this a bit more?
You have a transparent image that shows nothing. And then you want to transform this transparent image? But no one can see what you did?
Anyway, what I'd say is, just put your image on a screen and then show the screen wherever you want.
Sorry, I can see why that would be a little confusing. What I mean to ask is...
I have set up an imagemap on my games main menu. I want to put an image over it that will rotate slowly. I'm really not sure why I thought the image having transparency was relevant, lack of sleep can do strange things.
- trooper6
- Lemma-Class Veteran
- Posts: 3712
- Joined: Sat Jul 09, 2011 10:33 pm
- Projects: A Close Shave
- Location: Medford, MA
- Contact:
Re: Transparent image over an imagemap
Ah!
xavimat is correct, you want imagebuttons over an image rather than an imagemap.
Here is the tutorial on imagebuttons: http://lemmasoft.renai.us/forums/viewto ... 51&t=22565
xavimat is correct, you want imagebuttons over an image rather than an imagemap.
Here is the tutorial on imagebuttons: http://lemmasoft.renai.us/forums/viewto ... 51&t=22565
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
*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
Re: Transparent image over an imagemap
I'll look into imagebuttons, but i'm not sure I really need them. To clarify further, the rotating element isn't a button, and is only there for aesthetic. Is it just not possible to layer it over the imagemap? I feel like this would be easier than converting the menu to imagebuttons...trooper6 wrote:Ah!
xavimat is correct, you want imagebuttons over an image rather than an imagemap.
Here is the tutorial on imagebuttons: http://lemmasoft.renai.us/forums/viewto ... 51&t=22565
- trooper6
- Lemma-Class Veteran
- Posts: 3712
- Joined: Sat Jul 09, 2011 10:33 pm
- Projects: A Close Shave
- Location: Medford, MA
- Contact:
Re: Transparent image over an imagemap
Sure. Do what I said in my first post.
Put the image on a screen. And give it the rotating transform. Then show the screen, placing it where you want so it is wherever you want.
Put the image on a screen. And give it the rotating transform. Then show the screen, placing it where you want so it is wherever you want.
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
*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
- trooper6
- Lemma-Class Veteran
- Posts: 3712
- Joined: Sat Jul 09, 2011 10:33 pm
- Projects: A Close Shave
- Location: Medford, MA
- Contact:
Re: Transparent image over an imagemap
Here is some code that I made as an experiment. The one think I couldn't get it to do is rotate forever. Perhaps someone else knows how to do that?
Anyway:
Here is the code I made in the script.rpy.
And this is how I modified the screens.ry
Anyway:
Here is the code I made in the script.rpy.
Code: Select all
screen gear() align (0.5, 0.5):
add "gear.png":
xalign 0.5 yalign 0.5
xanchor 0.5 yanchor 0.5
at alwaysrotate
transform alwaysrotate:
rotate_pad True
linear 3.0 rotate 360
repeat
# The game starts here.
label start:
"This is just a game that is being tested."Code: Select all
##############################################################################
# Main Menu
#
# Screen that's used to display the main menu, when Ren'Py first starts
# http://www.renpy.org/doc/html/screen_special.html#main-menu
screen main_menu():
# This ensures that any other menu screen is replaced.
tag menu
# The background of the main menu.
window:
style "mm_root"
# The main menu buttons.
frame:
style_group "mm"
xalign .98
yalign .98
has vbox
textbutton _("Start Game") action Start()
textbutton _("Load Game") action ShowMenu("load")
textbutton _("Preferences") action ShowMenu("preferences")
textbutton _("Help") action Help()
textbutton _("Quit") action Quit(confirm=False)
use gear()
init -2:
# Make all the main menu buttons be the same size.
style mm_button:
size_group "mm"
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
*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
Re: Transparent image over an imagemap
Thank you for your replies! Okay, sorry for the late reply, but that seems to have helped... slightly. I've got the image showing over the imagemap, so at least that's something. However I can't seem to get it to rotate at all.
I've tried variations on this, and none of them seem to really make a difference. Still stuck. At least getting it to show is progress.
Code: Select all
screen mm_flair_rotate() align (0.5, 0.5):
add "menus/menu_flair.png"
xalign 0.5 yalign 0.5
xanchor 0.5 yanchor 0.5
at mm_rotate
transform mm_rotate:
subpixel True
rotate_pad True
linear 1.0 rotate 360
repeat- trooper6
- Lemma-Class Veteran
- Posts: 3712
- Joined: Sat Jul 09, 2011 10:33 pm
- Projects: A Close Shave
- Location: Medford, MA
- Contact:
Re: Transparent image over an imagemap
I noticed in my code after the add image line of code, I put a colon and then indented the next three lines (with the anchor, alignment, and transform). You don't have that colon and indentation. Have you tried it with the colon and indentation?
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
*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
Re: Transparent image over an imagemap
Yes, I did try this, but when I tried to launch the project I received error messages. I forget what exactly they were but something along the lines of not expecting a block after that statement.trooper6 wrote:I noticed in my code after the add image line of code, I put a colon and then indented the next three lines (with the anchor, alignment, and transform). You don't have that colon and indentation. Have you tried it with the colon and indentation?
Edit: I fixed it, but it's only rotating once, as you said. Also, I suppose I should have been more clear for my purposes.
This is making it orbit the center of the screen, rather than rotate. I guess I should have said spin. Hm. Sorry for any confusion. I'll try to tinker with it some more.
This is more progress than I was able to make on my own.
Post Edit Edit: I figured out the problem with it orbiting, it's the image resolution. Maybe. I think I need to crop it and give it a point (the center of the image) to rotate around, but I'm not sure how to position the image to where it needs to be in order to do that.
- trooper6
- Lemma-Class Veteran
- Posts: 3712
- Joined: Sat Jul 09, 2011 10:33 pm
- Projects: A Close Shave
- Location: Medford, MA
- Contact:
Re: Transparent image over an imagemap
The ATL section in the tutorial game has images that spiral, checking that out should give you the code that you need.
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
*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
- xavimat
- Eileen-Class Veteran
- Posts: 1458
- Joined: Sat Feb 25, 2012 8:45 pm
- Completed: Yeshua, Jesus Life, Cops&Robbers
- Projects: Fear&Love, unknown
- Organization: Pilgrim Creations
- Github: xavi-mat
- itch: pilgrimcreations
- Location: Spain
- Contact:
Re: Transparent image over an imagemap
The transform needs a point to start and to end. The always rotating effect can be achieved this way:
That means:
- The rotate 0 is the initial point, the rotate 360 is the final point, a second later.
- The repeat statement forces the image to be, again, at rotate 0. You can't see that, because rotate 0 and rotate 360 are the same position, but internally are not the same number.
- Without the "rotate 0" line, the repetition of "linear 1.0 rotate 360" tells the transform to rotate to 360 an image that is already rotated, doing nothing.
Code: Select all
transform mm_rotate:
subpixel True
rotate_pad True
rotate 0
linear 1.0 rotate 360
repeat- The rotate 0 is the initial point, the rotate 360 is the final point, a second later.
- The repeat statement forces the image to be, again, at rotate 0. You can't see that, because rotate 0 and rotate 360 are the same position, but internally are not the same number.
- Without the "rotate 0" line, the repetition of "linear 1.0 rotate 360" tells the transform to rotate to 360 an image that is already rotated, doing nothing.
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Re: Transparent image over an imagemap
Thank you so much! Both of you. I've got it working now! This post helped a lot.xavimat wrote:The transform needs a point to start and to end. The always rotating effect can be achieved this way:That means:Code: Select all
transform mm_rotate: subpixel True rotate_pad True rotate 0 linear 1.0 rotate 360 repeat
- The rotate 0 is the initial point, the rotate 360 is the final point, a second later.
- The repeat statement forces the image to be, again, at rotate 0. You can't see that, because rotate 0 and rotate 360 are the same position, but internally are not the same number.
- Without the "rotate 0" line, the repetition of "linear 1.0 rotate 360" tells the transform to rotate to 360 an image that is already rotated, doing nothing.
Who is online
Users browsing this forum: Google [Bot]
