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 Button With Icon

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Extensions
View previous topic :: View next topic  
Author Message
Aylin
Grandmaster Cheater
Reputation: 10

Joined: 16 Feb 2017
Posts: 658

PostPosted: Wed Apr 01, 2020 4:38 am    Post subject: Reply with quote

Good job dude congratulations.
I like these kinds of images. It makes classic paintings fun.
I think I was given permission to edit.
Like every user, I set it up for myself.

Code:
----------------------------- The function
function createButtonIcon(frm, x, y, w, h, col, ico, txtcol, txtsz, txt, bname, func)

 local btnCn = createPanel(frm)
 btnCn.setSize(w,h)
 btnCn.setPosition(x,y)
 btnCn.Color = col
 btnCn.BorderStyle = 'bsNone'
 btnCn.BevelOuter = 'bvNove'
 btnCn.BevelInner = 'bvNove'
  btnCn.Font.Color = txtcol
 btnCn.Font.Size = txtsz
 btnCn.Caption = "       "..txt
 btnCn.OnMouseMove=function() btnCn.Color=col + 70 end
 btnCn.OnMouseLeave=function() btnCn.Color=col end
 btnCn.OnClick=function() func() end

 local i = frm.getComponentCount()

 if bname == "" or bname == nil then
  btnCn.Name = 'btn'..i
 else
  btnCn.Name = bname
 end


 local btnIco = createImage(btnCn)
 btnIco.Height = btnCn.Height-10
 btnIco.Width = btnIco.Height
 btnIco.setPosition(10, (btnCn.Height - btnIco.Height) / 2)
 btnIco.Anchors = '[akTop,akLeft,akRight,akBottom]'
 btnIco.Stretch = true
 btnIco.Picture.loadFromStream(findTableFile(ico).stream)

end
--------------------------------------- Example
myPicture1 = ("a11.png")
myPicture2 = ("a12.png")
myPicture3 = ("a13.png")
function func1()  end
function func2()  end
function func3()  end

f = createForm()
f.Caption = 'Test Custom Button With Icon'
createButtonIcon(f, 10,10, 200, 50, 1115250, myPicture1, 0xffffff, 14, 'Cheat Engine', nil, func1)
createButtonIcon(f, 40,65, 200, 50, 1231210, myPicture2, 0xffffff, 12, 'Auto Assembler', nil, func2)
createButtonIcon(f, 10,120, 200, 50, 0, myPicture3, 25250, 15, 'My Hack #1', nil, func3)


thanks again.

_________________
Hi Hitler Take control of your trainer
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 MSN Messenger
Corroder
Grandmaster Cheater Supreme
Reputation: 63

Joined: 10 Apr 2015
Posts: 1550

PostPosted: Wed Apr 01, 2020 5:07 am    Post subject: Reply with quote

Thanks, Aylin, It's free to edit or customize the function. I just show a basic example of this.
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
LongBeardedLion
Expert Cheater
Reputation: 0

Joined: 10 Apr 2020
Posts: 152

PostPosted: Thu Apr 23, 2020 5:42 am    Post subject: Reply with quote

So this works to inject this image inside a game?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Extensions 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 can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites