Search found 114 matches

by enaielei
Tue Aug 09, 2022 2:48 am
Forum: Ren'Py Questions and Announcements
Topic: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame
Replies: 22
Views: 410

Re: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame

If you have these lines in your code then you're good.

Code: Select all

screen minigame(xcount, ycount):
  # range constants
  default XRANGE = range(xcount)
  default YRANGE = range(ycount)
I'd suggest force recompiling your scripts through the launcher.
by enaielei
Mon Aug 08, 2022 10:04 pm
Forum: Ren'Py Questions and Announcements
Topic: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame
Replies: 22
Views: 410

Re: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame

Setting the size for each cell is a matter of styling and a preference of your own. So you need to learn and implement this on your own.
I already included links on where you can learn about this.
by enaielei
Mon Aug 08, 2022 9:58 pm
Forum: Ren'Py Questions and Announcements
Topic: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame
Replies: 22
Views: 410

Re: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame

Yeah, I removed the txt variable when I excerpted from the original code. Just define it again. python: if cell == OFF: txt = "off" idle = "off_idle.png" hover = "off_hover.png" elif cell == ON: txt = "on" idle = "on_idle.png" hover = "on_hover.png" else: txt = "x" idle = "x_idle.png" hover = "x_hov...
by enaielei
Mon Aug 08, 2022 9:39 pm
Forum: Ren'Py Questions and Announcements
Topic: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame
Replies: 22
Views: 410

Re: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame

For the image, since you're using imagebuttons, you may refer to this documentation Not really a fan of imagebuttons since I use buttons for most of the time. Using buttons you can approach it like this. python: if cell == OFF: idle = "off_idle.png" hover = "off_hover.png" elif cell == ON: idle = "o...
by enaielei
Mon Aug 08, 2022 9:06 pm
Forum: Ren'Py Questions and Announcements
Topic: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame
Replies: 22
Views: 410

Re: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame

Here's my goal: During the VN, a minigame is triggered. This is a logic puzzle, with an array of imagebuttons that can be toggled into three states: OFF, ON, and X, each with their own idle and hover images (e.g. on is highlighted, off is dark, X is...an X). When the VN calls the minigame screen, I...
by enaielei
Mon Aug 08, 2022 3:19 am
Forum: Ren'Py Questions and Announcements
Topic: button to reset game
Replies: 4
Views: 440

Re: button to reset game

Use the persistent._clear to reset the Persistent data.

Code: Select all

textbutton "Reset" action Function(persistent._clear, True)
by enaielei
Mon Aug 08, 2022 3:16 am
Forum: Ren'Py Questions and Announcements
Topic: How to turn off sound when the Renpy game is deactivated.
Replies: 1
Views: 217

Re: How to turn off sound when the Renpy game is deactivated.

I don't think there's an easy way to do this other than having access to the window object itself to access its state/properties.
This documentation might help you.
by enaielei
Mon Aug 08, 2022 3:02 am
Forum: Ren'Py Questions and Announcements
Topic: How to make keymap for Return()
Replies: 3
Views: 242

Re: How to make keymap for Return()

If you're talkng about launching the game menu while in game its already like that by default. In the docs , this part defines that by default. game_menu = [ 'K_ESCAPE', 'K_MENU', 'K_PAUSE', 'mouseup_3'] The best way to customize the screen to launch when escape key is pressed is to use the store va...
by enaielei
Sun Aug 07, 2022 3:19 am
Forum: Ren'Py Questions and Announcements
Topic: Named Character results in key error
Replies: 11
Views: 240

Re: Named Character results in key error

Remove the [ and ] in your define mc. If you marked the Character dynamic then treat the name as a python expression. In short, either of these two would work in making the name dynamic. # Always "default" your variable then change the value later on inside your label etc. default main_character_nam...
by enaielei
Sat Aug 06, 2022 9:24 am
Forum: Ren'Py Questions and Announcements
Topic: Make children of button react to hover etc. like imagebutton
Replies: 1
Views: 209

Re: Make children of button react to hover etc. like imagebutton

Use the background property of the button instead of adding an image inside and combine it with prefixes . Alternatively, you can store the hover status of the button through a variable using the hovered and unhovered properties then use conditions using the variable. screen test(): default hovered ...
by enaielei
Fri Aug 05, 2022 5:33 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] How to add values to the dictionary through "button: action Function"?
Replies: 5
Views: 227

Re: How to add values to the dictionary through "button: action Function"?

You can try creating your function for that. init python: def _remove_from_dict(dct, key): dct.pop(key) # Should also work with list. def RemoveFromDict(dct, key): return Function(_remove_from_dict, dct, key) screen test(): textbutton "-" action RemoveFromDict(my_dict, var) You can also try using la...
by enaielei
Fri Aug 05, 2022 2:52 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] How to add values to the dictionary through "button: action Function"?
Replies: 5
Views: 227

Re: How to add values to the dictionary through "button: action Function"?

Use SetDict in setting values for lists/dicts.

Code: Select all

textbutton "+" action SetDict(my_dict, var, value)
by enaielei
Thu Aug 04, 2022 10:17 pm
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] how to add images for choice menus ?
Replies: 1
Views: 227

Re: how to add images for choice menus ?

That would be easy as creating a custom screen in Ren'Py. A simple example. screen imenu(*imgs): hbox: for i, img in enumerate(imgs): button: action Return(i) background img label start: call screen imenu("img1.png", "img2.png", "img3.png") # add many images as many as you want... if _return == 0: #...
by enaielei
Wed Aug 03, 2022 1:55 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] What version of Python does Renpy 8.0.1 support?
Replies: 2
Views: 192

Re: What version of Python does Renpy 8.0.1 support?

Additionally, you can determine this through the console (Shift + o), then typing the code below.

Code: Select all

import sys; print(sys.version)