"Image" combo box

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
JFillip
Newbie
Posts: 14
Joined: Thu Sep 03, 2015 12:59 am
Contact:

"Image" combo box

#1 Post by JFillip »

Hello everyone.
How can i create image combo box in renpy? For example I have a screen where i add several image button. But one button on click return value (using ui.interact()) and next button only set value of some variable. But remember it is only on 1 screen. If user choose one of "image" combo box and then use image button for action, for example.

If you have any resources, which can help please share. :)

JFillip
Newbie
Posts: 14
Joined: Thu Sep 03, 2015 12:59 am
Contact:

Re: "Image" combo box

#2 Post by JFillip »

No one knows how to implement a combo box? I will approach for any example of implementing the combo box.

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: "Image" combo box

#3 Post by trooper6 »

I don't really understand your question. Could you ask it again in a different way...or provide a drawing of what you want?

Also, why are you using ui.interact? That is old style code.
If you have code post it.
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

JFillip
Newbie
Posts: 14
Joined: Thu Sep 03, 2015 12:59 am
Contact:

Re: "Image" combo box

#4 Post by JFillip »

Sorry for my english and bad explanation. :oops:

I have 5 buttons. Four of them change value of any parameter. The fifth button is waiting for a response from the user.
For example, we have clicked the first button. It must change its image and to apply the parameter. Then we decided to change the parameter and press the second button. At this time the first button should reset the picture. And so on. Then we decided to choose the third button eventually. Now we click on the fifth button and an run action with a parameter from a third button.

Code: Select all

init python:
    
a = 0
    
def CreateButton():
        
ui.imagebutton( auto = "button_%s.png", clicked= SetVariable('a', a+1), pos = (0,0))    # 1
ui.imagebutton(auto = "button_%s.png", clicked= SetVariable('a', a+2), pos = (0,100))   # 2
ui.imagebutton(auto = "button_%s.png", clicked= SetVariable('a', a+3), pos = (0,200))   # 3
ui.imagebutton(auto = "button_%s.png", clicked= SetVariable('a', a+4), pos = (0,300))   # 4

# code...

ui.imagebutton(auto = "button_%s.png", clicked=ui.returns(("done", True)), pos = (300,0))       #5
        
type, value = ui.interact()

if type == "done":
ui.text('DONE!', align = (0.6,0.5))
return
        

label start:
    
scene black
    
$ CreateButton()
    
show text str(a)
    
pause
    
return
Sorry again for my English. I think now it will be clearer what needs to be done. :oops:

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: "Image" combo box

#5 Post by trooper6 »

Why are you using the ui code and why are you making a function? I think you really should be using screen language instead.
Also...you say you want the image on the button to change when clicked...from what to what? What happens if the user clicks the same button more than once?
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

JFillip
Newbie
Posts: 14
Joined: Thu Sep 03, 2015 12:59 am
Contact:

Re: "Image" combo box

#6 Post by JFillip »

1) I don't know how to create the same situation using screen language. If you know please share with me.
2) If we again click on this button the image is not change. Simple example on Windows form. Can I do same thing in renpy?
001.png
001.png (8.91 KiB) Viewed 583 times
002.png
002.png (8.07 KiB) Viewed 583 times
003.png
003.png (8.07 KiB) Viewed 583 times
004.png
004.png (8.07 KiB) Viewed 583 times
Thank you very much for your time. :)

Post Reply

Who is online

Users browsing this forum: No registered users