help with one sprite blacking out another sprite
help with one sprite blacking out another sprite
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
- airsoftsoftwair
- Posts: 5446
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: help with one sprite blacking out another sprite
I don't quite understand... what do you mean by "blacking out"?
-
- Posts: 475
- Joined: Fri May 15, 2015 5:15 pm
- Location: Waterville, Minnesota USA
Re: help with one sprite blacking out another sprite
I think the question involves sprite overlay priorities.
I'm on registered MorphOS using FlowStudio.
Re: help with one sprite blacking out another sprite
yes correct I don't want Sprite 1 to disappear when Sprite 2 goes over itSamuraiCrow wrote:I think the question involves sprite overlay priorities.
A1-X1000- I BELIEVE
Re: help with one sprite blacking out another sprite
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.
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
Hollywood 6.1
- airsoftsoftwair
- Posts: 5446
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: help with one sprite blacking out another sprite
@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:
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:
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.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
@airsoftsoftwair
@sesco
Sorry for derailing your tread.
That would be nice! Something like SetSpriteZPos(id, zpos)? If so a new attribute #ATTRZPOS to the object #SPRITE could become handy.airsoftsoftwair wrote:@fjudde:
I could add a function that allows you to change the z-order of sprites
@sesco
Sorry for derailing your tread.
_____________________________________
Hollywood 6.1
Hollywood 6.1
Re: help with one sprite blacking out another sprite
lol no problem at all as I'm just learning myself and appreciate nay help I can getfjudde wrote:@airsoftsoftwairThat would be nice! Something like SetSpriteZPos(id, zpos)? If so a new attribute #ATTRZPOS to the object #SPRITE could become handy.airsoftsoftwair wrote:@fjudde:
I could add a function that allows you to change the z-order of sprites
@sesco
Sorry for derailing your tread.
A1-X1000- I BELIEVE
Re: help with one sprite blacking out another sprite
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 itairsoftsoftwair 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:
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.yes correct I don't want Sprite 1 to disappear when Sprite 2 goes over it
A1-X1000- I BELIEVE
Re: help with one sprite blacking out another sprite
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"sesco wrote: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 itairsoftsoftwair 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:
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.yes correct I don't want Sprite 1 to disappear when Sprite 2 goes over 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