Search found 17 matches

by PasswordIsntHunter2
Fri Sep 14, 2018 4:28 pm
Forum: Ren'Py Questions and Announcements
Topic: custom Displayable: how to add children in Screen language
Replies: 1
Views: 151

custom Displayable: how to add children in Screen language

I've read the example here on how to make a creator-defined Displayable. The example gives the Displayable an image child passed in as an argument: screen alpha_magic: add Appearing("logo.png", 100, 200): xalign 0.5 yalign 0.5 label start: show screen alpha_magic "Can you find the logo?" return How ...
by PasswordIsntHunter2
Tue Mar 27, 2018 4:01 am
Forum: Ren'Py Questions and Announcements
Topic: setting a var from a key event stops working if I modify it
Replies: 2
Views: 247

setting a var from a key event stops working if I modify it

I'm using the mousewheel to set a variable in a Screen. Here's a script.rpy that replicates the effect: init python: var = 10 screen test: key "mousedown_4" action SetVariable("var", var+1) key "mousedown_5" action SetVariable("var", var-1) text str(var) label start: call screen test return var star...
by PasswordIsntHunter2
Sat Jan 27, 2018 10:23 pm
Forum: Ren'Py Questions and Announcements
Topic: More issues with rotating/cropping in a Screen - setting a variable resets it (?!)
Replies: 0
Views: 372

More issues with rotating/cropping in a Screen - setting a variable resets it (?!)

This is a test script.rpy that demonstrates the problem (should run fine in a new project): transform turn(angle): rotate angle transform crop(): crop (0, 0, 200, 300) screen foo(angle): default hovered = False add At("gui/window_icon.png", turn(angle), crop) textbutton "Button": action Return(0) ho...
by PasswordIsntHunter2
Fri Jan 26, 2018 8:04 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] Cropping an image after rotating it in a Screen
Replies: 4
Views: 461

Re: Cropping an image after rotating it in a Screen

Blargh. I think I figured it out. It won't work if I define the filename of the image in a variable! This is my script.rpy: init python: img = "gui/window_icon.png" transform t1: xpos 200 transform t2: ypos 200 screen test1(): add "gui/window_icon.png" at t1, t2 screen test2(): add img at t1, t2 scr...
by PasswordIsntHunter2
Fri Jan 26, 2018 4:06 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] Cropping an image after rotating it in a Screen
Replies: 4
Views: 461

[SOLVED] Cropping an image after rotating it in a Screen

I found This old thread which describes exactly what I want to do - chaining two transforms using the syntax "show image at transform1, transform2". This does not work using the "add" statement in a screen. Only the last transform (after the comma) will be applied. What can I do to achieve this exac...
by PasswordIsntHunter2
Thu Jan 18, 2018 4:50 pm
Forum: Ren'Py Questions and Announcements
Topic: how to make Button respond to its image child?
Replies: 3
Views: 338

Re: how to make Button respond to its image child?

Using focus_mask as my image means the only sensitive part of the button is the image. Making a custom focus_mask image with a box where the text would be is not possible, since the text can be of arbitrary length. Setting the focus_mask to True or None also does not seem to work (the image portion ...
by PasswordIsntHunter2
Thu Jan 18, 2018 9:33 am
Forum: Ren'Py Questions and Announcements
Topic: how to make Button respond to its image child?
Replies: 3
Views: 338

how to make Button respond to its image child?

I have a Button (the screen language Button which takes multiple children), with a Text and an Image (using "add") inside it. If I hover over the text, the Button's "hovered" action is run, and if I click on the text, the "action" is run. But if I hover over the image or click on the image, it's com...
by PasswordIsntHunter2
Wed Jan 17, 2018 2:05 am
Forum: Ren'Py Questions and Announcements
Topic: [BUG] Resampling images darkens colors on partially-transparent areas
Replies: 2
Views: 329

Re: [BUG] Resampling images darkens colors on partially-transparent areas

That's not the issue. I've seen this before in other engines. (also I packaged the game up, and had to custom-make the checkerboard grid since it isn't included in a build, and it still occurs) The images aren't being made partially transparent - the image on the right, which isn't resampled, displa...
by PasswordIsntHunter2
Tue Jan 16, 2018 11:33 pm
Forum: Ren'Py Questions and Announcements
Topic: [BUG] Resampling images darkens colors on partially-transparent areas
Replies: 2
Views: 329

[BUG] Resampling images darkens colors on partially-transparent areas

Whenever I use Scale or FactorScale on an image (with the default bilinear=True), the resampling algorithm darkens some areas of the image because it's not taking transparency into account correctly when averaging. Using Nearest Neighbor sampling does not have this issue but of course Nearest Neighb...
by PasswordIsntHunter2
Thu Jan 11, 2018 8:15 pm
Forum: Ren'Py Questions and Announcements
Topic: [Solved?] How do I run ren'py script inside a user-defined statement?
Replies: 10
Views: 1269

Re: How do I run ren'py script inside a user-defined statement?

I might have gotten it working-ish - sorry for the bump, but I'm not sure if I'm doing it exactly right. For loading/rollback (which are the same thing since a save is just the serialized log object) to work, you need Rollback objects in the log marked as checkpoints corresponding to each statement ...
by PasswordIsntHunter2
Tue Jan 09, 2018 8:11 pm
Forum: Ren'Py Questions and Announcements
Topic: [Solved?] How do I run ren'py script inside a user-defined statement?
Replies: 10
Views: 1269

Re: How do I run ren'py script inside a user-defined statement?

Yes, if I do this, it goes back to where it was at the end: def execute_test(o): old_next = renpy.game.context().next_node for stmt in o[1]: stmt.execute() renpy.game.context().next_node = old_next ...but it still has a problem with saving/loading while inside the test: block, and probably some othe...
by PasswordIsntHunter2
Tue Jan 09, 2018 9:27 am
Forum: Ren'Py Questions and Announcements
Topic: [Solved?] How do I run ren'py script inside a user-defined statement?
Replies: 10
Views: 1269

Re: How do I run ren'py script inside a user-defined statement?

Hmm, no progress so far - renpy.invoke_in_new_context() throws an error " 'NoneType' object is not callable" - I guess the invoke function would be trying to call what was returned from execute(), and execute() doesn't return anything? I might look through invoke_in_new_context() to see what it's tr...
by PasswordIsntHunter2
Tue Jan 09, 2018 2:31 am
Forum: Ren'Py Questions and Announcements
Topic: [Solved?] How do I run ren'py script inside a user-defined statement?
Replies: 10
Views: 1269

Re: How do I run ren'py script inside a user-defined statement?

I don't think your event handler is relevant to what I want to do. I see a lot of stuff about registering events which are toggled on and off? But I don't think it runs ren'py code inside a block at any point. The stuff at line 1770ish almost looks like it's parsing Python code or some custom syntax...
by PasswordIsntHunter2
Mon Jan 08, 2018 3:14 pm
Forum: Ren'Py Questions and Announcements
Topic: [Solved?] How do I run ren'py script inside a user-defined statement?
Replies: 10
Views: 1269

Re: How do I run ren'py script inside a user-defined statement?

Thanks for the filename help, I'll do that. The string isn't a ren'py label - I called it a "label" because I'm not sure what else I'd call it, but it's just a string (or list of strings and an integer and maybe some other stuff which I want my lexer to parse), which is the parent of a block of ren'...