| 
			
				|  | Cheat Engine The Official Site of Cheat Engine
 
 
 |  
 
	
		| View previous topic :: View next topic |  
		| Author | Message |  
		| .lua Expert Cheater
 
  Reputation: 1 
 Joined: 13 Sep 2018
 Posts: 203
 
 
 | 
			
				|  Posted: Wed Mar 26, 2025 12:57 am    Post subject: Some issues with the setLayeredAttributes function |   |  
				| 
 |  
				| I want the mouse to still be able to operate after specifying the transparent color in the window, instead of penetrating. is there any way?
 
  	  | Code: |  	  | if UDF1==nil then  UDF1=createForm(true)  end UDF1.Color=0xff
 UDF1.setLayeredAttributes(0xff,255,1)
 | 
 
 
 
 
	
		
	 
		| Description: |  |  
		| Filesize: | 21.11 KB |  
		| Viewed: | 5907 Time(s) |  
		| 
  
 
 |  
 |  |  
		| Back to top |  |  
		|  |  
		| AylinCE Grandmaster Cheater Supreme
 
  Reputation: 37 
 Joined: 16 Feb 2017
 Posts: 1527
 
 
 | 
			
				|  Posted: Wed Mar 26, 2025 8:38 am    Post subject: |   |  
				| 
 |  
				| I think it is not possible to click in fully transparent state. 
 But if reducing the transparency at click time and making the click possible is a solution, try the following code.
 
 
  	  | Code: |  	  | if UDF1 then UDF1.Destroy() UDF1=nil end UDF1=createForm()
 UDF1.Color=0x000100
 UDF1.setLayeredAttributes(0x000100, 255, LWA_COLORKEY | LWA_ALPHA )
 
 local frm2 = UDF1
 
 function isMouseInBounds(x1, y1, x2, y2)
 local mouseX, mouseY = getMousePos()
 return mouseX >= x1 and mouseX <= x2 and mouseY >= y1 and mouseY <= y2
 end
 
 function frmPos()
 local x1, y1 = frm2.Left, frm2.Top
 local x2, y2 = x1 + frm2.Width + 20, y1 + frm2.Height + 20
 
 if isMouseInBounds(x1, y1, x2, y2) then
 frm2.setLayeredAttributes(0x000100, 120, LWA_ALPHA )
 else
 frm2.setLayeredAttributes(0x000100, 255, LWA_COLORKEY | LWA_ALPHA )
 end
 collectgarbage("step")
 end
 
 frm2.OnMouseDown = function() frm2.DragNow() end
 
 if posTmr then posTmr.Destroy() posTmr=nil end
 posTmr = createTimer()
 posTmr.Interval = 100
 posTmr.OnTimer = frmPos
 posTmr.Enabled = true
 | 
 
 
 
 
	
		
	 
		| Description: |  |  
		| Filesize: | 18.87 KB |  
		| Viewed: | 5842 Time(s) |  
		| 
  
 
 |  
 _________________
 
 |  |  
		| Back to top |  |  
		|  |  
		|  |  
  
	| 
 
 | 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 can download files in this forum
 
 |  |