12-15-2005, 05:08 AM
Hey Zack, WB!
Im Dark_Prevail, if you were wondering
Im Dark_Prevail, if you were wondering
I want to get back into coding...FB starter's help please?
|
12-15-2005, 05:08 AM
Hey Zack, WB!
Im Dark_Prevail, if you were wondering
12-15-2005, 05:43 AM
Hey Zack! WB!!!
I'm Whitetiger0990, if you were wondering.
12-15-2005, 05:51 AM
Quote:That link didn't really explain much to me...either that or I just didn't understand it. Perhaps I should rephrase: how do I detect arrow keypresses in FB?Zack Wrote:First, why doesn't the old QBASIC trick for detecting arrow keys work? I mean the old IF k$=CHR$(0) + CHR$(77) THEN rightArrowPress=1 thing. I tried it, it didn't work.http://www.freebasic.net/forum/viewtopic.php?t=1807 On the second topic: I suspected that. But I'm not sure how to engineer it. I'll have to experiment. Thanks. Hey dp, what's new?
f only life let you press CTRL-Z.
-------------------------------------- Freebasic is like QB, except it doesn't suck.
12-15-2005, 05:53 AM
stylin:
12-15-2005, 06:12 AM
I guess I needed it in fewer words.
I see now. Replace CHR$(0) with CHR$(255). Thank you! Now I still have to engineer the line-drawing thing. Any tips? I can't seem to wrap my head around it. I'm thinking that somehow I need to make the program "remember" if in the last loop iteration the mouse button was pressed, and if so draw a line from the last dot to the new position.
f only life let you press CTRL-Z.
-------------------------------------- Freebasic is like QB, except it doesn't suck.
12-15-2005, 06:13 AM
Quote:.....Ooops, another FB gotcha. As you know, Arrow keys and others like Home, Page-Up, etc. are extended characters. In QB when you do an INKEY$ of an extended character, you get 2 characters in, the first of which is CHR$(0) to identify the second character as extended. In FB, you get a CHR$(255) first. No big deal once you know. Welcome back, Zack! *****
12-15-2005, 06:22 AM
Hey, Moneo!
Yeah I figured that out with stylin's help. Thanks. And re the other bug. Fixed! I take the old x and y coords before I got the new ones, and then I draw a line from the oldX and oldY to the newX and newY. Thanks stylin!
f only life let you press CTRL-Z.
-------------------------------------- Freebasic is like QB, except it doesn't suck.
12-15-2005, 07:07 AM
The fixed code, if you're interested:
Code: 'CANVAZZ.BAS
f only life let you press CTRL-Z.
-------------------------------------- Freebasic is like QB, except it doesn't suck.
12-15-2005, 08:51 AM
Quote:Next project: add line, box and circle capability. I might do a total rewrite and work it around lib with bitmap loading/saving, etc.A lib.. kind of like.. the standard FB lib? Bload "mybmpfile.bmp" Bsave "mybmpfile.bmp" Just make sure to use the .bmp extension, and to bload into a properly dimensioned surface (array)
12-15-2005, 10:31 AM
Is there a reason for the CHR$(255) instead of CHR$(0), or just laziness?
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. |
« Next Oldest | Next Newest »
|