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.

2D All the way! / Need Help with Dots

Author
Message
Rburke
18
Years of Service
User Offline
Joined: 28th Sep 2006
Location:
Posted: 29th Sep 2006 03:47
I made a very simple painting program that draws red dots based on mouse position. My problem here is that the red dots seem to leave gaps between each other and the lines aren't solid. Here's the code:



What can I do to make it a solid line? Thanks for any help.
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 29th Sep 2006 10:47 Edited at: 29th Sep 2006 10:50
You could move the mouse slower

... or, instead of dots, draw lines. You will need two extra variables to store the last mouse position and draw a line from them to the new mouse position.

Like this:



wildbill
19
Years of Service
User Offline
Joined: 14th Apr 2006
Location:
Posted: 29th Sep 2006 16:38
Try this.


sync on: sync rate 30

set display mode 640,480,32

` Set Ink Color
ink rgb(255,50,50),0

while ESCAPEKEY()=0

if mouseclick()=1
l = mousex()
t = mousey()

line l,t,r,b
endif

r= mousex()
b= mousey()

sync
endwhile
whipped6
18
Years of Service
User Offline
Joined: 31st Aug 2006
Location:
Posted: 8th Oct 2006 06:38
if you want to keep the dots because they are pretty cool i think just do this code if i was more expierenced i would try to make it where you can chose to pick if u want to draw with dots or lines i tried and i couldnt do it lol but if your a noob here to i wouldnt mine grouping up with you then we could teach each other the stuff we know i know alot right now but not enough

set display mode 640,480,32



game creator
whipped6
18
Years of Service
User Offline
Joined: 31st Aug 2006
Location:
Posted: 8th Oct 2006 07:00
i have another one i was expiermenting with it and somehow i made it do something wierd try it out its pretty sweet



game creator
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 23rd Oct 2006 21:54
Check the DB challenges. We had a Paint program challenge with a ton of good results.

"Using Unix is the computing equivalent of listening only to music by David Cassidy" - Rob Pike

Login to post a reply

Server time is: 2025-05-15 07:17:00
Your offset time is: 2025-05-15 07:17:00