|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
mgr.inz.Player I post too much Reputation: 218
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Sat Dec 26, 2015 1:05 pm Post subject: Transparent Form [Lua plugin] |
|
|
Something similar to
http://forum.cheatengine.org/viewtopic.php?t=558001
Usage:
Code: | UDF1.BorderStyle = 'bsNone'
UDF1.Visible=true
makeFormTransparent(UDF1) |
Effect:
(I didn't have time to make better design)
Below code will add makeFormTransparent function. Tested with CE6.4.
Lua plugin source:
Code: | function makeFormTransparent(form)
form.Color = 0xFFFFFF
if cheatEngineIs64Bit() then
handle = readQwordLocal(userDataToInteger(form)+0x538)
script = [[
alloc(thread,128)
createthread(thread)
thread:
lea rsp,[rsp-40]
mov rcx,handle
mov edx,FFFFFFEC
call user32.GetWindowLongA
mov r8d,eax
or r8d,00080000
mov rcx,handle
mov edx,FFFFFFEC
call user32.SetWindowLongA
mov rcx,handle
mov edx,00FFFFFF //color white
mov r8d,000000FF
mov r9d,00000001
call user32.SetLayeredWindowAttributes
lea rsp,[rsp+40]
ret
]]
script=script:gsub('handle', string.format('%X',handle))
autoAssemble(script,true)
else
handle = bAnd( readQwordLocal(userDataToInteger(form)+0x330) , 0xFFFFFFFF)
script = [[
alloc(thread,128)
createthread(thread)
thread:
push -14
push handle
call user32.GetWindowLongA
or eax,80000
push eax
push -14
push handle
call user32.SetWindowLongA
push 01
push 000000FF
push 00FFFFFF
push handle
call user32.SetLayeredWindowAttributes
ret
]]
script=script:gsub('handle', string.format('%X',handle))
autoAssemble(script,true)
end
end |
When you want to release a trainer (CT, CETRAINER, EXE) paste above script at the top.
Attached plugin and examples below:
Description: |
plugin, paste it in autorun folder |
|
Download |
Filename: |
transparent.lua |
Filesize: |
1.27 KB |
Downloaded: |
870 Time(s) |
Description: |
|
Download |
Filename: |
makeFormTransparent - Full.CETRAINER |
Filesize: |
47.8 KB |
Downloaded: |
987 Time(s) |
Description: |
|
Download |
Filename: |
makeFormTransparent - Full.CT |
Filesize: |
47.8 KB |
Downloaded: |
1219 Time(s) |
Description: |
example (rely on autorun lua plugin) |
|
Download |
Filename: |
makeFormTransparent.CETRAINER |
Filesize: |
46.53 KB |
Downloaded: |
982 Time(s) |
Description: |
example (rely on autorun lua plugin) |
|
Download |
Filename: |
makeFormTransparent.CT |
Filesize: |
46.53 KB |
Downloaded: |
1196 Time(s) |
_________________
Last edited by mgr.inz.Player on Sat Dec 26, 2015 1:25 pm; edited 3 times in total |
|
Back to top |
|
|
lolAnonymous Expert Cheater Reputation: 1
Joined: 19 Jul 2015 Posts: 154
|
Posted: Sat Dec 26, 2015 1:21 pm Post subject: |
|
|
Thanks A lot bro love u
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25287 Location: The netherlands
|
Posted: Sat Dec 26, 2015 3:00 pm Post subject: |
|
|
an alternate method is
formname.SetShape(bitmap)
where bitmap has the exact same dimensions as the form and contains an image of the visible parts of the form.
it's not as easy as one color being transparent though (but it's probably more compatible with future CE versions. E.g when there's a lcl library update)
_________________
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 |
|
|
sjl002 Master Cheater Reputation: 0
Joined: 31 Aug 2013 Posts: 305
|
Posted: Sat Dec 26, 2015 7:54 pm Post subject: |
|
|
Very very thanks.
|
|
Back to top |
|
|
++METHOS I post too much Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Sat Dec 26, 2015 9:22 pm Post subject: |
|
|
Good job, mgr.inz.Player.
Actually, .png file can work better for transparency, in lieu of using white background...but maybe it's because of photoshop:
White background:
Transparent background (png):
The labels do not show well with no background...this holds true, regardless of font face and font size. I wonder if it would be possible to eliminate the excess white fuzz around the text?
Also, I wonder if true transparency without forcing alphablend is possible?
In the example above, partial transparency of png image is recognized for the form after activating LUA and changing the ShowInTaskBar settings. The changes are not permanent, however, upon compiling of exe...just the result of some bug.
I wonder how you were able to eliminate the wide fuzz around your image?
Last edited by ++METHOS on Sat Dec 26, 2015 9:27 pm; edited 1 time in total |
|
Back to top |
|
|
mgr.inz.Player I post too much Reputation: 218
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Sat Dec 26, 2015 9:26 pm Post subject: |
|
|
@Dark Byte, true. It can stop working.
Luckily, there's getCEVersion() function I can use for future CE versions.
Also, I made this patch (makes white color transparent):
http://pastebin.com/MRh8LiSS
If anyone wants to compile CE version with build-in TransparentNow().
@++METHOS, photoshop uses some kind of anti-aliasing.
You have to use, wait for it, Microsoft Paint
Result saved as png file, without alpha channel.
_________________
|
|
Back to top |
|
|
++METHOS I post too much Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Sat Dec 26, 2015 11:29 pm Post subject: |
|
|
mgr.inz.Player wrote: | You have to use, wait for it, Microsoft Paint |
...I will try it out.
P.S. The example that you provided in the OP would've worked great for my double dragon trainer. I would like to create a better interface when I have time. I think the transparency will be quite useful. Thanks!
|
|
Back to top |
|
|
mgr.inz.Player I post too much Reputation: 218
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Wed Dec 30, 2015 4:33 pm Post subject: |
|
|
@++METHOS
Quote: | The labels do not show well with no background |
For labels, you can use this:
Code: | UDF1.CELabel1.Font.Quality = 'fqNonAntialiased' |
@ALL, update.
Slightly different FormLayeredAttributes function:
Code: | function FormLayeredAttributes(form,colorkey,alpha,flag)
if form==nil then return false end
colorkey = colorkey or 0xFFFFFF
alpha = alpha or 0xFF
flag = flag or 1
if cheatEngineIs64Bit() then
handle = readQwordLocal(userDataToInteger(form)+0x538)
script = [[
alloc(thread,128)
createthread(thread)
thread:
lea rsp,[rsp-40]
mov rcx,handle
mov edx,FFFFFFEC
call user32.GetWindowLongA
mov r8d,eax
or r8d,00080000
mov rcx,handle
mov edx,FFFFFFEC
call user32.SetWindowLongA
mov rcx,handle
mov edx,colorkey
mov r8d,alpha
mov r9d,flag
call user32.SetLayeredWindowAttributes
lea rsp,[rsp+40]
ret
]]
script=script:gsub('handle', string.format('%X',handle)):gsub('colorkey', string.format('%X',colorkey))
script=script:gsub('alpha', string.format('%X',alpha)):gsub('flag', string.format('%X',flag))
autoAssemble(script,true)
else
handle = bAnd( readQwordLocal(userDataToInteger(form)+0x330) , 0xFFFFFFFF)
script = [[
alloc(thread,128)
createthread(thread)
thread:
push -14
push handle
call user32.GetWindowLongA
or eax,80000
push eax
push -14
push handle
call user32.SetWindowLongA
push flag
push alpha
push colorkey
push handle
call user32.SetLayeredWindowAttributes
ret
]]
script=script:gsub('handle', string.format('%X',handle)):gsub('colorkey', string.format('%X',colorkey))
script=script:gsub('alpha', string.format('%X',alpha)):gsub('flag', string.format('%X',flag))
autoAssemble(script,true)
end
end
LWA_COLORKEY = 1
LWA_ALPHA = 2 |
Code: | UDF1.BorderStyle = 'bsNone'
UDF1.Visible=true
UDF1.Color = 0xFFFFFF
UDF1.Constraints.MinWidth = UDF1.CEImage1.Width
UDF1.Constraints.MinHeight = UDF1.CEImage1.Height
FormLayeredAttributes(UDF1, UDF1.Color, 240, LWA_COLORKEY + LWA_ALPHA) |
Description: |
|
Download |
Filename: |
FormLayeredAttributes.CT |
Filesize: |
48.48 KB |
Downloaded: |
1264 Time(s) |
_________________
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25287 Location: The netherlands
|
Posted: Sat Jan 02, 2016 5:58 pm Post subject: |
|
|
In 6.5 you can use formname.setLayeredAttributes(Color, Alpha, flags)
_________________
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 |
|
|
webcondepot How do I cheat? Reputation: 0
Joined: 23 Apr 2016 Posts: 3
|
Posted: Sat Apr 23, 2016 8:10 am Post subject: How can i make red transparent |
|
|
How can i make red transparent
Last edited by webcondepot on Sun Apr 24, 2016 4:58 am; edited 1 time in total |
|
Back to top |
|
|
mgr.inz.Player I post too much Reputation: 218
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Sat Apr 23, 2016 10:11 am Post subject: |
|
|
just use setLayeredAttributes method added in CE6.5
Like this:
Code: | formname.setLayeredAttributes(0x0000FF, 240, 3) |
PS: Do not quote other people's whole post. Please edit your previous post.
_________________
|
|
Back to top |
|
|
webcondepot How do I cheat? Reputation: 0
Joined: 23 Apr 2016 Posts: 3
|
Posted: Sun Apr 24, 2016 5:18 am Post subject: |
|
|
mgr.inz.Player wrote: | just use setLayeredAttributes method added in CE6.5
Like this:
Code: | formname.setLayeredAttributes(0x0000FF, 240, 3) |
PS: Do not quote other people's whole post. Please edit your previous post. |
Not working bro.
Description: |
|
Filesize: |
308.28 KB |
Viewed: |
21216 Time(s) |
|
|
|
Back to top |
|
|
AylinCE Grandmaster Cheater Supreme Reputation: 31
Joined: 16 Feb 2017 Posts: 1247
|
Posted: Tue Jan 23, 2018 4:47 pm Post subject: CheckBox Backgraund Transparent! |
|
|
...
*********************************
This example worked nicely.
I created many transparent trainer.
But on some computers,
The CheckBox box is transparent and can not be enabled.
Is it possible to make an adjustment for this?
Thanks for sharing this fun.
Last edited by AylinCE on Sat Sep 05, 2020 5:42 am; edited 1 time in total |
|
Back to top |
|
|
movss Cheater Reputation: 0
Joined: 10 Feb 2018 Posts: 38
|
Posted: Sat Feb 10, 2018 3:14 pm Post subject: |
|
|
tks ,,it's useful
|
|
Back to top |
|
|
|
|
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
|
|