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 


Is there a way to mark a CEImage by clicking on it?
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Razi
Expert Cheater
Reputation: 1

Joined: 17 Jan 2018
Posts: 202

PostPosted: Thu Mar 21, 2019 12:25 pm    Post subject: Reply with quote

@Aylin, This is what I needed. I just put a CEImage with an orange square on the form and added a few lines of code
Code:
for x = 0, 31 do
UDF1['CEImage'..1+x].OnClick = function(sender)
UDF1.CEImage65.setPosition(UDF1['CEImage'..1+x].Left-8, UDF1['CEImage'..1+x].Top-8)
end
end

@Corroder, This example suits me too.
One more question. How to change the color of an object without RGB?
Code:
UDF1.CEPanel1.Color = 0xff0000 --code works
UDF1.CEPanel1.Color = clMenuBar --does not work with OnClick
UDF1.CEPanel1.Color = clDefault  --does not work with OnClick

I want to get the same color that is created by default on the form.
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Thu Mar 21, 2019 1:28 pm    Post subject: Reply with quote

Quote:
I want to get the same color that is created by default on the form.


Put under onClick function.

option 1 :
1. make a new CEPanel (Don't change the color of this CEPanel, leave it as default color) -- say this : CEPanel1
2. set this CEPanel1.visible = false (hide somewhere on UDF1)
3. Now, to get other CEPanel color same with CEPanel1 color :

Code:
UDF1.CEPanel1.visible = false
function chgColor()
 defaultclr = UDF1.CEPanel1.getColor()
 UDF1.CEPanel2.Color = defaultclr   ---- and other CEPanel..xx
end

UDF1.show()
UDF1.CEPanel1.onClick = chgColor


or

Code:
UDF1.CEPanel2.Color = UDF1.CEPanel1.Color



Option 2 :
You can directly change CEPanel color using free pascal color code.
e.q : clBlack = $000000 in free pascal or = 0x000000 in hexadecimal code (able to use in CE)
Complete standard free pascal color code list, see link below :

http://wiki.freepascal.org/Colors

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
Razi
Expert Cheater
Reputation: 1

Joined: 17 Jan 2018
Posts: 202

PostPosted: Thu Mar 21, 2019 4:17 pm    Post subject: Reply with quote

@Dark Byte, @Corroder, @Aylin: Thanks a lot
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 Lua Scripting All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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