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.

Newcomers DBPro Corner / Strange screen behavior after using Set Cursor...

Author
Message
Bulsatar
13
Years of Service
User Offline
Joined: 19th Apr 2011
Location:
Posted: 5th Dec 2011 12:58
Hey everyone,

I just ran into a strange thing, when I use set cursor toward the bottom of the screen, it blocks out the rest of the screen with the background color after that line (screenshot attached). I call the code at the end up my main game loop so that way it is always drawn on top. Have you guys ever seen this before??

Code causing problems:

Attachments

Login to view attachments
nonZero
12
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 5th Dec 2011 15:23 Edited at: 5th Dec 2011 15:28
It doesn't give me any problems... I don't think the problem lies in this function. I tried calling it with a 2D and a 3D background(looped) and I don't get that stripe at the bottom.

Somewhat unrelated, you can simplify the function a little though:


Completely unrelated: .BMPs (uncompressed bitmaps) really take forever to download/upload and they waste bandwidth. Perhaps you should consider another format. PNG? It's 100% lossless. If you're including images in your project, using PNG can really save yours and your users' hdd space.

Sorry I couldn't help you with the actual problem

EDIT: Hah, just nailed it when I looked at your snap again. I wasn't running windowed mode when I tested it. I set it to windowed mode and got the same problem. The problem only seems to occur in windowed mode. Will look into a simplified solution.

EDIT 2: ...Expected as much. Use the "TEXT" command in place of "PRINT".


WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 5th Dec 2011 17:44
When printing toward the bottom of the screen, use a semicolon to prevent a carriage return. The carriage return toward the bottom of the screen causes the screen to scroll.

nonZero
12
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 5th Dec 2011 21:12
Quote: " The carriage return toward the bottom of the screen causes the screen to scroll. "


I totally missed that, lol
Prolly coz I don't use PRINT anymore (Except when debugging something). I use TEXT these days coz it's easier and it's one line instead of two. Guess DBPro is making me lazy.

WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 5th Dec 2011 22:28 Edited at: 5th Dec 2011 22:31
It all depends on what you’re printing. This is an unfinished visualization of Diggsey’s Trigonometry Tutorial, I played with a while back. Set the display setting to - Windowed (1024 x 768). Media is attached. The code uses both text and print commands. You can see how using text in place of print, would only add unnecessary code.

Attachments

Login to view attachments
Bulsatar
13
Years of Service
User Offline
Joined: 19th Apr 2011
Location:
Posted: 6th Dec 2011 04:24
Text command worked beautifully!!!

Thanks for all of the help, greatly appreciated

(nonZero, I will remember the png from now on, thanks!)
nonZero
12
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 6th Dec 2011 16:24
@WickedX:
Yeah, I can see what you mean just by looking at the code; if you're printing a line just below another line or if you want the continuity to be handled internally that PRINT is beneficial because it requires no coordinates. As I said, I do still use it when debugging something or in an example because of the automatic text placement. What I meant was I just don't really use it in projects anymore (Not for lack of usefulness, simply lack of need)... Off topic somewhat, that's a really, really GREAT tutorial! Loved the moving diagram!

@Bulsatar:
You're welcome, glad I could help.

Login to post a reply

Server time is: 2024-05-20 08:34:03
Your offset time is: 2024-05-20 08:34:03