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.

DarkBASIC Professional Discussion / Sprite smearing (DEMO ATTACHED)

Author
Message
kordman916
18
Years of Service
User Offline
Joined: 5th Oct 2007
Location:
Posted: 9th Jan 2014 02:59 Edited at: 9th Jan 2014 04:09
So I was working on a pretty basic menu using sprites and I've created a function that deletes all existing media so that I can change that gamestate. (Logo -> Menu -> Game)

While testing this out on my menu I've noticed that after I clear the screen any sprites I create afterwards aren't syncing properly and are smearing over the screen.

Please check out the demo attached and help diagnose my issue.

You will need Matrix1Utils by IanM installed to compile the code.

http://forum.thegamecreators.com/?m=forum_view&t=85209&b=18[href] <---Link to Matrix1Utils[/href]

AMD FX 6300 hex-core processor 3.5 GHZ
16 GB DDR3 ram, Geforce 660 Ti 2GB ram
GIDustin
18
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 9th Jan 2014 04:44
Put a "cls rgb(0,0,255)" at the top of each of your DO loops.

Not sure why you don't need it in the first loop, but you do in the second, but you should really have it in both. It clears the old screen with the specified color so that you can start on a fresh canvas each loop.

Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 9th Jan 2014 14:45
Making sprites turns the backdrop active or enables 3d mode, or more specifically it turns the sprites backsave on so it doesn't leave trails. It seems that when you clear all sprites, the backdrop stays on but backsaves for futures sprites turns off. Just a guess but I can't test this cause there's no commands to check the backsave state of a sprite.

Either way, just setting the backdrop on at the start of your program will fix it, so:



"Get in the Van!" - Van B

Login to post a reply

Server time is: 2026-07-06 07:53:03
Your offset time is: 2026-07-06 07:53:03