Search found 17 matches
- Tue Jan 17, 2023 3:30 pm
- Forum: Ren'Py Questions and Announcements
- Topic: Change the Y-scroll value of the viewport from python code
- Replies: 5
- Views: 421
Re: Change the Y-scroll value of the viewport from python code
Thank you all. Thanks to you I already found what I needed. init python: def OnUpdateViewportY(old_value): # For fresh data, it is necessary to find the widget and yadjustment each time. viewport_elem = renpy.get_widget("vp_screen", "vp_id") viewport_adjY = viewport_elem.yadjustm...
- Tue Jan 17, 2023 2:44 pm
- Forum: Ren'Py Questions and Announcements
- Topic: Change the Y-scroll value of the viewport from python code
- Replies: 5
- Views: 421
Re: Change the Y-scroll value of the viewport from python code
Oh, never mind.
In my case, my vp_screen was included as part of its parent screen by use command.
In my case, my vp_screen was included as part of its parent screen by use command.
- Tue Jan 17, 2023 2:33 pm
- Forum: Ren'Py Questions and Announcements
- Topic: Change the Y-scroll value of the viewport from python code
- Replies: 5
- Views: 421
Re: Change the Y-scroll value of the viewport from python code
This should help - https://lemmasoft.renai.us/forums/viewtopic.php?f=8&t=58638&sid=9d743c3d7748ab0783a69b391cae28ed#p527829 I tried to use the renpy.get_widget('vp_screen', 'vp_id') inside OnUpdateViewportY() , but I got the result as an empty object (no .yadjustment inside). init python: d...
- Tue Jan 17, 2023 7:29 am
- Forum: Ren'Py Questions and Announcements
- Topic: Change the Y-scroll value of the viewport from python code
- Replies: 5
- Views: 421
Change the Y-scroll value of the viewport from python code
I want to know how I can update the Y scroll position of the viewport. The thing is that in another part of the code I change the size of its internal elements in a special way. The problem is that the viewport's scrollbar retains its absolute position. Because of this, when I increase the size of i...
- Fri Dec 30, 2022 8:08 am
- Forum: Ren'Py Questions and Announcements
- Topic: Read the value of a variable from a save file.
- Replies: 8
- Views: 924
Re: Read the value of a variable from a save file.
You are replacing save in appdata and not backups in save folder in game folder, right? You're right, for some reason the files are not automatically synchronized. :o A small problem is that you need to replace the save file in both appdata and game/saves. If you replace the file in only one of the...
- Fri Dec 30, 2022 7:43 am
- Forum: Ren'Py Questions and Announcements
- Topic: Read the value of a variable from a save file.
- Replies: 8
- Views: 924
Re: Read the value of a variable from a save file.
The problem is that JSON data is written to a separate file, not to the *.save file itself. It is not. Is it written to the same compressed file as the pickled data, screenshot and save name. Tested, but, for example, after quitting the game and replacing the file 4-4-LT1.save, the JSON data when y...
- Fri Dec 30, 2022 7:40 am
- Forum: Ren'Py Questions and Announcements
- Topic: Read the value of a variable from a save file.
- Replies: 8
- Views: 924
Re: Read the value of a variable from a save file.
I wouldn't suggest overriding renpy's default functions. In my example, I don't change the body of the standard renpy function, I just make a monkey-patch for it, which just allows me to do the necessary actions before or after the function. Also, I only need the source code of the renpy.load funct...
- Fri Dec 30, 2022 7:29 am
- Forum: Ren'Py Questions and Announcements
- Topic: Read the value of a variable from a save file.
- Replies: 8
- Views: 924
Re: Read the value of a variable from a save file.
Unless you want to mess with binary data and pickle module, the easiest way is to simply write data you need to save extra inf, which is easily accessible. Link to the documentation: https://www.renpy.org/doc/html/config.html#var-config.save_json_callbacks The problem is that JSON data is written t...
- Fri Dec 30, 2022 4:21 am
- Forum: Ren'Py Questions and Announcements
- Topic: Read the value of a variable from a save file.
- Replies: 8
- Views: 924
Read the value of a variable from a save file.
Hello, everyone. I want to read the value of a variable from a save file before it is loaded. The problem is that I don't know how to get the data from the save file as a python object. This is what I have at the moment: renpy_load__monkeyFunc = renpy.load def new_renpy_load(filename): print "v...
- Wed Dec 21, 2022 8:31 pm
- Forum: Ren'Py Questions and Announcements
- Topic: Get the style parameter by style name.
- Replies: 2
- Views: 259
- Wed Dec 14, 2022 3:38 am
- Forum: Ren'Py Questions and Announcements
- Topic: Get the style parameter by style name.
- Replies: 2
- Views: 259
Get the style parameter by style name.
Hi, I have a style:
How can I get the "size" parameter value of this style in python code if I only know the name of the style?
Code: Select all
style my_button:
size 42
xoffset 18
- Sat Jun 18, 2022 5:28 am
- Forum: Ren'Py Questions and Announcements
- Topic: On hide transform not working with buttons.
- Replies: 4
- Views: 406
Re: On hide transform not working with buttons.
Are you trying this on a newer version? I have not yet been able to update Ren'Py for the sake of testing. I just have a lot of manual engine fixes. :? Can you try this example to be sure? transform show_hide_moves(diff_x=100): on show: xoffset diff_x linear .3 xoffset 0 on hide: xoffset 0 linear ....
- Fri Jun 17, 2022 2:15 pm
- Forum: Ren'Py Questions and Announcements
- Topic: On hide transform not working with buttons.
- Replies: 4
- Views: 406
Re: On hide transform not working with buttons.
Try it like - https://lemmasoft.renai.us/forums/viewtopic.php?f=8&t=64720#p552761 I have no problem with the menu opening animation. There is nothing wrong with it. I only have a problem with closing the menu (right-click or Return(). Tried your method, but it does not work fully. At best, it l...
- Fri Jun 17, 2022 11:46 am
- Forum: Ren'Py Questions and Announcements
- Topic: On hide transform not working with buttons.
- Replies: 4
- Views: 406
On hide transform not working with buttons.
Hi all. Today I encountered a problem that "on hide" transform stops working for screen menu elements that have at least one button or textbutton in them. This happens when I need to exit the menu with the right mouse button or with Return(). Has anyone encountered this problem before? Her...
- Tue Apr 05, 2022 5:18 am
- Forum: Ren'Py Questions and Announcements
- Topic: How to use the Screen Input not during the game?
- Replies: 2
- Views: 491
Re: How to use the Screen Input not during the game?
You are only showing the console screen, but you need to call it. Yep, you're right. Thank you, but I've already solved it through "renpy.show_screen" and executing the label with "renpy.call_in_new_context" for this. I don't think my version is the short and proper solution eit...