help with one sprite blacking out another sprite

Find quick help here to get you started with Hollywood
sesco
Posts: 36
Joined: Tue Oct 18, 2011 6:40 am
Location: Toronto, Canada

help with one sprite blacking out another sprite

Post by sesco » Thu Apr 28, 2016 11:02 pm

ok so far enjoying playing with sprites with Hollywood and noticed that when Sprite1 overlaps Sprite 2 it black out Sprite2 so my question is how to keep Sprite 2 always visible on screen when Sprite 1 overlaps it :?:
A1-X1000- I BELIEVE

User avatar
airsoftsoftwair
Posts: 3159
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: help with one sprite blacking out another sprite

Post by airsoftsoftwair » Fri Apr 29, 2016 4:39 pm

I don't quite understand... what do you mean by "blacking out"?

SamuraiCrow
Posts: 237
Joined: Fri May 15, 2015 5:15 pm
Location: Ft. Collins, Colorado USA

Re: help with one sprite blacking out another sprite

Post by SamuraiCrow » Fri Apr 29, 2016 5:46 pm

I think the question involves sprite overlay priorities.

sesco
Posts: 36
Joined: Tue Oct 18, 2011 6:40 am
Location: Toronto, Canada

Re: help with one sprite blacking out another sprite

Post by sesco » Fri Apr 29, 2016 7:38 pm

SamuraiCrow wrote:I think the question involves sprite overlay priorities.
yes correct I don't want Sprite 1 to disappear when Sprite 2 goes over it
A1-X1000- I BELIEVE

User avatar
fjudde
Posts: 20
Joined: Tue Dec 01, 2015 2:59 pm
Location: Stockholm, Sweden

Re: help with one sprite blacking out another sprite

Post by fjudde » Fri Apr 29, 2016 9:50 pm

I had the same problem so I am curious about the correct answer.

I “Solved” it by making sure I displayed the sprites in correct order, bottom sprite first and top sprite last. And when I needed to move a sprite up to the top I removed (RemoveSprite()) that sprite and redisplayed (DisplaySprite()) it thus forcing it to the top.
If you can’t display the sprites in the order to make them correctly overlap each other, because the bottom sprite should not be visible yet. Maybe (have not tried this myself) you can “park” the bottom sprite outside the visible area of the screen? By setting X = -1000 and Y = -1000 of the sprite and when it’s time for appearance move it in to the right position with a DisplaySprite()?

I kind of miss some sort of functions to move a sprite to top or bottom.
_____________________________________
Hollywood 6.1

User avatar
airsoftsoftwair
Posts: 3159
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: help with one sprite blacking out another sprite

Post by airsoftsoftwair » Sat Apr 30, 2016 12:08 pm

@fjudde:
I could add a function that allows you to change the z-order of sprites but I'm not sure if this is really related to sesco's problem. He says:
yes correct I don't want Sprite 1 to disappear when Sprite 2 goes over it
Sprite 1 doesn't disappear when sprite 2 goes over it. Sprite 2 is just drawn over sprite 1 so the latter will only disappear if the non-transparent areas of sprite 2 black out sprite 1. If I added a function to change the sprite z-order, then it would be just the other way round, i.e. sprite 1 blacking out sprite 2. I'm not sure if this is what sesco wants.

User avatar
fjudde
Posts: 20
Joined: Tue Dec 01, 2015 2:59 pm
Location: Stockholm, Sweden

Re: help with one sprite blacking out another sprite

Post by fjudde » Sat Apr 30, 2016 5:37 pm

@airsoftsoftwair
airsoftsoftwair wrote:@fjudde:
I could add a function that allows you to change the z-order of sprites
That would be nice! Something like SetSpriteZPos(id, zpos)? If so a new attribute #ATTRZPOS to the object #SPRITE could become handy.

@sesco
Sorry for derailing your tread.
_____________________________________
Hollywood 6.1

sesco
Posts: 36
Joined: Tue Oct 18, 2011 6:40 am
Location: Toronto, Canada

Re: help with one sprite blacking out another sprite

Post by sesco » Sat Apr 30, 2016 5:39 pm

fjudde wrote:@airsoftsoftwair
airsoftsoftwair wrote:@fjudde:
I could add a function that allows you to change the z-order of sprites
That would be nice! Something like SetSpriteZPos(id, zpos)? If so a new attribute #ATTRZPOS to the object #SPRITE could become handy.

@sesco
Sorry for derailing your tread.
lol no problem at all as I'm just learning myself and appreciate nay help I can get :)
A1-X1000- I BELIEVE

sesco
Posts: 36
Joined: Tue Oct 18, 2011 6:40 am
Location: Toronto, Canada

Re: help with one sprite blacking out another sprite

Post by sesco » Sat Apr 30, 2016 5:43 pm

airsoftsoftwair wrote:@fjudde:
I could add a function that allows you to change the z-order of sprites but I'm not sure if this is really related to sesco's problem. He says:
yes correct I don't want Sprite 1 to disappear when Sprite 2 goes over it
Sprite 1 doesn't disappear when sprite 2 goes over it. Sprite 2 is just drawn over sprite 1 so the latter will only disappear if the non-transparent areas of sprite 2 black out sprite 1. If I added a function to change the sprite z-order, then it would be just the other way round, i.e. sprite 1 blacking out sprite 2. I'm not sure if this is what sesco wants.
hmm so perhaps its the transparency issue I should look into?? anyhow a 2x2 sprite should totally blackout a 2x2 sprite when it goes over/near it
A1-X1000- I BELIEVE

sesco
Posts: 36
Joined: Tue Oct 18, 2011 6:40 am
Location: Toronto, Canada

Re: help with one sprite blacking out another sprite

Post by sesco » Sun May 01, 2016 3:34 pm

sesco wrote:
airsoftsoftwair wrote:@fjudde:
I could add a function that allows you to change the z-order of sprites but I'm not sure if this is really related to sesco's problem. He says:
yes correct I don't want Sprite 1 to disappear when Sprite 2 goes over it
Sprite 1 doesn't disappear when sprite 2 goes over it. Sprite 2 is just drawn over sprite 1 so the latter will only disappear if the non-transparent areas of sprite 2 black out sprite 1. If I added a function to change the sprite z-order, then it would be just the other way round, i.e. sprite 1 blacking out sprite 2. I'm not sure if this is what sesco wants.
hmm so perhaps its the transparency issue I should look into?? anyhow a 2x2 sprite should totally blackout a 2x2 sprite when it goes over/near it
strange there's no option to edit a previous post :?: anyhow just wanted to correct my last sentence which should read " a 2x2 sprite should not totally blackout a 10x10 sprite when it goes over/near it"
when it comes to sprite order determining sprite display priority this doesn't work when you have sprites moving around the screen
A1-X1000- I BELIEVE

Post Reply