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 


create RGB Button Background

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
kucingkembar
Advanced Cheater
Reputation: 0

Joined: 08 Oct 2020
Posts: 68

PostPosted: Mon Apr 04, 2022 2:53 am    Post subject: create RGB Button Background Reply with quote

hi, sorry again for my bad English,
I like to create a button with a background that changes color like the default "select a process to open" button when there no process is selected,
this is the code:
Code:

if form1 then form1.Destroy() end
form1 = createForm()
form1.setSize(80, 100)
form1.Position = "poScreenCenter"
form1.Caption = "CE RGB test"

ThePanel = createPanel(form1)
ThePanel.Width = 130
ThePanel.Height = 100

TheButton = createButton(ThePanel)
TheButton.Top = 35
TheButton.Left = 30
TheButton.Caption = "Button"

--loop start
ThePanel.Color = '0x66006600'
ThePanel.Color = '0x00660066'
--loop end

--the rest of the code


my problem is; how to make the changing color is an independent or separate process, so the "--the rest of the code" will run without stopping the changing color

thank you for reading, have a nice day
Back to top
View user's profile Send private message
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

Joined: 02 Sep 2011
Posts: 1053
Location: 0x90

PostPosted: Mon Apr 04, 2022 5:46 am    Post subject: Reply with quote

It doesn't fade between colours, but it does at least randomly select a colour and display it:
Code:

if form1 then form1.destroy(); form1 = nil end
form1 = createForm()
form1.setSize(80, 100)
form1.Position = "poScreenCenter"
form1.Caption = "CE RGB test"

ThePanel = createPanel(form1)
ThePanel.Width = 130
ThePanel.Height = 100

TheButton = createButton(ThePanel)
TheButton.Top = 35
TheButton.Left = 30
TheButton.Caption = "Button"

if TheTimer then TheTimer.destroy() TheTimer = nil end
TheTimer = createTimer(form1)
TheTimer.Interval = 150
TheTimer.Enabled = true
TheTimer.OnTimer = function()
                   -- Just select a random colour
                   local R = math.random(255)
                   local G = math.random(255)
                   local B = math.random(255)
                      ThePanel.Color = string.format("0x00%X", B..G..R)
                   end
Back to top
View user's profile Send private message
Frouk
Master Cheater
Reputation: 5

Joined: 22 Jun 2021
Posts: 489
Location: mov dword ptr [Ukraine]

PostPosted: Mon Apr 04, 2022 7:53 am    Post subject: Reply with quote

i just leave a link only link
_________________
void(__cdecl *Haxing)(HWND hGameWindow)
Back to top
View user's profile Send private message
kucingkembar
Advanced Cheater
Reputation: 0

Joined: 08 Oct 2020
Posts: 68

PostPosted: Mon Apr 04, 2022 9:58 am    Post subject: Reply with quote

@LeFiXER
Dude, thank you, why I do not think about put that inside the timer, silly me,
@Frouk
thank you for the link, I tried the Code you provide non-edited, but not work, I think I will study it
Back to top
View user's profile Send private message
Frouk
Master Cheater
Reputation: 5

Joined: 22 Jun 2021
Posts: 489
Location: mov dword ptr [Ukraine]

PostPosted: Mon Apr 04, 2022 9:59 am    Post subject: Reply with quote

kucingkembar wrote:
@LeFiXER
Dude, thank you, why I do not think about put that inside the timer, silly me,
@Frouk
thank you for the link, I tried the Code you provide non-edited, but not work, I think I will study it

code contains timer

_________________
void(__cdecl *Haxing)(HWND hGameWindow)
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
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