Need help with a scrolling background for my navigation menu

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
@berration
Regular
Posts: 70
Joined: Sun Jul 15, 2007 2:36 pm
Projects: EH...
Contact:

Need help with a scrolling background for my navigation menu

#1 Post by @berration »

I'm trying to learn how to use imagemaps to customize the user interface for my VN (Mugenjohncel's developer's version of TFQ has been very helpful thus far, I must say). It seems I have the main menu working well enough, but while working on the Preferences menu, I got the "brilliant" idea to use a slow scrolling background behind everything. Seems it's not as simple to do as I would have expected, and I'm a bit stumped.

Now, with imagemap-based menus, I assume the nav menu is seen beneath the buttons of other other menus (preferences, load, save)? I'm still trying to wrap my head around ATL as well, but as far as reproducing the general look I want, it seems easy enough:

Code: Select all

image nav_ground = "ui_nav_ground.png"

image nav_menu_bg:
     "ui_nav_bg.jpg"
     subpixel True xalign 0.0
     linear 70.0 xalign 1.0
     repeat

show nav_menu_bg
show nav_ground
Inside the game itself, this looks like what I want...but is there a way to put this at the base of an imagemap? I assume it would need to be a displayable, but can we make displayables that are this complicated?

Ugh...coding makes my head hurt... :(
Image

JinzouTamashii
Eileen-Class Veteran
Posts: 1686
Joined: Mon Sep 21, 2009 8:03 pm
Projects: E-mail me if you wanna rock the planet
Location: USA
Contact:

Re: Need help with a scrolling background for my navigation menu

#2 Post by JinzouTamashii »

Bookmarked because this topic is relevant to my interests in how to do this in ATL.
Don't worry, we can get through it together. I didn't forget about you! I just got overwhelmed.
https://cherylitou.wordpress.com

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Need help with a scrolling background for my navigation menu

#3 Post by PyTom »

1) Now, anywhere you can use a displayable, you can use an image defined with the image statement. If you want to use the image nav_menu_bg, you can just write "nav_menu_bg".

2) That being said, I don't expect it to work. Even if you moved the images making the imagemap up, you wouldn't move the imagemap hotspots.

I'm trying to think of what ATL-based menus would look like, but it's a hard problem, and so I haven't given it much thought.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

@berration
Regular
Posts: 70
Joined: Sun Jul 15, 2007 2:36 pm
Projects: EH...
Contact:

Re: Need help with a scrolling background for my navigation menu

#4 Post by @berration »

PyTom wrote:2) That being said, I don't expect it to work. Even if you moved the images making the imagemap up, you wouldn't move the imagemap hotspots.
Ah, well, that isn't quite what I'm trying to do. The buttons themselves are in a PNG file with an alpha channel. I don't plan on having them move anywhere. What I wanted to do was to have a scrolling image placed behind the buttons themselves.

So essentially: One scrolling image with a stationary image in front of it.

That being said, I haven't had much luck figuring out how to even get the scrolling image into the imagemap on it's own, let alone layer the button images on top of it. :?
Image

JinzouTamashii
Eileen-Class Veteran
Posts: 1686
Joined: Mon Sep 21, 2009 8:03 pm
Projects: E-mail me if you wanna rock the planet
Location: USA
Contact:

Re: Need help with a scrolling background for my navigation menu

#5 Post by JinzouTamashii »

Hold on... I bookmarked a topic like this before... :idea:
Don't worry, we can get through it together. I didn't forget about you! I just got overwhelmed.
https://cherylitou.wordpress.com

JinzouTamashii
Eileen-Class Veteran
Posts: 1686
Joined: Mon Sep 21, 2009 8:03 pm
Projects: E-mail me if you wanna rock the planet
Location: USA
Contact:

Re: Need help with a scrolling background for my navigation menu

#6 Post by JinzouTamashii »

http://lemmasoft.renai.us/forums/viewto ... f=8&t=4962

It's always cool when topics like this come back around with all the answers. Is the code still up to date in that demo, PyTom?
Don't worry, we can get through it together. I didn't forget about you! I just got overwhelmed.
https://cherylitou.wordpress.com

@berration
Regular
Posts: 70
Joined: Sun Jul 15, 2007 2:36 pm
Projects: EH...
Contact:

Re: Need help with a scrolling background for my navigation menu

#7 Post by @berration »

I remember that thread. I came across it when I was first trying to figure out how to make continuously-scrolling backgrounds (one of many nifty little effects O^3 had in it, as I recall). I've figured that much out, thankfully—seems the trick is mostly in creating the image itself—and the ATL version I had in my first post works fine for me. It's trying to get it into the menu, with the buttons on top of it, that's giving me trouble.
Image

Guest

Re: Need help with a scrolling background for my navigation menu

#8 Post by Guest »

So what's your problem getting into the menu, exactly?

User avatar
Showsni
Miko-Class Veteran
Posts: 563
Joined: Tue Jul 24, 2007 12:58 pm
Contact:

Re: Need help with a scrolling background for my navigation menu

#9 Post by Showsni »

Perhaps it would be better to use imagebuttons rather than an imagemap?

Alex

Re: Need help with a scrolling background for my navigation menu

#10 Post by Alex »

Just a thought, what if make a moving background and an imagemap over this background. But ground and selected images of imagemap should have only buttons and transparent fields surrounding them, to make background visible.

@berration
Regular
Posts: 70
Joined: Sun Jul 15, 2007 2:36 pm
Projects: EH...
Contact:

Re: Need help with a scrolling background for my navigation menu

#11 Post by @berration »

Guest wrote:So what's your problem getting into the menu, exactly?
Well, trying to use it in the imagemap gives me:
IOError: Couldn't find file 'nav_menu_bg'.
Not sure if that's just me doing something wrong or not.
Alex wrote:Just a thought, what if make a moving background and an imagemap over this background. But ground and selected images of imagemap should have only buttons and transparent fields surrounding them, to make background visible.
That's originally what I thought, but...well, unfortunately, this is my first real foray into customizing the menus, so for the most part, I have no idea what I'm doing. About all I know about modifying this menu is what's mentioned here—Which seemed simple enough, until I got the bright idea to try adding some animation:

http://renpy.org/wiki/renpy/doc/referen ... references

So I don't really know where I would put the scrolling image to make it the background of the menu. Pretty much the same goes for doing it with imagebuttons. I haven't really tried anything with them yet, so I'm not quite sure where to start. Am I going to need to look into working with Themes for this? I suppose I can start trying to make heads or tails of this page:

http://renpy.org/wiki/renpy/doc/referen ... _Interface

...but there's a scary lot of stuff in there. :shock:
Image

User avatar
Showsni
Miko-Class Veteran
Posts: 563
Joined: Tue Jul 24, 2007 12:58 pm
Contact:

Re: Need help with a scrolling background for my navigation menu

#12 Post by Showsni »

You are defining 'nav_menu_bg' before the imagemap, right? (In the -2 init thing).

@berration
Regular
Posts: 70
Joined: Sun Jul 15, 2007 2:36 pm
Projects: EH...
Contact:

Re: Need help with a scrolling background for my navigation menu

#13 Post by @berration »

Yes, I have it before the imagemap, but I still get that error. And with version 6.10, the image doesn't need to be in an init block anymore, correct? Er, not that it seems to make a difference in my testing, one way or the other. :|
Image

@berration
Regular
Posts: 70
Joined: Sun Jul 15, 2007 2:36 pm
Projects: EH...
Contact:

Re: Need help with a scrolling background for my navigation menu

#14 Post by @berration »

Update: Okay, so I'm an idiot. Pretty much all I actually needed was to put...

Code: Select all

gm_root = "nav_menu_bg",
...into options.rpy. Looks like this should work just fine. I still don't understand why I couldn't use the image in an imagemap without an error, but at the very least, with this I think I should be able to do what I was setting out to do in the first place. Thanks for the help! :D
Image

JinzouTamashii
Eileen-Class Veteran
Posts: 1686
Joined: Mon Sep 21, 2009 8:03 pm
Projects: E-mail me if you wanna rock the planet
Location: USA
Contact:

Re: Need help with a scrolling background for my navigation menu

#15 Post by JinzouTamashii »

Glad to see you caught it. Whenever you get image not found, you either mistyped it or didn't declare it.

Be sure to tag your topic [SOLVED].
Don't worry, we can get through it together. I didn't forget about you! I just got overwhelmed.
https://cherylitou.wordpress.com

Post Reply

Who is online

Users browsing this forum: eleloyce, Google [Bot]