Register    Login    Forum    Search    FAQ

Board index » Everything




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post Posted: October 19th, 2017, 9:27 pm 
 

Joined: October 19th, 2017, 9:11 pm
Posts: 3
Hi all,

This sounds ridiculous, I know, but my sprite from Intermediate 12 is displaying "dimmer" than it appears in the spritesheet. Have I missed something obvious? The white text is presented nice and bright.
I attach a grab showing the game window and the sprite-sheet for reference..(I set the spritesheet background to black for easier comparison in the screenshot, but it is saved as Magenta still in the file - honest).
Attachment:
dim_sprite.png
dim_sprite.png [ 19.12 KiB | Viewed 170 times ]

Thanks, Geoff


Top 
 Profile  
Reply with quote  
 Post Posted: October 20th, 2017, 1:44 am 
Site Admin
User avatar

Joined: December 31st, 2011, 4:53 pm
Posts: 3470
Location: Japan
Did you clone from the repo or write the code yourself? What does it look like when the sprite walks over the text?

_________________
Chili


Top 
 Profile  
Reply with quote  
 Post Posted: October 20th, 2017, 6:48 am 
 

Joined: October 19th, 2017, 9:11 pm
Posts: 3
Hi Chili, Thanks for responding, and well, for everything that led me here so far. I've enjoyed your videos very much, and watch them daily to speed up my commute to work.
Cloned directly from the repo with no change apart from required re-targeting to v141 for my VS2017 setup. I noticed it first of all when I tried my own sprite sheet where I was trying to create "Galaga" using your framework, then went back to just the original link spritesheet. I have re-tried this morning from a fresh clone of the repo, with the same result.
Grab attached showing the text in comparison to the sprite and the original sheet. I think you can still see that the sprite is dimmer in the game window. It's a strange one.
Attachment:
dim2.png
dim2.png [ 4.58 KiB | Viewed 151 times ]


Thanks again,
Geoff


Top 
 Profile  
Reply with quote  
 Post Posted: October 20th, 2017, 7:53 am 
Site Admin
User avatar

Joined: December 31st, 2011, 4:53 pm
Posts: 3470
Location: Japan
It's not a strange one bro. I suggest you follow the function calls and see what is actually being called, then report back here ;)

_________________
Chili


Top 
 Profile  
Reply with quote  
 Post Posted: October 20th, 2017, 10:06 am 
 

Joined: October 19th, 2017, 9:11 pm
Posts: 3
Ah-ha!! Ghost Effect! Phew. I thought I was going to have to plug in a CRT monitor to see if it made a difference for a moment there!

As Chili pointed out, if I had followed through all the function calls I would have seen that in the latest version, the call to Animation::Draw passes on a Ghost SpriteEffect to allow the text to be seen through the sprite...

void Animation::Draw( const Vei2& pos,Graphics& gfx ) const
{
gfx.DrawSprite( pos.x,pos.y,frames[iCurFrame],sprite,SpriteEffect::Ghost{ chroma } );
}

If I change this from Ghost{ chroma } to Chroma{ chroma }, then I get my desired result of a full brightness sprite, but with text that is hidden behind the sprite if they overlap.

I have learned a lesson to make sure that when I clone a repo, I must roll back to the correct place and branch-off from there, to avoid code that is newer than the tutorial I am working from.

Right, I'm off to prepare the next stupid question...
Thanks Chili!


Top 
 Profile  
Reply with quote  
 Post Posted: October 20th, 2017, 3:08 pm 
Site Admin
User avatar

Joined: December 31st, 2011, 4:53 pm
Posts: 3470
Location: Japan
Well, you beat me to what i was gonna say next.

But yeah, you can use the tags to see where the commits for each tutorial are, and create your branches accordingly ;)

_________________
Chili


Top 
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 6 posts ] 

Board index » Everything


 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for: