Benton Posted March 24, 2012 Share Posted March 24, 2012 Hey guys, I know this is not the right forum, but I have not yet payed for Leadwerks, I am getting my funds in order, and I just have a quick question. I want to see if MouseX and MouseY are more or less then a number. if MouseX > 1 then However it says I cannot compare a function with an integer. How can I do this in LUA? Quote Windows 7 Professional 64 bit, 16 gigs ram, 3.30GHz Quad Core, GeForce GTX 460 one gig, Leadwerks 2.5, Blender 2.62, Photoshop CS3, UU3D Link to comment Share on other sites More sharing options...
DigitalHax Posted March 24, 2012 Share Posted March 24, 2012 In what context are you using this - what for? By the way posting here is fine! I have leadwerks yet I still use the general discussion mostly. Quote Win7 64bit, Leadwerks SDK 2.5, Visual Studio 2012, 3DWS, 3ds Max, Photoshop CS5. Life is too short to remove USB safely. Link to comment Share on other sites More sharing options...
Benton Posted March 24, 2012 Author Share Posted March 24, 2012 In onUpdate. I want to know where the mouse is on the screen, because depending on where it is something needs to happen. Oh, and how do I do concatenation in Lua? Quote Windows 7 Professional 64 bit, 16 gigs ram, 3.30GHz Quad Core, GeForce GTX 460 one gig, Leadwerks 2.5, Blender 2.62, Photoshop CS3, UU3D Link to comment Share on other sites More sharing options...
Benton Posted March 24, 2012 Author Share Posted March 24, 2012 Actually a better question is: MouseX and MouseY are "functions" and I can't do concatenation and all that stuff with them cause they are not integers or strings. So what do I do? Quote Windows 7 Professional 64 bit, 16 gigs ram, 3.30GHz Quad Core, GeForce GTX 460 one gig, Leadwerks 2.5, Blender 2.62, Photoshop CS3, UU3D Link to comment Share on other sites More sharing options...
Pixel Perfect Posted March 24, 2012 Share Posted March 24, 2012 The answer is in the error message: 'cannot compare a function with an integer'. You are trying to compare the function and not its value, you need the brackets after the function name: if MouseX() > 1 Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
Benton Posted March 24, 2012 Author Share Posted March 24, 2012 Thanks Quote Windows 7 Professional 64 bit, 16 gigs ram, 3.30GHz Quad Core, GeForce GTX 460 one gig, Leadwerks 2.5, Blender 2.62, Photoshop CS3, UU3D Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.