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 


Cheat Engine Forum Index
PostGo back to topic
.lua
Expert Cheater
Reputation: 1
Joined: 13 Sep 2018
Posts: 202

PostPosted: Tue Sep 22, 2020 5:30 am    Post subject:

You need to solve several problems:
First: we should record the coordinate point when the mouse clicks (as the origin coordinate), and draw the area horizontally and vertically with this coordinate point
Second: the brush color should follow the area being drawn, not the entire canvas
Code:
if f then f.Destroy() end
f=createForm()
f.Color=0x00ff00
f.setSize(300,300)
--f.OnMouseDown=function(p) f.dragNow() end
local down=1
f.OnMouseDown=function()
  down=0
end
f.OnMouseUp=function()
  down=1
end
f.OnMouseMove=function()
  local x,y=f.ScreenToClient(getMousePos())
  if down==0 then
    f.caption=x..' '..y
    f.Canvas.Clear()
    f.Canvas.Pen.Width=1
    f.Canvas.Brush.Color=0x00ffff
    f.Canvas.roundRect(f.width-x, f.height-y, x, y, 16, 16)
  end
end

f.setLayeredAttributes(0x0000ff,220,3,3)
Back to top
View user's profile Send private message
Post reviews:   Approve 1
Author Review
Corroder
Review: Approve
Post reference:
ReviewPosted: Tue Sep 22, 2020 6:05 am

Good job
Back to top
View user's profile Send private message
Display:  
Cheat Engine Forum Index


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites