Stacked buttons in Android dress up/character customization

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
Arcanum
Veteran
Posts: 229
Joined: Mon May 09, 2011 9:07 am
Contact:

Stacked buttons in Android dress up/character customization

#1 Post by Arcanum »

Hello, folks!
I need help coding a small dress up game (sort of - more like a customization screen) for Android.
I'm making a customizable Red Riding Hood story for my final project in college.
I'd be capable of customizing the character if I had all the hair/clothes/etc options laid out on the screen, but since the phone screen is small, what I want to do is:
- clicking the icon will change the icon and the character
- the icon should always match the character
ex: if you click on the hair color icon, it'll go to the next icon, changing both the haircolor of the character and the icon.
(Say, the current haircolor is blond; both icon and character are blond. Clicking the icon will make both the icon and the character brunette)
Any idea on how to do that??
I'd thought to add little arrows next to the icons, but the android screen is so tiny they're virtually unclickable.

(Screenshot added for help)
Attachments
(screenshot where the characteristic match; disregard the arrows, plz!)
(screenshot where the characteristic match; disregard the arrows, plz!)
(the characteristics don`t match, disregard that, please!)
(the characteristics don`t match, disregard that, please!)

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Stacked buttons in Android dress up/character customizat

#2 Post by xela »

You can set up more than one action for the buttons. There should be no difference between changing the button icon and the picture together or one by one or just one not the other.
Like what we're doing? Support us at:
Image

Arcanum
Veteran
Posts: 229
Joined: Mon May 09, 2011 9:07 am
Contact:

Re: Stacked buttons in Android dress up/character customizat

#3 Post by Arcanum »

Sorry, Xela, do you have any idea how I should go at doing that? Because RN I was using an image map, with different coordinates for different skin choices, for example, with the end result showing up later. In this case, I can't see how I'd go at making everything in the same screen, with "layered" buttons of sorts?

This is the code I was working with, previously:

Code: Select all

 
    $ skinchoice = renpy.imagemap("images/skinchoice.jpg", "images/skinchoice.jpg", [
                           (250, 200, 450, 550, "white"),
                           (700, 200, 950, 550, "black")
                          ])
    if skinchoice == "black":
        $ skin = "black"
    elif skinchoice == "whte":
        $ skin = "white"

Code: Select all

image cv neutral = LiveComposite(
    (500,500),
    (0, 0), ConditionSwitch(
        "skin == 'white' ", "images/branca.png", #chapeuzinho branca
        "skin == 'black' ", "images/negra.png", #chapeuzinho negra
        ),

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Stacked buttons in Android dress up/character customizat

#4 Post by xela »

Arcanum wrote:Sorry, Xela, do you have any idea how I should go at doing that?
No idea, it depends on case per case basis... I'd never go with an imagemap for anything... ever, and I don't have a clue if the interaction elements on the left side are buttons or even more imagemaps.

Regardless, you can condition what the buttons/imagemaps on the left-side look like just like you can condition the sprite on the right-side. I don't understand the problem you have with this when you got the sprite on the right side to work. If conditioning seems complex, noone can really help you with that cause it's plain logic and you'll just have to hack your way thought it somehow.

If it was working with arrows properly, just have the main button/imagemap cycle whatever the action the arrows did...
Like what we're doing? Support us at:
Image

Post Reply

Who is online

Users browsing this forum: Semrush [Bot]