View previous topic :: View next topic |
Author |
Message |
Ayn How do I cheat? Reputation: 0
Joined: 30 Apr 2023 Posts: 4
|
Posted: Sun Apr 30, 2023 1:06 am Post subject: Custom Background for CE? |
|
|
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 |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1053 Location: 0x90
|
Posted: Sun Apr 30, 2023 3:23 am Post subject: |
|
|
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 |
|
|
Ayn How do I cheat? Reputation: 0
Joined: 30 Apr 2023 Posts: 4
|
Posted: Sun Apr 30, 2023 4:46 am Post subject: |
|
|
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 |
|
|
AylinCE Grandmaster Cheater Supreme Reputation: 31
Joined: 16 Feb 2017 Posts: 1234
|
|
Back to top |
|
|
Ayn How do I cheat? Reputation: 0
Joined: 30 Apr 2023 Posts: 4
|
Posted: Sun Apr 30, 2023 11:32 am Post subject: |
|
|
[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 |
|
|
AylinCE Grandmaster Cheater Supreme Reputation: 31
Joined: 16 Feb 2017 Posts: 1234
|
Posted: Sun Apr 30, 2023 11:46 am Post subject: |
|
|
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.
_________________
|
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1053 Location: 0x90
|
Posted: Sun Apr 30, 2023 12:15 pm Post subject: |
|
|
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.
I hope that explains it well enough.
|
|
Back to top |
|
|
Ayn How do I cheat? Reputation: 0
Joined: 30 Apr 2023 Posts: 4
|
Posted: Mon May 01, 2023 4:45 am Post subject: |
|
|
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.
I hope that explains it well enough. |
Thanks! I'll try that, What about image?
|
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1053 Location: 0x90
|
Posted: Mon May 01, 2023 8:06 am Post subject: |
|
|
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 |
|
|
AylinCE Grandmaster Cheater Supreme Reputation: 31
Joined: 16 Feb 2017 Posts: 1234
|
Posted: Mon May 01, 2023 8:35 am Post subject: |
|
|
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.
Description: |
|
Filesize: |
51.99 KB |
Viewed: |
1689 Time(s) |
|
_________________
|
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1053 Location: 0x90
|
Posted: Mon May 01, 2023 10:27 am Post subject: |
|
|
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 |
|
|
AylinCE Grandmaster Cheater Supreme Reputation: 31
Joined: 16 Feb 2017 Posts: 1234
|
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1053 Location: 0x90
|
Posted: Mon May 01, 2023 2:30 pm Post subject: |
|
|
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. )
|
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 |
|
|
AylinCE Grandmaster Cheater Supreme Reputation: 31
Joined: 16 Feb 2017 Posts: 1234
|
Posted: Mon May 01, 2023 4:50 pm Post subject: |
|
|
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.
_________________
|
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1053 Location: 0x90
|
Posted: Mon May 01, 2023 4:53 pm Post subject: |
|
|
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 |
|
|
|