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 


Change Panel color

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
EyeNE
Newbie cheater
Reputation: 0

Joined: 24 Jul 2020
Posts: 13

PostPosted: Sun Sep 13, 2020 12:57 am    Post subject: Change Panel color Reply with quote

I know this is simple but I kinda forgot how to do it
Anyways I need a code that once I click the panel It changes color (blue) for 1 second and changes back to original color (white)
example

function CEPanel2Click(sender)
sender.color = "$0095151F"
sleep(2000)
sender.color = "$00F4F4F4"
end

Tried doing this but didnt work

_________________
Something is off about me..
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25813
Location: The netherlands

PostPosted: Sun Sep 13, 2020 2:56 am    Post subject: Reply with quote

remove the quotes and replace $ with 0x
_________________
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
View user's profile Send private message MSN Messenger
AylinCE
Grandmaster Cheater Supreme
Reputation: 37

Joined: 16 Feb 2017
Posts: 1531

PostPosted: Sun Sep 13, 2020 5:19 am    Post subject: Reply with quote

Here is a code that meets all effect. Idea

Add this code to your project.

Code:
---------- Panel Effect -----------

function panelClickEffect(item2, fsize, text, thint)
local item2 = item2
local color1="0xff8f00"
item2.BevelColor=color1
item2.Font.Size=fsize item2.BevelInner="bvRaised" item2.BevelWidth=3 item2.Font.Color="0x000000"
item2.Font.Style="fsBold" item2.Hint=thint item2.ShowHint=true item2.OptimalFill=true
item2.Font.Name="Georgia" item2.Cursor=-21 item2.Color="0xffff00"
item2.caption = text

item2.OnMouseMove=function() item2.BevelColor="0x00ffff" end
item2.OnMouseLeave=function() item2.BevelColor=color1 end

item2.OnMouseDown=function() item2.Color="0x00ffff" end
item2.OnMouseUp=function() item2.Color="0xffff00" end

end


And edit the control below to use it.

Code:
----------- Effect Control ---
panelClickEffect(CETrainer.CEPanel1, 8, "Click me! (pnl1)", "Please click me. (pnl1)")
--CETrainer or UDF1 or YouTrainerName?


Here is a use case;

Code:
if f then f.destroy() end
f=createForm(true)
f.Position=poDesktopCenter

local p1=createPanel(f) p1.Height=40 p1.Width=130 p1.Left=20 p1.Top=20
local p2=createPanel(f) p2.Height=40 p2.Width=130 p2.Left=170 p2.Top=20
local p3=createPanel(f) p3.Height=40 p3.Width=130 p3.Left=20 p3.Top=80
local p4=createPanel(f) p4.Height=40 p4.Width=130 p4.Left=170 p4.Top=80

---------- Panel Effect -----------

function panelClickEffect(item2, fsize, text, thint)
local item2 = item2
local color1="0xff8f00"
item2.BevelColor=color1
item2.Font.Size=fsize item2.BevelInner="bvRaised" item2.BevelWidth=3 item2.Font.Color="0x000000"
item2.Font.Style="fsBold" item2.Hint=thint item2.ShowHint=true item2.OptimalFill=true
item2.Font.Name="Georgia" item2.Cursor=-21 item2.Color="0xffff00"
item2.caption = text

item2.OnMouseMove=function() item2.BevelColor="0x00ffff" end
item2.OnMouseLeave=function() item2.BevelColor=color1 end

item2.OnMouseDown=function() item2.Color="0x00ffff" end
item2.OnMouseUp=function() item2.Color="0xffff00" end

end

----------- Control ----------
panelClickEffect(p1, 8, "Click me! (pnl1)", "Please click me. (pnl1)")
panelClickEffect(p2, 9, "Click me! (pnl2)", "Please click me, I'm better. (pnl2)")
panelClickEffect(p3, 10, "Click me! (pnl3)", "Please click me. (pnl3)")
panelClickEffect(p4, 7, "Don't click me! (pnl4)", "It's okay if you don't click me. (pnl4)")


Enjoy it! Wink

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
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 Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting 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