Search found 9 matches

by Insanifeeding
Tue Mar 21, 2023 8:40 am
Forum: Ren'Py Questions and Announcements
Topic: [Solved] How can I refresh screen elements on mousewheel scroll?
Replies: 4
Views: 405

Re: How can I refresh screen elements on mousewheel scroll?

Excellent! This is pretty much exactly how I pictured it in my head. I'm still new to Python, so enumerate() wasn't on my radar yet.

The mystery of how to refresh stuff while scrolling will have to wait for another day, but you have given me what I need to accomplish my goals. Thanks philat!
by Insanifeeding
Mon Mar 20, 2023 12:13 pm
Forum: Ren'Py Questions and Announcements
Topic: [Solved] How can I refresh screen elements on mousewheel scroll?
Replies: 4
Views: 405

Re: How can I refresh screen elements on mousewheel scroll?

I'll keep the default assignment timing in mind, thanks. As for tooltips vs. screens, they both work fine (though the screen takes less setup in my experience), but neither one's text location scrolls with the vpgrid. It's stuck at (x, y) where it was created until I move the mouse off of the image....
by Insanifeeding
Mon Mar 20, 2023 11:34 am
Forum: Ren'Py Questions and Announcements
Topic: [Solved] How can I refresh screen elements on mousewheel scroll?
Replies: 4
Views: 405

[Solved] How can I refresh screen elements on mousewheel scroll?

I'm using a scrollable vpgrid with many images representing different characters (in a character view screen). On mouse hover over one of the images, I show a screen with that character's name. When I scroll up or down, the name on the hovered screen doesn't scroll with the rest of the vpgrid. Is th...
by Insanifeeding
Mon Mar 20, 2023 11:17 am
Forum: Ren'Py Questions and Announcements
Topic: Help using dictionaries in Ren'Py and dealing with KeyError
Replies: 6
Views: 1133

Re: Help using dictionaries in Ren'Py and dealing with KeyError

Some of the best past advice I've gotten in design has been frame challenging. You want to use dictionaries, but this situation looks like it would be easier with classes. Would you consider changing your approach? Classes can make managing several objects with the same attributes but different valu...
by Insanifeeding
Thu Mar 09, 2023 6:00 pm
Forum: Ren'Py Questions and Announcements
Topic: [Solved] How can I get the X/Y coordinates of a button?
Replies: 6
Views: 777

Re: How can I get the X/Y coordinates of a button?

Interestingly enough, both methods work since they both return x/y/w/h tuples. My problem was trying to pass the value from the button to the screen it was calling instead of setting the value within the called screen. I'll just say that years of sequential and OOP really make adjusting to interpret...
by Insanifeeding
Thu Mar 09, 2023 4:19 pm
Forum: Ren'Py Questions and Announcements
Topic: [Solved] How can I get the X/Y coordinates of a button?
Replies: 6
Views: 777

Re: How can I get the X/Y coordinates of a button?

I keep forgetting that screens are evaluated before runtime. Ok, so how would I run focus_coordinates() after objects are created? I tried tying multiple actions to the hovered state: hovered [SetScreenVariable("coord", renpy.focus_coordinates()), Show("preview_screen", name = &q...
by Insanifeeding
Thu Mar 09, 2023 3:51 pm
Forum: Ren'Py Questions and Announcements
Topic: [Solved] How can I get the X/Y coordinates of a button?
Replies: 6
Views: 777

[Solved] How can I get the X/Y coordinates of a button?

I'm trying to display a screen on top of a button when I hover over the button. I know the size of the button, but its position will vary with other factors. I've tried using renpy.focus_coordinates() , but all I get is a tuple full of None . Here's what I've got so far: define xSize = 400 define yS...
by Insanifeeding
Thu Mar 09, 2023 1:18 pm
Forum: Ren'Py Questions and Announcements
Topic: [Solved] Class instance declarations only found by compiler if located in same .rpy file
Replies: 2
Views: 345

Re: Class instance declarations only found by compiler if located in same .rpy file

This helped fix my issue - thank you! Here's a working minimal project with multiple files: classes.rpy : init -3 python: class Worker: def __init__(self, character, name, unlocked = False): self.character = character self.name = name self.unlocked = unlocked # other attributes class WorkerManager: ...
by Insanifeeding
Thu Mar 09, 2023 10:08 am
Forum: Ren'Py Questions and Announcements
Topic: [Solved] Class instance declarations only found by compiler if located in same .rpy file
Replies: 2
Views: 345

[Solved] Class instance declarations only found by compiler if located in same .rpy file

I'm using the define statement to instantiate a few different characters of my Worker class. I'm then defining an instance of my WorkerManager class and passing a list of those Workers as keyword arguments ( **kwargs ), as shown in this simple project: init python: class Worker: def __init__(self, c...