Page 1 of 1

Cannot show animated image using screen?

Posted: Mon Dec 25, 2017 12:58 pm
by sparkleface
I have this:

Code: Select all

init -1:  
    image anim:
        "images/one.png"
        pause 0.2
        "images/two.png"
        pause 0.2
        "images/three.png"
        pause 0.2
        repeat 2
        
screen doit:
    add anim xpos 100

# The game starts here.

label start:
    show anim
    show doit
    "Hello"
    return
The result is what you see in the attached image.

The white arrow image is my animated image, and shows up if I use show anim directly. When show doit happens, the blank outline of Eileen shows up, but I wanted my animated image to show up at the specified position.

Can I not add in an animated image through a screen? Or is something wrong with how I set up my code?

Re: Cannot show animated image using screen?

Posted: Mon Dec 25, 2017 1:01 pm
by Ocelot
add "anim" xpos 100 IIRC, add expects image name as a string.

Re: Cannot show animated image using screen?

Posted: Mon Dec 25, 2017 1:05 pm
by sparkleface
I changed it to:

Code: Select all

screen doit:
    add "anim" xpos 100
But the result is still the same it seems!

Re: Cannot show animated image using screen?

Posted: Mon Dec 25, 2017 6:47 pm
by sparkleface
Okay, it's my bad. Sorry! I was missing the keyword show screen doit. Although it's kinda odd that Eileen just shows up if I didn't have the screen keyword, it kinda threw me off.

Re: Cannot show animated image using screen?

Posted: Mon Dec 25, 2017 8:47 pm
by mitoky
sparkleface wrote: Mon Dec 25, 2017 6:47 pm Okay, it's my bad. Sorry! I was missing the keyword show screen doit. Although it's kinda odd that Eileen just shows up if I didn't have the screen keyword, it kinda threw me off.
As far as i know, the Eileen image shows up when the image, which is shown, doenst exists or cant be found.