Uncle MUgen's imagemap GUI template help
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.
Uncle MUgen's imagemap GUI template help
From here: http://lemmasoft.renai.us/forums/viewto ... 75#p269679
Was I supposed to copy-paste the codes manually? Because when I tried to launch the game as-is it gives me an error.
Also, I want the slider bars in the preferences to have a "slider thumb". You know, this: How do I do that with this GUI template?
Was I supposed to copy-paste the codes manually? Because when I tried to launch the game as-is it gives me an error.
Also, I want the slider bars in the preferences to have a "slider thumb". You know, this: How do I do that with this GUI template?
- Viobli
- Regular
- Posts: 66
- Joined: Fri Jun 07, 2013 2:25 am
- Projects: *Truly, Friends *Lady Eun-mi
- Contact:
Re: Uncle MUgen's imagemap GUI template help
Hmm, I don't have the same code as Uncle Mugen, but this is what I do for my thumb to appear:
It should be able to work the same way. Hope this helps!
Code: Select all
init -2 python:
style.pref_slider.thumb = "GUI/thumb.jpg"Re: Uncle MUgen's imagemap GUI template help
Does it work even for hotbars on imagemap preferences? Because that's what I'm using. A customized imagemap preference screen >.<
- Viobli
- Regular
- Posts: 66
- Joined: Fri Jun 07, 2013 2:25 am
- Projects: *Truly, Friends *Lady Eun-mi
- Contact:
Re: Uncle MUgen's imagemap GUI template help
I tested it myself and it does work on both imagemap and imagebuttons.AERenoir wrote:Does it work even for hotbars on imagemap preferences? Because that's what I'm using. A customized imagemap preference screen >.<
Re: Uncle MUgen's imagemap GUI template help
Hotbar are specifically indicated to not have thumb, and will ignore any style settings about thumb.Viobli wrote:I tested it myself and it does work on both imagemap and imagebuttons.AERenoir wrote:Does it work even for hotbars on imagemap preferences? Because that's what I'm using. A customized imagemap preference screen >.<
- Viobli
- Regular
- Posts: 66
- Joined: Fri Jun 07, 2013 2:25 am
- Projects: *Truly, Friends *Lady Eun-mi
- Contact:
Re: Uncle MUgen's imagemap GUI template help
Hmm, strangely it worked for me. I did some more searching, so if it doesn't work, this thread might be helpful: http://lemmasoft.renai.us/forums/viewto ... for+hotbarElmiwisa wrote:Hotbar are specifically indicated to not have thumb, and will ignore any style settings about thumb.Viobli wrote:I tested it myself and it does work on both imagemap and imagebuttons.AERenoir wrote:Does it work even for hotbars on imagemap preferences? Because that's what I'm using. A customized imagemap preference screen >.<
Re: Uncle MUgen's imagemap GUI template help
That thread also said that it does not work for hotbar. Did you use hotbar or bar in your code?Viobli wrote: Hmm, strangely it worked for me. I did some more searching, so if it doesn't work, this thread might be helpful: http://lemmasoft.renai.us/forums/viewto ... for+hotbar
- Viobli
- Regular
- Posts: 66
- Joined: Fri Jun 07, 2013 2:25 am
- Projects: *Truly, Friends *Lady Eun-mi
- Contact:
Re: Uncle MUgen's imagemap GUI template help
Ahh my deepest apologies, I guess I was a little mixed up. Checking back, I was using bar for my code. Sorry for the confusion.Elmiwisa wrote:That thread also said that it does not work for hotbar. Did you use hotbar or bar in your code?Viobli wrote: Hmm, strangely it worked for me. I did some more searching, so if it doesn't work, this thread might be helpful: http://lemmasoft.renai.us/forums/viewto ... for+hotbar
Re: Uncle MUgen's imagemap GUI template help
Ooh, okay. I guess thumbs won't work, then 
Re: Uncle MUgen's imagemap GUI template help
If you love thumb on hotbar so much, why don't you make your own version of hotbar? Just copy the code from the engine and make some modification...
For example, you can add this code to the top of the file screens.rpy:
And then to set the thumb do something like this:
For example, you can add this code to the top of the file screens.rpy:
Code: Select all
init python:
def _hotbar_thumb(spot, adjustment=None, range=None, value=None, **properties):
if (adjustment is None) and (range is None) and (value is None):
raise Exception("hotbar requires either an adjustment or a range and value.")
if not ui.imagemap_stack:
raise Exception("hotbar expects an imagemap to be defined.")
imagemap = ui.imagemap_stack[-1]
x, y, w, h = spot
properties.setdefault("xpos", x)
properties.setdefault("ypos", y)
properties.setdefault("xanchor", 0)
properties.setdefault("yanchor", 0)
fore_bar=imagemap.cache.crop(imagemap.selected_idle, spot)
aft_bar=imagemap.cache.crop(imagemap.idle, spot)
hover_fore_bar=imagemap.cache.crop(imagemap.selected_hover, spot)
hover_aft_bar=imagemap.cache.crop(imagemap.hover, spot)
if h > w:
properties.setdefault("bar_vertical", True)
properties.setdefault("bar_invert", True)
fore_bar, aft_bar = aft_bar, fore_bar
hover_fore_bar, hover_aft_bar = hover_aft_bar, hover_fore_bar
return renpy.display.behavior.Bar(
adjustment=adjustment,
range=range,
value=value,
fore_bar=fore_bar,
aft_bar=aft_bar,
hover_fore_bar=hover_fore_bar,
hover_aft_bar=hover_aft_bar,
fore_gutter=0,
aft_gutter=0,
bar_resizing=False,
xmaximum=w,
ymaximum=h,
**properties)
ui.hotbar=ui.Wrapper(_hotbar_thumb,style="hotbar",replaces=True)
Code: Select all
style.hotbar.thumb="thumb.png"Re: Uncle MUgen's imagemap GUI template help
Wow, that's cool! Thanks so much!
So this goes above everything else in screen.rpy? And what about the codes for the hotbar I already set up? Do I need to change them or this extra code would just makes the thumb slider work on a hotbar?
So this goes above everything else in screen.rpy? And what about the codes for the hotbar I already set up? Do I need to change them or this extra code would just makes the thumb slider work on a hotbar?
Re: Uncle MUgen's imagemap GUI template help
Eh...it's nothing much. The code look long, but it is actually just the original Ren'Py code with a few minor modification.AERenoir wrote:Wow, that's cool! Thanks so much!
So this goes above everything else in screen.rpy? And what about the codes for the hotbar I already set up? Do I need to change them or this extra code would just makes the thumb slider work on a hotbar?
Put the code on top of the file screens.rpy, before everything else.
It will automatically make the hotbar to be able to have a thumb, so you do not need to modify your hotbar code. You still have to add in the code to select how the thumb look like however, which is something like:
Code: Select all
init -2 python:
style.hotbar.thumb="thumb.png"Who is online
Users browsing this forum: Bing [Bot], Google [Bot], Ocelot
