My image in a composite keeps glitching/disappearing?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
zeroTheHero
Regular
Posts: 64
Joined: Mon May 07, 2018 10:49 am
Contact:

My image in a composite keeps glitching/disappearing?

#1 Post by zeroTheHero » Wed Jan 30, 2019 4:13 am

My code:

Code: Select all

image telephone:
    "telephone.png"

image ring:
    "ring.png" with Fade(0.5, 1, 0.5)
    3.00
    repeat

image ring2:
    "ding.png" with Fade(1.5, 1, 0.5)
    3.00
    repeat
image ring3:
    "ding.png" with Fade(1, 2, 0.5)
    4.00
    repeat
image telephone composite = Composite(
    (259, 224),
    (0,0), "telephone",
    (10,75), "ring",
    (200, 25), "ring2",
    (200, 75), "ring3")
Image ring is just an image of text "Ring" (I need it this way).
Whenever I run this code some wierd glitch happens with image telephone, it crops, disappears, reappears cropped, fully appears, then disappears, and this repeats (in a different order). What's wrong here? Help appreciated!

zeroTheHero
Regular
Posts: 64
Joined: Mon May 07, 2018 10:49 am
Contact:

Re: My image in a composite keeps glitching/disappearing?

#2 Post by zeroTheHero » Thu Jan 31, 2019 2:07 am

umm help? Still doesn't work...

User avatar
trooper6
Lemma-Class Veteran
Posts: 3645
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: My image in a composite keeps glitching/disappearing?

#3 Post by trooper6 » Thu Jan 31, 2019 12:00 pm

I think the problem is that you have an image called
image telephone
and
image telephone composite.

Let's say you declare three images:
image mary normal
image mary happy
image mary sad

All three images have mary image tags. Only one mary can be onscreen at once.
So this is useful so you can define a character and give them the image tag mary, like this:
define m = Character("Mary", who_color="#c8ffc8", image="mary")

So then you can code like this:

Code: Select all

label start:
    show mary normal at left
    m "Hello!"
    m sad "Now, I'm sad."
    m happy "Now I'm happy."
    hide mary
This will show mary normal and then replace mary normal with mary sad and then mary happy...because there can only be one mary on screen at one time.

So...you need to rename one of your telephone images. I'd recommend telephone composite be renamed to something like
image comptelephone or something like that.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

zeroTheHero
Regular
Posts: 64
Joined: Mon May 07, 2018 10:49 am
Contact:

Re: My image in a composite keeps glitching/disappearing?

#4 Post by zeroTheHero » Thu Jan 31, 2019 12:50 pm

trooper6 wrote:
Thu Jan 31, 2019 12:00 pm
I think the problem is that you have an image called
image telephone
and
image telephone composite.

Let's say you declare three images:
image mary normal
image mary happy
image mary sad

All three images have mary image tags. Only one mary can be onscreen at once.
So this is useful so you can define a character and give them the image tag mary, like this:
define m = Character("Mary", who_color="#c8ffc8", image="mary")

So then you can code like this:

Code: Select all

label start:
    show mary normal at left
    m "Hello!"
    m sad "Now, I'm sad."
    m happy "Now I'm happy."
    hide mary
This will show mary normal and then replace mary normal with mary sad and then mary happy...because there can only be one mary on screen at one time.

So...you need to rename one of your telephone images. I'd recommend telephone composite be renamed to something like
image comptelephone or something like that.
Hmm well I thought of this too and renamed image telephone composite to image main composite, it's still happening. I think it's because of the 'ring' image, the telephone disappears and reappears in tune with the first ring. But no matter how many times I've checked, there's nothing wrong with that image! It's a 56 X 35 pixels transparent image (on the 259 X 224 telephone image). I wish I at least knew the problem so I could google it -_-'

Thanks for the reply though, hope I can get this working

User avatar
trooper6
Lemma-Class Veteran
Posts: 3645
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: My image in a composite keeps glitching/disappearing?

#5 Post by trooper6 » Thu Jan 31, 2019 10:19 pm

I don't think main composite is a good name for that image.
Try giving is a one word name...that is also not main...which I think is a reserved term.

All that said, looking at your ATL code...

Code: Select all

image ring:
    "ring.png" with Fade(0.5, 1, 0.5)
    3.00
    repeat
what is the 3.00 doing there? is that supposed to be "pause 3.0"?

The 3.0 by itself doesn't mean anything.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

zeroTheHero
Regular
Posts: 64
Joined: Mon May 07, 2018 10:49 am
Contact:

Re: My image in a composite keeps glitching/disappearing?

#6 Post by zeroTheHero » Thu Jan 31, 2019 11:45 pm

trooper6 wrote:
Thu Jan 31, 2019 10:19 pm
I don't think main composite is a good name for that image.
Try giving is a one word name...that is also not main...which I think is a reserved term.

All that said, looking at your ATL code...

Code: Select all

image ring:
    "ring.png" with Fade(0.5, 1, 0.5)
    3.00
    repeat
what is the 3.00 doing there? is that supposed to be "pause 3.0"?

The 3.0 by itself doesn't mean anything.
The 3.0 works the same as saying pause 3.0, I don't think it's wrong because it works like I want it to (I can see).

Edit: I found the problem! So I tried to put the composite on an image with white background and it seems the 56 X 35 image 'ring' comes with a square black box around it. It looks to be the same size as image telephone. When all three rings are together my image disappears, and when it's either one or two it hides the image in that weird way.
I should've done this sooner, but here are some screenshots
Image
Image
Image
Image
Image
Image

What should I do?

Post Reply

Who is online

Users browsing this forum: No registered users