Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Custom Cursor / Image Follows

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials -> LUA Tutorials
View previous topic :: View next topic  
Author Message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Fri Jul 05, 2019 11:23 pm    Post subject: Custom Cursor / Image Follows Reply with quote

This for funs. In CE Lua, you are able to make an object to follow your mouse movement.

Just like this:

Code:
function timer1_tick(sender)
 img.Picture.loadFromStream(findTableFile('superhero1.png').Stream)
 img.setSize(300,300)
 x,y=getMousePos()
 img.Left = x - img.Width
 img.Top = y - img.Height
end

t=createTimer()
t.interval=1
t.Enabled=false
t.onTimer=timer1_tick


To understand and see what the logic, here full code download link:

https://www.mediafire.com/file/6awcgpvsgb7ayw7/ImageFollowMouse.CT/file

To use:
- Click on FORM to activating mouse movement
- Double Click to deactivating

Enjoy and smile. ... Razz

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 30

Joined: 16 Feb 2017
Posts: 1234

PostPosted: Wed Sep 04, 2019 12:34 pm    Post subject: Reply with quote

Nice idea and start.
I think that could trigger some improvements.
For example: Picture deployment in the form interface.


Code:
local e1 = createEdit(f)
e1.setPosition(250,550)
e1.Text = "250,250"

img=createImage(f)
--img.setSize(100,100)
img.stretch=true
img.Picture.loadFromStream(findTableFile('superhero1.png').Stream)
img.setPosition(e1.Text)

function timer1_tick(sender)
-- img.Picture.loadFromStream(findTableFile('superhero1.png').Stream)
 local x,y=getMousePos()
 img.Left = x -50-- img.Width
 img.Top = y -50-- img.Height
 e1.Text = x..','..y
end

function stop()
 t.Enabled=false
-- img.Picture.loadFromStream(findTableFile('superhero1.png').Stream)
 img.setPosition(e1.Text)
-- img.setSize(100,100)
end


good job @Corroder ..

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials -> LUA Tutorials All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites