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 / [SOLVED] TEXT FLICKERING WHEN DRAWING GRAPHICS OR POSITIONG TEXT

Author
Message
fogunsakin
User Offline
Joined: 27th Aug 2023
Location: Lancashire, ENGLAND
Posted: 22nd Oct 2023 04:58 Edited at: 22nd Oct 2023 06:01
This post has been marked by the post author as the answer.
Hi All,

I am very new to DarkBasic programming and I am enjoying learning it using DarkBasic Professional. However, as I don't understand most of the jargon used in the discussion on the forum, I am very lost most of the time. The issue of flickering text when I try to draw graphics or text on the screen is really slowing my learning. Here are some examples of the issues that I have:


The word HELLO , when displayed, continues to flicker very rapidly. Another example:



The red arrow, when displayed, continues to flicker vary rapidly and any other writing on the screen, such as "Press any key to continue" is very hard to read. I desperately need help to fix the issue as I don't know what the cause could be. I am using a 64 bit laptop with Windows 10 professional installed. I don't know much about Graphics yet. Hence the reason why I am learning DarkBasic Professional programming. I will be happy to pay for private tutorial if anybody is prepared to assist me.

I accidentally deleted an email from LEE BAMBER without realising the importance of his communication and I do not know how to get back in touch with him.

Please HELP!!!
Frederick
fogunsakin@hotmail.com
ENGLAND

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

Go to answer

Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 22nd Oct 2023 05:48 Edited at: 22nd Oct 2023 06:18
fogunsakin,

this is now your 3rd thread re: essentially the same issue when you should have responded in the first one/continued the discussion vs creating more threads.

unfortunately, i haven't touched DBPro in ~a decade so i'm no help but please keep related discussion in this thread while referring to the previous 2 which i'm now going to lock: one, two.

meanwhile, if you edit your last post, you can see how i wrapped your code snippets inside code tags which helps keep the post a little tidier.

hopefully keeping your thoughts/inquiries and helpful responses all together will get you over the hump and on to the next stage.

since you titled this thread IN ALL CAPS, your frustration is obvious so hang in there and continue following the advice given. at some point, the lightbulb will flicker (pun intended) and then stay on and you'll be on your way to a more enjoyable experience

hey, i just remembered something: if you see THIS THREAD, you will find links to Hands On DarkBASIC Pro Vols 1 & 2 + companion materials provided FOR FREE by the generous author, alistair . they are bound to help you out (another pun?)
ando
4
Years of Service
User Offline
Joined: 21st Feb 2020
Location: Australia
Posted: 22nd Oct 2023 11:19
I have not played with DB for a long time.

It flickered for me too so I tried some things.

If you hit a key then it stops flickering.
If you remove "wait key" then it stops flickering.

BASIC appeared in May 1964. Lightning flashed, the wind roared and the Earth moved.
And nine months later I was born.
So here I am.
I am Basic.
Code is in my genes.
ando
4
Years of Service
User Offline
Joined: 21st Feb 2020
Location: Australia
Posted: 22nd Oct 2023 18:40
By the way, to quote myself "I have not played with DB for a long time."

Translates to...

"This may be a case of the blind leading the blind."
BASIC appeared in May 1964. Lightning flashed, the wind roared and the Earth moved.
And nine months later I was born.
So here I am.
I am Basic.
Code is in my genes.
fogunsakin
User Offline
Joined: 27th Aug 2023
Location: Lancashire, ENGLAND
Posted: 22nd Oct 2023 21:03
Thank you All for your responses. When I recoded the program as below:
c1 = RGB(255, 0, 0)
c2 = RGB(0, 255, 0)
c3 = RGB(0, 0, 255)
c4 = RGB(255, 255, 0)
DO
CLS
REM RGB(255, 0, 0), 0
INK RGB(255, 255, 0), 0
LINE 50, 50, 50, 200
LINE 50, 50, 100, 50
LINE 100, 50, 100, 100
BOX 10, 200, 150, 250, c1, c2, c3, c4
CIRCLE 200, 150, 50
LOOP
PRINT "Press any key to continue"
WAIT KEY
END

All the graphics display perfectly without any flickering. However, The lines after the "LOOP" keyword become ineffective and the only way to terminate the program is to press either the Escape key or the Close (x) button. Is there some other code that I need to add to the program to enable the PRINT command and the WAIT KEY command to be effective at the same time with the graphics display?

It appears as if using the TEXT, LINE, CIRCLE or other graphiics display/positioning methods do not work with the PRINT command without causing the output to flicker.

Thank you for your interests.
fogunsakin
fogunsakin
User Offline
Joined: 27th Aug 2023
Location: Lancashire, ENGLAND
Posted: 22nd Oct 2023 22:53
Hi All,

A very big and sincere thanks for all your assistance, especially to Raven in Hertfordshire, England who provided me with a solution that solved the issue. The solution is as below:

Rem ***** Main Source File *****
SYNC ON
SYNC RATE 0

c1 = RGB(255, 0, 0)
c2 = RGB(0, 255, 0)
c3 = RGB(0, 0, 255)
c4 = RGB(255, 255, 0)

CLS
REM RGB(255, 0, 0), 0
INK RGB(255, 255, 0), 0
LINE 50, 50, 50, 200 : FASTSYNC 0
LINE 50, 50, 100, 50
LINE 100, 50, 100, 100
BOX 10, 200, 150, 250, c1, c2, c3, c4
CIRCLE 100, 110, 10
PRINT "Press any key to continue" : FASTSYNC 1
WAIT KEY
END

The program worked perfectly without any flickering.

Thank you very much
fogunsakin

Login to post a reply

Server time is: 2024-07-27 08:04:18
Your offset time is: 2024-07-27 08:04:18