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 Background for CE?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Ayn
How do I cheat?
Reputation: 0

Joined: 30 Apr 2023
Posts: 4

PostPosted: Sun Apr 30, 2023 1:06 am    Post subject: Custom Background for CE? Reply with quote

Hulo, I'm kinda a newbie. I wanted to know if there is way to get a custom background image or even colour for CE. Thank you.

sterben#3608
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: Sun Apr 30, 2023 3:23 am    Post subject: Reply with quote

For colour, just use this. Format is 0xBGR. Hex colour codes but in reverse basically.
Code:

getMainForm().Color = 0x333333


Edit: you can save this as a file with the Lua extension and place it in the Cheat Engine autorun directory within the installation folder.
Back to top
View user's profile Send private message
Ayn
How do I cheat?
Reputation: 0

Joined: 30 Apr 2023
Posts: 4

PostPosted: Sun Apr 30, 2023 4:46 am    Post subject: Reply with quote

LeFiXER wrote:
For colour, just use this. Format is 0xBGR. Hex colour codes but in reverse basically.
Code:

getMainForm().Color = 0x333333


Edit: you can save this as a file with the Lua extension and place it in the Cheat Engine autorun directory within the installation folder.


Well how do i reverse it? This is the hex code of the colour i want 2f335f
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 31

Joined: 16 Feb 2017
Posts: 1234

PostPosted: Sun Apr 30, 2023 7:59 am    Post subject: Reply with quote

I'll edit it as open source when I have some free time.

https://forum.cheatengine.org/viewtopic.php?t=615397

_________________
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
Ayn
How do I cheat?
Reputation: 0

Joined: 30 Apr 2023
Posts: 4

PostPosted: Sun Apr 30, 2023 11:32 am    Post subject: Reply with quote

[quote="AylinCE"]I'll edit it as open source when I have some free time.



uhh, i don't know how to use this
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 31

Joined: 16 Feb 2017
Posts: 1234

PostPosted: Sun Apr 30, 2023 11:46 am    Post subject: Reply with quote

There is a Trainer download link there. And a usage video.
Download the trainer, watch the video.
I think the Trainer will do everything else.

_________________
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
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

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

PostPosted: Sun Apr 30, 2023 12:15 pm    Post subject: Reply with quote

Ayn wrote:
LeFiXER wrote:
For colour, just use this. Format is 0xBGR. Hex colour codes but in reverse basically.
Code:

getMainForm().Color = 0x333333


Edit: you can save this as a file with the Lua extension and place it in the Cheat Engine autorun directory within the installation folder.


Well how do i reverse it? This is the hex code of the colour i want 2f335f


Two characters represent each colour channel. Example

2F - Red
33 - Blue
5F - Green

The values are hexadecimal from 1 to 255 which determines the brightness of the colour, 1 being the darkest and 255 being the brightest. Well, to reverse them you simple change the order of the channels to green, blue and then red.
Code:

5F332F


I hope that explains it well enough.
Back to top
View user's profile Send private message
Ayn
How do I cheat?
Reputation: 0

Joined: 30 Apr 2023
Posts: 4

PostPosted: Mon May 01, 2023 4:45 am    Post subject: Reply with quote

LeFiXER wrote:
Ayn wrote:
LeFiXER wrote:
For colour, just use this. Format is 0xBGR. Hex colour codes but in reverse basically.
Code:

getMainForm().Color = 0x333333


Edit: you can save this as a file with the Lua extension and place it in the Cheat Engine autorun directory within the installation folder.


Well how do i reverse it? This is the hex code of the colour i want 2f335f


Two characters represent each colour channel. Example

2F - Red
33 - Blue
5F - Green

The values are hexadecimal from 1 to 255 which determines the brightness of the colour, 1 being the darkest and 255 being the brightest. Well, to reverse them you simple change the order of the channels to green, blue and then red.
Code:

5F332F


I hope that explains it well enough.




Thanks! I'll try that, What about image?
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 May 01, 2023 8:06 am    Post subject: Reply with quote

Code:

-- If the image component exists, destroy it so we don't create it multiple times
if p then p.destroy(); p = nil end
-- Retrieve the USERNAME variable from the OS's environment variables because everyone's username is different.
local username = os.getenv('USERNAME')

---------------

--[[
This assumes you have a picture called 'image.jpg' on the desktop. Of course, you can change the respective variable below to match the path of your own image.
--]]

local imagePath = 'C:\\Users\\' .. username .. '\\Desktop\\image.jpg'

--------

local mf = getMainForm()
-- Create an image and assign Cheat Engine's main form as the parent.
local p = createImage(mf)
-- Load the image from file
p.loadImageFromFile(imagePath)
-- Set the stretch property to true
p.Stretch = true
-- Set the width/height of the image component to match the main form of Cheat Engine
p.Width = mf.Width
p.Height = mf.Height


However, this is very slow especially when resizing Cheat Engine. Perhaps it is not the best method to use. You can see more of the properties/methods available for the image component class here: ../celua.txt#L1224


Last edited by LeFiXER on Mon May 01, 2023 9:25 am; edited 2 times in total
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 31

Joined: 16 Feb 2017
Posts: 1234

PostPosted: Mon May 01, 2023 8:35 am    Post subject: Reply with quote

Putting an image in the MainForm (CE main form) may be insufficient.
Because there are multiple Panels to split it.
You should aim to put images on the panels.

As an example there is an image below and the usage code is:

Code:
aPath = getAutorunPath() --CE autorun folder..
mf = getMainForm()
pctFile = aPath..[["yourFileName.png"]] -- or PNG or jpeg etc..

   if clrImg1 then clrImg1.Destroy() end
   local als=mf.Panel4
   clrImg1=createImage(als)
   clrImg1.Align=alClient
   clrImg1.Stretch=true
   clrImg1.sendToBack()
  clrImg1.loadImageFromFile(pctFile )


Just edit the image name in the above code.
Then paste the code into a ".lua" file and drop it in the CE>>autorun folder with the image to use.



ek2.png
 Description:
 Filesize:  51.99 KB
 Viewed:  1689 Time(s)

ek2.png



_________________
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
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

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

PostPosted: Mon May 01, 2023 10:27 am    Post subject: Reply with quote

AylinCE wrote:
Putting an image in the MainForm (CE main form) may be insufficient.
Because there are multiple Panels to split it.
You should aim to put images on the panels.
...


The code I provided does cover all panels also although I re-iterate, it's slow and inefficient. I guess it really depends on what the OP wants.
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 31

Joined: 16 Feb 2017
Posts: 1234

PostPosted: Mon May 01, 2023 1:51 pm    Post subject: Reply with quote

Your code will hide the image behind the panels and will not be visible.

What I'm trying to say is to target the panels it's split into, not the MainForm.
Here is an image and code:

(I changed the image name. I don't like objects assigned with a single letter. Smile )
Code:
local mf = getMainForm()
local p1 = createImage(mf.Panel5)
p1.loadImageFromFile(imagePath)
p1.Stretch = true
p1.Width = mf.Panel5.Width
p1.Height = mf.Panel5.Height
p1.bringToFront()



ek4.PNG
 Description:
 Filesize:  111.59 KB
 Viewed:  1663 Time(s)

ek4.PNG



_________________
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
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

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

PostPosted: Mon May 01, 2023 2:30 pm    Post subject: Reply with quote

AylinCE wrote:
Your code will hide the image behind the panels and will not be visible.


That's the point of setting the background image. You don't want the image to obscure labels which are meant to be seen.

AylinCE wrote:

What I'm trying to say is to target the panels it's split into, not the MainForm.



Correct, the main form of Cheat Engine is parent to several controls.


AylinCE wrote:

(I changed the image name. I don't like objects assigned with a single letter. Smile )


I'm not sure what you mean by this exactly.

AylinCE wrote:

Here is an image and code:

Code:
local mf = getMainForm()
local p1 = createImage(mf.Panel5)
p1.loadImageFromFile(imagePath)
p1.Stretch = true
p1.Width = mf.Panel5.Width
p1.Height = mf.Panel5.Height
p1.bringToFront()


I don't see the image within your post. Although, things can be altered based on the particular requirements needed.
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 31

Joined: 16 Feb 2017
Posts: 1234

PostPosted: Mon May 01, 2023 4:50 pm    Post subject: Reply with quote

It seems "barren" to me that the objects (Constructed objects) are made up of a single character.
It seems more logical to start within the framework where they can continue.

-- for example:
Code:
f=createForm()
p=createImage(f)
l=createLabel(f)

instead of:
Code:
f1=createForm()
p1=createImage(f1)
l1=createLabel(f1)


Of course this is my opinion.
You name the objects as you wish.
Either way, there won't be an incorrect "syntax" as a result.



_________________
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
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

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

PostPosted: Mon May 01, 2023 4:53 pm    Post subject: This post has 1 review(s) Reply with quote

AylinCE wrote:
It seems "barren" to me that the objects (Constructed objects) are made up of a single character.
It seems more logical to start within the framework where they can continue.

-- for example:
Code:
f=createForm()
p=createImage(f)
l=createLabel(f)

instead of:
Code:
f1=createForm()
p1=createImage(f1)
l1=createLabel(f1)


Of course this is my opinion.
You name the objects as you wish.
Either way, there won't be an incorrect "syntax" as a result.
...


Ah, okay. For quick snippets of coding I use shortform for component names where possible. If there is some length to the code posted then I use more meaningful names because ambiguity can be a big problem, even with your method.
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 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