Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / I use cSprite.SetDepth(13), but it seems no any effect.

Author
Message
halley
12
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 26th Sep 2011 12:42
SetDepth didn't make any effect. why?

give my best
ElijahNomad
12
Years of Service
User Offline
Joined: 19th Sep 2011
Location:
Posted: 27th Sep 2011 00:37
Are you talking about the SetSpriteDepth method ? If so always remember that your dealing with the Z-Order of sprites being drawn to the screen. Hope this helps.
Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 27th Sep 2011 01:00
Quote: "SetDepth didn't make any effect. why?
"

Could you provide a bit more info please? You haven't really given us anything to go on.

halley
12
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 27th Sep 2011 05:12
cSprite m_pSky;
m_pSky.SetDepth(10);

my code is like this. and I didn't use SetSpriteDepth(), but a member function .SetDepth().

give my best
Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 27th Sep 2011 08:47
So does m_pSky.SetDepth(10); do the same thing as agk::SetSpriteDepth(), well is it supposed to? I'm going to assume it does for now.

So are you testing it against other sprites because the SetSpriteDepth command controlls the draw order of sprites?

halley
12
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 27th Sep 2011 09:04
I use the .draw function myself. is it the reason that .SetDepth don't make any effect?
If I don't use .draw by myself . which function should I use to show the sprite?

give my best
Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 27th Sep 2011 10:56
Quote: "I use the .draw function myself. is it the reason that .SetDepth don't make any effect?"

I don't know. I'm not familiar with the cSprite members. What you could try is programming it using the normal commands and then translating it to the cSprite members.

Quote: "If I don't use .draw by myself . which function should I use to show the sprite?"

When using the normal commands the sprites are automatically visible and so there isn't a command you need to call each loop to draw the sprites. If you create a sprite but don't use the .draw command is it still drawn each loop? Maybe you only need to call it once?

Actually I think the best thing to do would be to write a working demo using the normal commands and then try to replicate that using the cSprite class. You then atleast have something to compare it to. Sorry I can't be of more help.

halley
12
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 27th Sep 2011 11:00
To Hodgey,Thank u very much.
Now I wrap a class named CSprite with the normal commands.

give my best

Login to post a reply

Server time is: 2024-03-28 09:11:02
Your offset time is: 2024-03-28 09:11:02