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 / [SOLVED] Pasting the same sprite multiple times over a background that is rendering a 3D object?

Author
Message
JoeOh45240
7
Years of Service
User Offline
Joined: 14th Feb 2017
Location: USA
Posted: 19th Jan 2020 00:37
I can post the same sprite in multiple places on the screen if there is no 3D object being rendered in the background. But as soon I have a plane in the background the multiple sprites disappear and the last location where the sprite is position is showing. How do I get around this? Thanks

The author of this post has marked a post as an answer.

Go to answer

JoeOh45240
7
Years of Service
User Offline
Joined: 14th Feb 2017
Location: USA
Posted: 19th Jan 2020 01:12 Edited at: 19th Jan 2020 01:13
Here's what I mean in visual terms...

This pic shows the how the same sprite is drawn using the DrawSprite() function the way I'd like it to be over the 3D planet and backdrop shown in the second picture. I hope this makes my intentions clearer.


Attachments

Login to view attachments
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 19th Jan 2020 01:49
Could you post the code for this? It will help in trying to track down the problem
JoeOh45240
7
Years of Service
User Offline
Joined: 14th Feb 2017
Location: USA
Posted: 19th Jan 2020 01:52 Edited at: 19th Jan 2020 01:54
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 19th Jan 2020 02:05
Maybe try Set3DGlobalDepth(10) and move it so it executes before you create sprites or objects
JoeOh45240
7
Years of Service
User Offline
Joined: 14th Feb 2017
Location: USA
Posted: 19th Jan 2020 02:16
I did as you suggested.....no go. There must be some workaround where I don't have to create/clone the same-looking sprite...
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 19th Jan 2020 03:44
This post has been marked by the post author as the answer.
Unless someone else has a solution i would suggest using multiple sprites

I did get a kind of solution by changing sync() to


So you would need to put any logic that draws sprites in between the render3d() and the render2d commands
JoeOh45240
7
Years of Service
User Offline
Joined: 14th Feb 2017
Location: USA
Posted: 19th Jan 2020 03:56
Success! Thanks for the assist!



Attachments

Login to view attachments
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 19th Jan 2020 04:09 Edited at: 19th Jan 2020 04:11
i'm sure there's a better way, but: workaround?


er, that works
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 19th Jan 2020 19:25
Very nice. I think your way is much more manageable then mine

Login to post a reply

Server time is: 2024-04-20 04:10:27
Your offset time is: 2024-04-20 04:10:27