Search found 26 matches

by Doeny
Sat Oct 29, 2022 7:27 pm
Forum: Ren'Py Questions and Announcements
Topic: Detecting images on contact
Replies: 1
Views: 64

Detecting images on contact

Is there a way to check if an image touches other image and if possiple make it a function?
by Doeny
Sun Oct 09, 2022 9:21 am
Forum: Ren'Py Questions and Announcements
Topic: [Solved]How can I check if list contains an item?
Replies: 2
Views: 228

Re: How can I check if list contains an item?

#checks if item is in list: if item in list: pass else: pass # check if item not in list if item not in list: pass If item is an instance of your own class without defined comparison operators, you can run into identity vs equality problem, but for built-in types it should work fine. Yup, works fin...
by Doeny
Sat Oct 08, 2022 2:24 pm
Forum: Ren'Py Questions and Announcements
Topic: [Solved]How can I check if list contains an item?
Replies: 2
Views: 228

[Solved]How can I check if list contains an item?

So I made a code that removes an item from the list, but I have problem checking if it's still in. Any ideas how to fix it? This removes the item (works fine (i hope)) $ renpy.random.shuffle(list) $ list1 = lsit.pop() And this checks if item's not in the list: imagebutton: if list != "item_1": idle ...
by Doeny
Sat Oct 08, 2022 1:21 pm
Forum: Ren'Py Questions and Announcements
Topic: [Solved]Change viewport's background collor.
Replies: 2
Views: 209

Re: Change viewport's background collor.

You can use the background property for your frame. It takes a displayable, so you can use Solid to change the background color. https://www.renpy.org/doc/html/style_properties.html#style-property-background Here's an example: frame: background Solid("#000") I suppose the reason why your frame is w...
by Doeny
Sat Oct 08, 2022 12:47 pm
Forum: Ren'Py Questions and Announcements
Topic: [Solved]Change viewport's background collor.
Replies: 2
Views: 209

[Solved]Change viewport's background collor.

I tried making an scrollabre gallery, but after adding frame with viewport, the background area turned out to be white. Is there a way to change it's color?
by Doeny
Sat Oct 08, 2022 11:53 am
Forum: Ren'Py Questions and Announcements
Topic: [Solved]Scrollable gallery
Replies: 4
Views: 267

Re: Scrollable gallery

Could you please run it and test if it works for you? Apparently there are no function improvement on my side after correcting the code. Works for me: screen gallery(): frame: xpos 250 ypos 150 side ("c r"): area (1,0,1540,770) viewport id "gallery_viewport": draggable True mousewheel True vbox: te...
by Doeny
Fri Oct 07, 2022 12:57 am
Forum: Ren'Py Questions and Announcements
Topic: [Solved]Scrollable gallery
Replies: 4
Views: 267

Re: Scrollable gallery

It looks ok. I believe your images are less than the size of the viewport. You can add some empty elements to change the child_size of the viewport. You also should consider using vbox or grid to simplify adding elements in the viewport. screen gallery(): add "gallery_img" frame: xpos 250 ypos 150 ...
by Doeny
Thu Oct 06, 2022 6:49 pm
Forum: Ren'Py Questions and Announcements
Topic: [Solved]Scrollable gallery
Replies: 4
Views: 267

[Solved]Scrollable gallery

I wanted to create an inage gallery and make it scrollable to avoid creating pages. I've created an frame but can't get it to move. Any ideas how to fix it? screen gallery(): add "gallery_img" frame: xpos 250 ypos 150 side ("c r"): area (1,0,1540,770) viewport id "gallery_viewport": draggable True m...
by Doeny
Thu Oct 06, 2022 4:55 pm
Forum: Ren'Py Questions and Announcements
Topic: [Solved] Taking out random items from list?
Replies: 2
Views: 219

Re: Taking out random items from list?

# Do you want to pick up a random item and leave it in container? $ item = renpy.random.choice(container) # Do you want to pick random item and remove it? $ renpy.random.shuffle(container) # Once at the beginning # . . . $ item = container.pop() It works perfectly, thank you very much, Ocelot!
by Doeny
Thu Oct 06, 2022 5:45 am
Forum: Ren'Py Questions and Announcements
Topic: [Solved] Taking out random items from list?
Replies: 2
Views: 219

[Solved] Taking out random items from list?

I was thinking about creating a mini game about pulling out random items from a container. Let's say I have a list:

default container = [*stuff possible to pick up*]

What is the easiest way to write a code randomizing and then picking out single items from that list?
by Doeny
Tue Oct 04, 2022 5:25 am
Forum: Ren'Py Questions and Announcements
Topic: [Solved] Video positioning
Replies: 6
Views: 242

Re: Video positioning

enaielei wrote:
Tue Oct 04, 2022 12:12 am
If you'll see the "show" example in my code, there are no quotes there.
Can't believe I fell into that. It works perfectly, thanks!
by Doeny
Tue Oct 04, 2022 12:01 am
Forum: Ren'Py Questions and Announcements
Topic: [Solved] Video positioning
Replies: 6
Views: 242

Re: Video positioning

Maybe try avoiding using the "image" word itself in naming your image. You can also post here your full traceback. So here's that part of the code: label unit_1_deploy: $ unit_1_deployed = True if selected_tile == 1: $ tile_1 = True show "unit_chara" hide screen unit_list And the traceback: I'm sor...
by Doeny
Mon Oct 03, 2022 9:55 pm
Forum: Ren'Py Questions and Announcements
Topic: [Solved] Video positioning
Replies: 6
Views: 242

Re: Video positioning

Movie(fps=24, size=None, channel=u'movie', play=None, mask=None, mask_channel=None, image=None, play_callback=None, side_mask=False, loop=True, start_image=None, ** properties ) The properties parameter here is probably the one you're looking for. image my_image = Movie(..., align=(0.5, 0.5)) # pla...
by Doeny
Mon Oct 03, 2022 7:43 pm
Forum: Ren'Py Questions and Announcements
Topic: [Solved] Video positioning
Replies: 6
Views: 242

[Solved] Video positioning

I defined an .webm file as an image and resized it. Now I want to make it appear somewhere in the screen using "show image", but it seems "image my_image does not accept position attributes". Is there a way to do it without setting up a new scene?
by Doeny
Mon Oct 03, 2022 7:37 pm
Forum: Ren'Py Questions and Announcements
Topic: [Solved] Calling more than one screen
Replies: 2
Views: 232

Re: Calling more than one screen

In short, no. call screen some_screen in reality is just roughly: show screen some_screen(_transient=True) $ ui.interact() Transient screens (and everything on transient layer) are automatically hidden after any interaction. That includes running an action as a response to button press. Second scre...