Scripts / Little Mouse script to play with

Author
Message
duramin
9
Years of Service
User Offline
Joined: 25th May 2015
Location:
Posted: 14th Dec 2015 15:23 Edited at: 14th Dec 2015 17:27
Hi there,

i played around with the new lua commands and smashed a lil script together. What it does: If you press the right mousebutton, it toggles to "mouse mode" (you get a movable mouse cursor ) and back

Maybe useful for someone who needs a starting point in creating an inventory/menu/minigame ect thingy

Use:
Save the dm_mouse.lua (attached) in the scriptbank
Attach it to an always active entity and place the "cursor.png" (attached) in a new created folder "png" in scriptbank folder




To fullfill the forum rules: Script can be used in any way for whatever you need it.

Additional info: Mouse Coords. are from 0 to 99.9 something both axis. (g_MouseX and g_MouseY) so it seems to be resolution independant . g_MouseClick can be at least 1 (left Mouse Key) and 2 (right mousekey) and you also got g_MouseWheel to play with.


Edit: You may freeze the Player while you are in mouse active mode, as he can still walk around .
Have fun !

Attachments

Login to view attachments
PM
Isagabe
10
Years of Service
User Offline
Joined: 12th Sep 2014
Location:
Posted: 16th Dec 2015 12:13
duramin
Thank you for the code. Exciting times trying to learn all this new stuff and the possibilities that go with it.
Bored of the Rings
GameGuru Master
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 16th Dec 2015 14:08
thanks for this I'll have a play around
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, SQL, PL-SQL, JavaScript, HTML, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; LG TFT monitor (widescreen). Wanting a new PC at some point.
Interests: Drumming, Saxophone, Art, Theatre, Music.
duramin
9
Years of Service
User Offline
Joined: 25th May 2015
Location:
Posted: 17th Dec 2015 10:07 Edited at: 17th Dec 2015 13:21
I decided to enhance the script a bit. Its not "pure elegance" as the targed is to make it as easy to understand as possible. Have Fun

Scriptname: dm_mouse.lua
What it does: Brings up a Dialog picture with some buttons including handling [...] if you click the right mousebutton. Click on OK will close the dialog.
You can use it for whatever you like (free as in freedome)
what it looks like:


How to set up: extract the archive (attached) to your scriptbank folder. Attach dm_mouse.lua to a always active entity.

Script: (you don't have to copy it, it is in the archive, too)


Modify it to your needs and have fun with it

Attachments

Login to view attachments
PM
Isagabe
10
Years of Service
User Offline
Joined: 12th Sep 2014
Location:
Posted: 17th Dec 2015 11:30
Thank you. You make it seem so easy. Much appreciated.

Login to post a reply

Server time is: 2024-12-22 10:45:03
Your offset time is: 2024-12-22 10:45:03