| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| Game Hacking Dojo Master Cheater
 
  Reputation: 1 
 Joined: 17 Sep 2023
 Posts: 250
 
 
 | 
			
				|  Posted: Wed Jan 01, 2025 12:24 pm    Post subject: Create Button with an Icon |   |  
				| 
 |  
				| How to give a button an icon? 
 Using createButton() I can't even get hints despite adding the hint property and setting showhint to true.
 
 I believe this is another kind of button used in Cheat Engine called SpeedButton. Allowing imageIndex and hints to show. But how do I create one?
 
 And does createCECustomButton() help here if so could you please provide an example using createCECustomButton()?
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| Dark Byte Site Admin
 
  Reputation: 470 
 Joined: 09 May 2003
 Posts: 25807
 Location: The netherlands
 
 | 
			
				|  Posted: Wed Jan 01, 2025 3:22 pm    Post subject: |   |  
				| 
 |  
				| speedbutton yes,  but not currently implemented in CE. And CECustomButton doesn't really help, though you can make a nice rounded button with it.
 
 My suggestion is to use an image that changes when you click it.  Maybe even change it when hovered over by the mouse (mouseenter/mouseleave)
 _________________
 
 Do not ask me about online cheats. I don't know any and wont help finding them.
 Like my help? Join me on Patreon so i can keep helping
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| AylinCE Grandmaster Cheater Supreme
 
  Reputation: 37 
 Joined: 16 Feb 2017
 Posts: 1527
 
 
 | 
			
				|  Posted: Wed Jan 01, 2025 5:09 pm    Post subject: |   |  
				| 
 |  
				|  	  | Code: |  	  | if mf2 then mf2.Destroy() mf2=nil end 
 mf2 = createForm()
 mf2.Caption="test"
 
 local spbtn = {}
 
 spbtn.btn7 = createComponentClass('TSpeedButton', mf2)
 spbtn.btn7.Parent = mf2
 spbtn.btn7.Height=25
 spbtn.btn7.Left=75
 spbtn.btn7.Top=75
 spbtn.btn7.Width=125
 spbtn.btn7.OnClick=function() print("Image Index: "..spbtn.btn7.ImageIndex) end
 
 imglst1 = createImageList(mf2)
 imglst1.Height = spbtn.btn7.Height - 8
 imglst1.Left=2
 imglst1.Top=4
 imglst1.Width = 23
 
 imgpath1 = [[C:\yourImageFolder\yourImageName.png]]
 icn1 = createPicture()
 icn1.loadFromFile(imgpath1)
 
 img1=createImage(mf2)
 img1.align=alClient
 img1.stretch=true
 srcbmp = createBitmap()
 srcbmp = icn1.getBitmap()
 imglst1.Add(srcbmp)
 
 img1.Picture.Bitmap.Width=imglst1.Width
 img1.Picture.Bitmap.Height=imglst1.Height
 img1.Picture.Bitmap.Canvas.clear()
 imglst1.draw(img1.Picture.Bitmap.Canvas,0,0,2)
 
 spbtn.btn7.Images = imglst1
 spbtn.btn7.ImageIndex = 0
 spbtn.btn7.Caption="    MyButton    "
 
 srcbmp.Destroy()
 icn1.Destroy()
 img1.Destroy()
 | 
 
 -- or ..
 Color buttons:
 https://forum.cheatengine.org/viewtopic.php?t=621680
 
 
 
 
	
		
	 
		| Description: |  |  
		| Filesize: | 5.14 KB |  
		| Viewed: | 7668 Time(s) |  
		| 
  
 
 |  
 _________________
 
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| Game Hacking Dojo Master Cheater
 
  Reputation: 1 
 Joined: 17 Sep 2023
 Posts: 250
 
 
 | 
			
				|  Posted: Wed Jan 01, 2025 6:13 pm    Post subject: |   |  
				| 
 |  
				| Thank you ) |  | 
	
		| Back to top |  | 
	
		|  | 
	
		|  |