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.

Dark GDK / Basic 2D: Displaying a circle, Need help.

Author
Message
Lee Aby
15
Years of Service
User Offline
Joined: 26th Jan 2009
Location:
Posted: 26th Jan 2009 13:01
Hi all,

I am trying to draw a circle and display it on the screen. I am using the function dbCircle() to draw the circle. However no circle is drawn on the screen and I always get a black window. I have inserted the dbSync() in the main loop.

Here is the code I tried:


Please help me understand what I missed.

Thanks a lot
Lee

--
Lee
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 26th Jan 2009 15:01
Try putting dbCircle() in the main loop so it is drawn every frame.
Lee Aby
15
Years of Service
User Offline
Joined: 26th Jan 2009
Location:
Posted: 26th Jan 2009 15:14
I have tried that too but I am only getting a black window

I have tried the Tutorial to display Hello World which says about function dbSprite() to draw the image from memory to screen. Is that the issue? If so, what argument I should pass as the ID?

--
Lee
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 26th Jan 2009 21:24
I have copied and pasted your code into a 2D project (pasted over existing code) and it works fine, I get a red circle in the top left hand corner on a black screen.
So, I have no idea why this is not working for you, sorry.
CheatCat
17
Years of Service
User Offline
Joined: 7th Mar 2007
Location: Sweden
Posted: 27th Jan 2009 09:49 Edited at: 27th Jan 2009 09:50
Try dbCLS(); after dbInk();
Lee Aby
15
Years of Service
User Offline
Joined: 26th Jan 2009
Location:
Posted: 27th Jan 2009 17:16
Thanks for all your help. But I am still unable to get that circle drawn.

matty - Earlier I was trying it on "Dark GDK - Game Template", and I tried it now on the 2D template too. The code that came when we start a 2D Game works fine and I get the proper animations displayed on the screen. But with my code to display the circle it is still displaying only a black screen:-(

CheatCat - I have tried that too. The screen is always black even when I change the background color.

--
Lee
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 28th Jan 2009 18:44
O.K Ive done a little bit of testing.
dbInk() will not affect the background colour, I think it is refering to ink background, you know the way, like in paint(windows) were you will have a foreground and a background ink colour.

This should turn your screen green:


As for not seeing the circle, this is strange, all I can think of is that your monitor settings are making it hard to see, red is hard to see on black background.

Let me know how you get on.
Lee Aby
15
Years of Service
User Offline
Joined: 26th Jan 2009
Location:
Posted: 31st Jan 2009 07:59
Matty -

I could set the background color after including the dbCLS you mentioned. Even then I am not getting the circle. I was thinking if for some reason, the ink color is not getting changed, the circle displayed might be in the background color itself. Is there a function to read the current ink color? I did not see one in the current GDK documentation. Also the documentation misspells the dbCLS () function as dbCls () !

--
Lee
Lee Aby
15
Years of Service
User Offline
Joined: 26th Jan 2009
Location:
Posted: 31st Jan 2009 08:09
Matty -

I think the problem is somewhere else. I can draw a line and box by using dbLine () and dbBox () but dbCircle() and dbEllipse () are not working. It is actually weird.

--
Lee

Login to post a reply

Server time is: 2024-11-25 13:42:47
Your offset time is: 2024-11-25 13:42:47