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 / Problmes with a drawing program.

Author
Message
KhaxaaZ
14
Years of Service
User Offline
Joined: 28th Feb 2012
Location:
Posted: 28th Feb 2012 18:56
I was making this drawing program, when i came across 3 problems.
that i hoped you guys could help me with.
the program is suppose to me like the old paint.

Frist problem:
i want to make a line,(Line x,y,x,y). i want the frist x,y to be where the person clicks frist time, and the the other x,y to be where the person clicks second time.

Second problem:
if i haven drawn a shape, and i want to fill it with a color, how do i do that? like the buket painting tool, in paint.

last problem:
i have made panel on the left site of the screen, and want that if you clik, like in the BOX 1,96,20,116, how can i make the mouse know i cliked in that area, i know the point commant, but it ain\'t working, in this case, cus i have meny colors and box\'es in the panel.

i really hope you guys can help.
Alien002
15
Years of Service
User Offline
Joined: 25th May 2011
Location:
Posted: 29th Feb 2012 02:26
first problem this snippet should give you a idear on how to solve it.



Second problem is a lot harder. DBP does not have a fill circle command. you might want to google flood filler. There is a few dll's that add commands that dbp should have.

the point command returns the colour value from the screen. This snippet should help . button function that i use all the time.

KhaxaaZ
14
Years of Service
User Offline
Joined: 28th Feb 2012
Location:
Posted: 29th Feb 2012 20:26
Thank you very much =)
SoftMotion3D
AGK Developer
20
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 1st Mar 2012 04:07
Quote: "Second problem:
if i haven drawn a shape, and i want to fill it with a color, how do i do that? like the buket painting tool, in paint.
"


yes this would be a difficult one indeed but of course such a function could be programmed in.


Is there big enough demand for this function? Mabey i will code it for ya as i always like a good challenge.

Anyone else want this function?

KhaxaaZ
14
Years of Service
User Offline
Joined: 28th Feb 2012
Location:
Posted: 1st Mar 2012 20:14
SMD_3D, i bet its going to take lots of lines. i can't take something you made, i am working on this school project. i am making a drawing program that i need to send to my teacher in 3 weeks, and then maybe i will get this program for my exam's. i cant have some code i cannot understand. but you can make it if you want, and if you want the challenge. but thanks for your time and effort any way.
SoftMotion3D
AGK Developer
20
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 2nd Mar 2012 02:04
no problem.....i understand

basjak
16
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 2nd Mar 2012 03:28
Quote: "if i have drawn a shape, and i want to fill it with a color, how do i do that?"


yes you can fill any shape using Ian matrix1_util_30 pluggin
http://forum.thegamecreators.com/?m=forum_view&t=85209&b=18

as well look at advanced 2d pluggin by diggsey (very cool 2d pluggin)
http://forum.thegamecreators.com/?m=forum_view&t=179096&b=5
KhaxaaZ
14
Years of Service
User Offline
Joined: 28th Feb 2012
Location:
Posted: 2nd Mar 2012 20:52
Again i have to send it to my teachers, and they may not have the plugin, so it for no use to me. but thanks anyway.

And alien, i could't get the button code to work, but you gave me an ideer how i am was suppose to get it to work, and now its working. helped alot, and and thanks too you other guyes for taking your time to help me.
basjak
16
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 3rd Mar 2012 17:03 Edited at: 3rd Mar 2012 17:05
are you trying to creat buttons? this is very easy work. create zones function:

KhaxaaZ
14
Years of Service
User Offline
Joined: 28th Feb 2012
Location:
Posted: 3rd Mar 2012 20:32
I did creat my buttons, had problems cus my dark basic keepts saying error 1512.. but i fixed it. had on last problem, i hoped you guys could help me with. i made a function ofr each button. but i seem that the funktion part is not working

here is example
in the begining for the program my mus=0 that means the pen is on.

and later then the program i want it to react if the user cliks on the eraser button.

Funktion Eraser()
if mousex() <= something
if mousey() <= something
if mousex() >= something
if mousey() >= something
If mouseclick() = 1
Mus=1
5*endif
Endfunction Mus

the code call for the function is in a do-loop.
Eraser()

but for somereason the mus don't change from 0 to 1 even if you click in the spece.

Login to post a reply

Server time is: 2026-07-09 02:12:50
Your offset time is: 2026-07-09 02:12:50