Page 1 of 1

[Solved] Image not appearing

Posted: Tue Apr 04, 2017 7:21 pm
by dyaoka
I'm editing the main menu screen and I'd like to have a little transparent pie fly across the screen, but I can't seem to get the floater image to actually appear over the animated background. This is what I'm trying, but...well, it's not working. Advice anyone?

Code: Select all

image floater:
    "gui/overlay/test/floater.png"
    xalign 0.0
    linear 60.0 xpos -1.0
    repeat
    
show floater

image main_menu:
    "gui/overlay/test/main_menu_overlay1.png"
    pause 0.5
    "gui/overlay/test/main_menu_overlay2.png"
    pause 0.3
    repeat

Re: Image not appearing

Posted: Wed Apr 05, 2017 12:29 am
by indoneko
First of all, when you copy paste your code in forum, please use

Code: Select all

 tag instead of [quote] tag.

As for adding a floating image, where exactly do you want to put it on the main menu screen? You might want to attach a mock-up version of your main menu here.
Basically, you could try finding this line in main menu screen :

[c]add gui.main_menu_background[/c]

and simply add this line below it :

[c]add floater[/c]

This is assuming that you've correctly defined the image somewhere else in the script.

Re: Image not appearing

Posted: Wed Apr 05, 2017 2:16 am
by dyaoka
Thank you for taking the time out to help! I did as you suggested! In my gui, I have the image defined like so:

Code: Select all

define floater = "gui/overlay/test/floater.png"
And using add, I got the image to appear! But attempts at trying to make it go across the screen leads me to errors.

I want the pie to fly across the screen in a loop. I'm trying to roughly do something like this, I hope the image makes sense:

Image

Re: Image not appearing

Posted: Wed Apr 05, 2017 3:19 am
by indoneko
What kind of looping movement do you want?
Moving from right to left and then left to right (without exiting the screen) ?
Or moving from right side of the screen to the left side until it's disappeared, and then repeat it?

Can you attach your script here? I'd like to see how you code your main menu screen.

Edit:
When I said about defining an image, actually I meant a displayable.
A displayable can use ATL transform to animate an image.

Re: Image not appearing

Posted: Wed Apr 05, 2017 3:04 pm
by dyaoka
I am trying to get the pie to go from the right side of the screen to the left and once it exits the screen on the left, it appears again on the right to go through the same action. Kind of like a cloud?

Sorry, I'm still super new to renpy. I thought that defining a displayable was simply like so? Which I do have in the code for my main menu screen, but the floater refuses to appear. I think it might be hiding behind my background, but I've no idea how to pull it up to the foreground or to even confirm that it really is appearing.

Is this not how you define a displayable? I read the documentation and it made it sound like this is, unless I've misinterpreted.

Code: Select all

image floater:
    xalign 0.0
    linear 60.0 xpos -1.0
    repeat
Here is the code for my main menu screen:

Code: Select all

## Main Menu screen ############################################################
##
## Used to display the main menu when Ren'Py starts.
##
## http://www.renpy.org/doc/html/screen_special.html#main-menu

screen main_menu():

    tag menu

    # The background of the main menu.
    window:
        xpadding 0
        ypadding 0


    style_prefix "main_menu"

    add gui.main_menu_background

    ## This empty frame darkens the main menu.
    frame:
        pass

    ## The use statement includes another screen inside this one. The actual
    ## contents of the main menu are in the navigation screen.
    use ani_navigation

    if gui.show_name:

        vbox:
            text "[config.name!t]":
                style "main_menu_title"

            text "[config.version]":
                style "main_menu_version"


style main_menu_frame is empty
style main_menu_vbox is vbox
style main_menu_text is gui_text
style main_menu_title is main_menu_text
style main_menu_version is main_menu_text

style main_menu_frame:
    xsize 280
    yfill True

    ##background "gui/overlay/main_menu.png"

style main_menu_vbox:
    xalign 1.0
    xoffset -20
    xmaximum 800
    yalign 1.0
    yoffset -20

style main_menu_text:
    xalign 1.0

    layout "subtitle"
    text_align 1.0
    color gui.accent_color

style main_menu_title:
    size gui.title_text_size
    
image floater:
    xalign 0.0
    linear 60.0 xpos -1.0
    repeat

image main_menu:
    "gui/overlay/test/main_menu_overlay1.png"
    pause 0.35
    "gui/overlay/test/main_menu_overlay2.png"
    pause 0.2
    repeat
Sorry for being a noob and thanks for your patience!

Re: Image not appearing

Posted: Wed Apr 05, 2017 8:05 pm
by indoneko
Which background image are you going to use? and Which one is the pie image?
Assuming that you have set the main menu background image in gui.rpy and the main_menu image here is actually the pie that you are planning to animate, then you simply add the pie animation after the background image :

Code: Select all

    
 ## Main Menu screen ############################################################
##
## Used to display the main menu when Ren'Py starts.
##
## http://www.renpy.org/doc/html/screen_special.html#main-menu

screen main_menu():

    tag menu

    window:
        xpadding 0
        ypadding 0

    style_prefix "main_menu"

    add gui.main_menu_background  # ---> I assume that you've set it's value in gui.rpy
    add "floater"  # ---> the floating pie for your main menu

    This empty frame darkens the main menu.
    frame:
        pass

    The use statement includes another screen inside this one. The actual
    contents of the main menu are in the navigation screen.
    use ani_navigation

    if gui.show_name:

        vbox:
            text "[config.name!t]":
                style "main_menu_title"

            text "[config.version]":
                style "main_menu_version"


style main_menu_frame is empty
style main_menu_vbox is vbox
style main_menu_text is gui_text
style main_menu_title is main_menu_text
style main_menu_version is main_menu_text

style main_menu_frame:
    xsize 280
    yfill True

    background "gui/overlay/main_menu.png"

style main_menu_vbox:
    xalign 1.0
    xoffset -20
    xmaximum 800
    yalign 1.0
    yoffset -20

style main_menu_text:
    xalign 1.0

    layout "subtitle"
    text_align 1.0
    color gui.accent_color

style main_menu_title:
    size gui.title_text_size
   
image floater:     # Pie animation
    "main menu"    # ---> don't forget to insert the pie displayable here    
    xalign 1.0       # ---> the image is aligned to the right at the beginning
    linear 60.0 xpos -1.0
    repeat

image main_menu:   # ---> I assume that this is the pie displayable
    "gui/overlay/test/main_menu_overlay1.png"
    pause 0.35
    "gui/overlay/test/main_menu_overlay2.png"
    pause 0.2
    repeat   

Re: Image not appearing

Posted: Wed Apr 05, 2017 8:29 pm
by dyaoka
Oh my gosh, thank you so much for the help! It worked!!! :D My pie flies across the screen! I'm going to mark this as solved, again, thank you so much, you are the best!