Posts: 3,368
Threads: 195
Joined: Jan 2003
I edited that post above..
The last code I posted worked, why couldn't you use that?
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 677
Threads: 57
Joined: Jan 2005
Quote:well someone said that i should use if's in the loop, so i tried putting the whole thing into one big loop, but it didnt do any better, now the screen continuously flickers, maybe ill look for a source code for a paint program out thre and modify it to work with wat i want it to do and giv mucho credit to the creator(s), unless someone can figure out this danm code, it makes sense, until you run it
Try using Pages, that should remove flicker
url=http://www.sloganizer.net/en/] [/url]
Posts: 488
Threads: 19
Joined: Sep 2005
actually i got it to almost work, now i have gosubs that work properly, except as soon as i try to make another thing work properly, another one glitches, when i get home tonite, ill update my code on the first post, i tried using wat AGA last suggested
Posts: 488
Threads: 19
Joined: Sep 2005
pages are beyond me, it is screen 13 too just in case u need to know, updated code at 9:11 exact, thats wierd
Posts: 1,774
Threads: 62
Joined: Aug 2003
Here's something to mess with. At the very least, it will show you how to use a Sub, and how to use the mouse in FreeBASIC. Don't bother trying it under QB though.
Code: #INCLUDE "FBGFX.BI"
Screen 13,,,1
Declare Sub Draw_Palette( MouseX, MouseY, Button, Paint_Color )
Declare Sub Draw_Big_Grid( MouseX, MouseY, Button, Paint_Color, Img_Data() )
Declare Sub Copy_Pixel_Data( Img_Data() )
Declare Sub Paste_Pixel_Data( Img_Data() )
Dim Img_Data(15, 15)
Do
Getmouse( MouseX, MouseY,,Button )
Draw_Palette( MouseX, MouseY, Button, Paint_Color )
Copy_Pixel_Data( Img_Data() )
Draw_Big_Grid( MouseX, MouseY, Button, Paint_Color, Img_Data() )
Paste_Pixel_Data( Img_Data() )
Line(0,0)-(17,17),31,B
Line(1,109)-(7, 116),31,B
Line(2,110)-(6, 115),Paint_Color,BF
Loop Until Multikey(SC_ESCAPE)
Sub Draw_Palette( MouseX, MouseY, Button, Paint_Color )
For Y = 0 To 15
For X = 0 To 15
Line(X*5,(Y*5)+120)-Step(4,4),Col,BF
If MouseX>=(X*5) And MouseX<=(X*5)+4 And MouseY>=(Y*5)+120 And MouseY<=(Y*5)+124 Then
Line(X*5,(Y*5)+120)-Step(4,4),31,B
If Button = 1 Then
Paint_Color = Col
End If
End If
Col+=1
If MouseX>=1 And MouseX<=16 And MouseY>=1 And MouseY<=16 Then
Select Case Button
Case 1
Pset(MouseX, MouseY), Paint_Color
Case 2
Paint_Color = Point(MouseX, MouseY)
End Select
End If
Next
Next
End Sub
Sub Draw_Big_Grid( MouseX, MouseY, Button, Paint_Color, Img_Data() )
For Y = 0 To 15
For X = 0 To 15
If MouseX>=(X*12)+100 And MouseX<=(X*12)+111 And MouseY>=(Y*12) And MouseY<=(Y*12)+11 Then
If Button = 1 Then
Img_Data(X,Y) = Paint_Color
Elseif Button = 2 Then
Paint_Color = Img_Data(X,Y)
End If
End If
Line((X*12)+100,Y*12)-Step(11,11),31,B
Line((X*12)+101,(Y*12)+1)-Step(9,9), Img_Data(X,Y),BF
Img_Data(X,Y) = Point((X*12)+101,(Y*12)+1)
Next
Next
End Sub
Sub Copy_Pixel_Data( Img_Data() )
For Y=0 To 15
For X = 0 To 15
Img_Data(X,Y) = Point(X+1,Y+1)
Next
Next
End Sub
Sub Paste_Pixel_Data( Img_Data() )
For Y=0 To 15
For X = 0 To 15
Pset(X+1,Y+1),Img_Data(X,Y)
Next
Next
End Sub
Posts: 488
Threads: 19
Joined: Sep 2005
well i tried a link to FBide but it desnt work, it sais it is missing fbc.exe, so i have no version of fb that works
Posts: 488
Threads: 19
Joined: Sep 2005
quick note, besides me not having fb is dont worry about the drawing part unless you really want to, im trying to do that on my own
Posts: 3,368
Threads: 195
Joined: Jan 2003
Click view>settings>Compiler>"...", then find your fb compiler..
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 320
Threads: 24
Joined: Feb 2005
FBIDE isn't the compiler. You have to feed it the path to the commandline compiler itself, otherwise it won't work.
Also, you double-posted.
.14159265358979323846264338327950288419716939937510582709445
Glarplesnarkleflibbertygibbertygarbethparkentalelelangathaffendoinkadonkeydingdonkaspamahedron.
Posts: 488
Threads: 19
Joined: Sep 2005
but i dont have the compiler, i searched my whole cpu and i dont ahve the compiler
|