New to BMax... Weirdness of BMax...
BlitzMax Forums/BlitzMax Beginners Area/New to BMax... Weirdness of BMax...
| ||
Well, BlitzMax looks like a very good engine. But I gotta say I don't like it's reference document. Sometimes its hard to find what I'm looking for... and how to use it. Ok so I decided to start really small and make a text field function. Now I've ran up some trouble, I get an error which i think is the mouse over detection: Graphics 800,600,0 Global gExit% = False While Not gExit = True Cls cTextfield( 10, 10, 150, 16, "NA" ) If KeyHit(KEY_ESCAPE) Then gExit = True EndIf Flip Wend End Function cTextfield( x%, y%, width%, height%, name$) If(MouseX>x)And(MouseX<(x+width))And(MouseY>y)And(MouseY<(y+height))Then EndIf DrawLine( x, y, x+width, y) ' top DrawLine( x, y+height, x+width, y+height) ' bottom DrawLine( x, y, x, y+height) ' left DrawLine( x+width, y, x+width, y+height) ' right DrawText( "Testing", x+2, y+1 ) EndFunction I tried to put all my variable using what they said to use.... like var:int.. var:string.. does that even work.. I get int error thingy. |
| ||
MouseX and MouseY should be MouseX() and MouseY(). |
| ||
MouseX is that value/pointer, so if you just do MouseX you are passing/returning a Pointer to a function returning a Float. Now this is very usfull, because ... well its useful ok. Any time you want a "thing" to return a value to put () at the end. So, MouseX Pass Int() Pointer MouseX() Pass Int value from Function |