Page 1 of 2

help with one sprite blacking out another sprite

Posted: Thu Apr 28, 2016 11:02 pm
by sesco
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 :?:

Re: help with one sprite blacking out another sprite

Posted: Fri Apr 29, 2016 4:39 pm
by airsoftsoftwair
I don't quite understand... what do you mean by "blacking out"?

Re: help with one sprite blacking out another sprite

Posted: Fri Apr 29, 2016 5:46 pm
by SamuraiCrow
I think the question involves sprite overlay priorities.

Re: help with one sprite blacking out another sprite

Posted: Fri Apr 29, 2016 7:38 pm
by sesco
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

Re: help with one sprite blacking out another sprite

Posted: Fri Apr 29, 2016 9:50 pm
by fjudde
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.

Re: help with one sprite blacking out another sprite

Posted: Sat Apr 30, 2016 12:08 pm
by airsoftsoftwair
@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.

Re: help with one sprite blacking out another sprite

Posted: Sat Apr 30, 2016 5:37 pm
by fjudde
@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.

Re: help with one sprite blacking out another sprite

Posted: Sat Apr 30, 2016 5:39 pm
by sesco
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 :)

Re: help with one sprite blacking out another sprite

Posted: Sat Apr 30, 2016 5:43 pm
by sesco
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

Re: help with one sprite blacking out another sprite

Posted: Sun May 01, 2016 3:34 pm
by sesco
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