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 


How to make panel and other controls transparent

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
.lua
Expert Cheater
Reputation: 1

Joined: 13 Sep 2018
Posts: 189

PostPosted: Sat Dec 07, 2019 4:19 am    Post subject: How to make panel and other controls transparent Reply with quote

As shown in the figure, this is the Lazarus IDE programming interface。
I also think that since the cheat engine was developed by Lazarus, it should also inherit many of its functions



Panel transparent.png
 Description:
 Filesize:  22.05 KB
 Viewed:  4778 Time(s)

Panel transparent.png


Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Sat Dec 07, 2019 8:19 am    Post subject: Reply with quote

There are no problems with Panel in CE. Just be sure you have ParentBackground set to true.


Problem is with other controls. Try with TEdit inside Lazarus IDE.

_________________
Back to top
View user's profile Send private message MSN Messenger
.lua
Expert Cheater
Reputation: 1

Joined: 13 Sep 2018
Posts: 189

PostPosted: Sat Dec 07, 2019 8:53 am    Post subject: Reply with quote

mgr.inz.Player wrote:
There are no problems with Panel in CE. Just be sure you have ParentBackground set to true.
Panel does not appear to have parentbackground property
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Sat Dec 07, 2019 9:36 am    Post subject: Reply with quote

Lol. You are right. CE7.0+ has it. Well, there is workaround for official CE7.0.
_________________
Back to top
View user's profile Send private message MSN Messenger
.lua
Expert Cheater
Reputation: 1

Joined: 13 Sep 2018
Posts: 189

PostPosted: Sat Dec 07, 2019 9:44 am    Post subject: Reply with quote

mgr.inz.Player wrote:
Lol. You are right. CE7.0+ has it. Well, there is workaround for official CE7.0.
The CE7.0 panel is transparent by default, but my code will report an error when it runs in 7.0
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Sat Dec 07, 2019 10:32 am    Post subject: Reply with quote

Code:
function setParentBackground(panel,v)
  if inheritsFromWinControl(panel) then
    local offset = cheatEngineIs64Bit() and 0x158 or 0xD0

    local FControlStyleAddress = userDataToInteger(panel) + offset
    local FControlStyle = readIntegerLocal(FControlStyleAddress)

    if v then
      FControlStyle = FControlStyle | 0x200000
      FControlStyle = FControlStyle & (~0x40)
    else
      FControlStyle = FControlStyle & (~0x200000)
      FControlStyle = FControlStyle | 0x40
    end

    writeIntegerLocal(FControlStyleAddress, FControlStyle)
    panel.repaint()
  end
end

--  CE7.1 and above
--  UDF1.CEPanel1.ParentBackground = true

-- CE7.0
setParentBackground(UDF1.CEPanel1, true)

_________________
Back to top
View user's profile Send private message MSN Messenger
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Sat Dec 07, 2019 10:34 am    Post subject: Reply with quote

try panel=createComponentClass("TPanel", udf1)
_________________
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
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Sat Dec 07, 2019 10:49 am    Post subject: Reply with quote

Right. There is TPanel and TCEPanel. And in CE7.0+ there are the same.


In CE7.0 you can select TCEPanel in form designer, just click on panel then press CTRL+X
paste to notepad and change line with
Code:
object CEPanel1: TCEPanel

to (last word in that line)
Code:
object CEPanel1: TPanel

copy from notepad then click UDF1 window and press CTRL+V


That way you can convert from TCEPanel to TPanel.

EDIT:
Better method: with form designer, click menu file, save LFM, edit LFM file with notepad (replace TCEPanel with TPanel), form designer, click menu file, "load LFM".

_________________


Last edited by mgr.inz.Player on Sat Dec 07, 2019 11:55 am; edited 2 times in total
Back to top
View user's profile Send private message MSN Messenger
.lua
Expert Cheater
Reputation: 1

Joined: 13 Sep 2018
Posts: 189

PostPosted: Sat Dec 07, 2019 10:57 am    Post subject: Reply with quote

Are other controls, such as edit, the same


22.png
 Description:
 Filesize:  11.75 KB
 Viewed:  4706 Time(s)

22.png


Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Sat Dec 07, 2019 11:12 am    Post subject: Reply with quote

You have Lazarus IDE. If you find an easy way to do transparent TEdit, we can replicate it in CE, I guess.
_________________
Back to top
View user's profile Send private message MSN Messenger
.lua
Expert Cheater
Reputation: 1

Joined: 13 Sep 2018
Posts: 189

PostPosted: Sat Dec 07, 2019 11:26 am    Post subject: Reply with quote

mgr.inz.Player wrote:
You have Lazarus IDE. If you find an easy way to do transparent TEdit, we can replicate it in CE, I guess.
If I find a way, I will announce it as soon as possible
Back to top
View user's profile Send private message
.lua
Expert Cheater
Reputation: 1

Joined: 13 Sep 2018
Posts: 189

PostPosted: Sun Dec 08, 2019 12:16 pm    Post subject: Reply with quote

mgr.inz.Player wrote:
You have Lazarus IDE. If you find an easy way to do transparent TEdit, we can replicate it in CE, I guess.
I found that when the edit box is disabled or read-only, it can be transparent, but it can't edit the text
Code:
form.edit.Enabled=false
form.edit.ReadOnly=true
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