Search found 734 matches

by Milkymalk
Thu May 07, 2020 12:07 pm
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] Trying to make a scrolling menu within a screen
Replies: 29
Views: 1126

Re: Trying to make a scrolling menu within a screen

Very strange. This works for me, change the numbers and see if it works for you too: style my_button is button: # this will change all buttons in screens that have the style_prefix 'my' xalign 0.5 xsize 318 ysize 65 background "images/[prefix_]buttonlong.png" # auto-assigns idle_, hover_ a...
by Milkymalk
Thu May 07, 2020 11:34 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] Trying to make a scrolling menu within a screen
Replies: 29
Views: 1126

Re: Trying to make a scrolling menu within a screen

You have to give the button dimensions. By default it will be as small as possible and because the background is not a child like the text, the image will just spill out. Try giving it a width and height (might be xsize and ysize, however big you want the button to be) and also position the text wit...
by Milkymalk
Thu May 07, 2020 11:10 am
Forum: Ren'Py Questions and Announcements
Topic: Problem with if statements
Replies: 2
Views: 255

Re: Problem with if statements

Capitalization matters. "Drama" is not == "drama"
by Milkymalk
Thu May 07, 2020 10:19 am
Forum: Ren'Py Questions and Announcements
Topic: Music doesn't fadeout
Replies: 2
Views: 247

Re: Music doesn't fadeout

That solution will first fade out the old music, then fade in the new one. For a cross-fade, you can use a second channel: default active_music_channel = 'music' # stores which channel is playing and which not default inactive_music_channel = 'music2' init python: renpy.music.register_channel('music...
by Milkymalk
Thu May 07, 2020 9:04 am
Forum: Ren'Py Questions and Announcements
Topic: Invetory items quantity
Replies: 6
Views: 430

Re: Invetory items quantity

Somehow I never expect predefined classes to have methods that go beyond any basic functionality, but this is python after all ... :D
by Milkymalk
Thu May 07, 2020 7:35 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] Trying to make a scrolling menu within a screen
Replies: 29
Views: 1126

Re: Trying to make a scrolling menu within a screen

You can use idle_background, hover_background etc. in a button to set those images.
by Milkymalk
Thu May 07, 2020 6:08 am
Forum: Ren'Py Questions and Announcements
Topic: Invetory items quantity
Replies: 6
Views: 430

Re: Invetory items quantity

That's easy to do. Just run a loop that counts the occurrences of "pizza":

Code: Select all

init python:
    def count(what):
        c = 0
        for i in inventory:
            if i == what:
                c += 1
        return c
by Milkymalk
Thu May 07, 2020 4:28 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] Trying to make a scrolling menu within a screen
Replies: 29
Views: 1126

Re: Trying to make a scrolling menu within a screen

You can use button instead of imagebutton and layer images and text inside it: button: add "button.png" text "Click Me" action MyAction() # other button stuff But then you can't use idle, hover etc. It IS possible to use an image and text as we see in the choice screens, but that...
by Milkymalk
Thu May 07, 2020 3:46 am
Forum: Ren'Py Questions and Announcements
Topic: Call a function in RenPy
Replies: 6
Views: 352

Re: Call a function in RenPy

It is important that you understand why this is so: The normal script you use with labels and dialogue lines is not Python, it is Ren'Py script. Functions and most programming is Python only, except for a few things that also work in Ren'Py script because they were implemented, like "if"-c...
by Milkymalk
Thu May 07, 2020 3:14 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED] Trying to make a scrolling menu within a screen
Replies: 29
Views: 1126

Re: Trying to make a scrolling menu within a screen

viewport id "nicomenu": scrollbars "vertical" mousewheel True arrowkeys True vbox: imagebutton idle "button1.png" action MyAction() imagebutton idle "button2.png" action MyAction() imagebutton idle "button3.png" action MyAction() # and so on Changin...
by Milkymalk
Thu May 07, 2020 3:04 am
Forum: Ren'Py Questions and Announcements
Topic: Invetory items quantity
Replies: 6
Views: 430

Re: Invetory items quantity

You could use a [name, number] list to store your inventory items. Then you would access the name by that_item[0] and the number by that_item[1]. Alternatively, make a class: init python: class Item: def __init__(self, name, number): self.name = name self.number = number Then do default inventory = ...
by Milkymalk
Wed May 06, 2020 7:28 am
Forum: Ren'Py Questions and Announcements
Topic: Image title
Replies: 4
Views: 233

Re: Image title

Code: Select all

vbox:
    add "image.png"
by Milkymalk
Wed May 06, 2020 7:06 am
Forum: Ren'Py Questions and Announcements
Topic: Image title
Replies: 4
Views: 233

Re: Image title

This is the main menu code in screens.rpy: ## Main Menu screen ############################################################ ## ## Used to display the main menu when Ren'Py starts. ## ## https://www.renpy.org/doc/html/screen_special.html#main-menu screen main_menu(): ## This ensures that any other me...
by Milkymalk
Wed May 06, 2020 3:20 am
Forum: Ren'Py Questions and Announcements
Topic: Sprite Position Issue [SOLVED]
Replies: 10
Views: 869

Re: Sprite Position Issue

I downloaded it and tried around for a bit. I'm not entirely sure why, but using a script transform solves the problem for me :) transform fire_left: pos (.25, 1.0) anchor (.5, 1.0) transform fire_right: pos (.605, 1.0) anchor (.5, 1.0) # and so on instead of define fire_left = Position(xpos=0.25, y...