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 


[HELP]How to make color transparent

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

Joined: 14 Aug 2018
Posts: 36

PostPosted: Sun Sep 02, 2018 9:38 am    Post subject: [HELP]How to make color transparent Reply with quote

CE the GUI ScrollBox and Picture.
How to make color transparent?

I want to make Picture on the bottom.
ScrollBox the color make color transparent.
ScrollBox can see Picture.
Picture not throw in ScrollBox.

I try to change the color to none, no effect.



3.png
 Description:
 Filesize:  2.16 KB
 Viewed:  2479 Time(s)

3.png



2.png
 Description:
 Filesize:  2.22 KB
 Viewed:  2479 Time(s)

2.png



1.jpg
 Description:
 Filesize:  2.52 KB
 Viewed:  2509 Time(s)

1.jpg



_________________
I have a lot of kinds of code language is the whole stack engineer.
Boring time, discovered that I liked to the development of cheat.
I hope I can in CheatEngine make lots of friends.
qwq Study together, come on.
Back to top
View user's profile Send private message Send e-mail
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Mon Sep 03, 2018 6:40 pm    Post subject: Reply with quote

This sample below not made using CE Form Designer. It is use CE lua.
Lend @freeER function, should be something like this :


Code:
LWA_COLORKEY = 1
LWA_ALPHA = 2

function makeFormTransparent(form, colorkey, alpha, flag)
 if form==nil or not form.className or form.className ~= 'TCEForm' then return false end
 colorkey = colorkey or 0x00FFFFFF
 alpha = alpha or 0xFF
 flag = flag or LWA_COLORKEY
 form.setLayeredAttributes(colorkey, alpha, flag)
end

function makeColor(r,g,b)
 local colorBitShiftRed = 0
 local colorBitShiftBlue = 16
 local colorBitShiftGreen = 8
 local function clamp(value, min, max) return math.min(math.max(value, min), max) end
 r = clamp(r, 0, 255); g = clamp(g, 0, 255); b = clamp(b, 0, 255);
 return (r << colorBitShiftRed) | (g << colorBitShiftGreen) | (b << colorBitShiftBlue)
end

function createScrollBox(Parent)
 local box = createComponentClass('TScrollBox', Parent)
 box.Parent = Parent
 return box
end

-- ===================================== -- GUI
myform = createForm()

a = createScrollBox(myform)
a.Top = 40
a.Left = 10
a.Width = 280
a.Height = 100
a.VertScrollBar.Increment = 500
a.VertScrollBar.Page = 80
a.VertScrollBar.Smooth = true
a.VertScrollBar.Range = 300

t1 = createLabel(a)
t1.Top = 10
t1.Left = 10
t1.Caption = 'TEXT 1. Test this text on transparent'

t2 = createLabel(a)
t2.Top = t1.Top + 50
t2.Left = 10
t2.Caption = 'TEXT 2. Test this text on transparent'

local col = makeColor(100,100,100) --- Change number to make any colors
local f = myform  -- your form name
f.Color = col
makeFormTransparent(f, col)

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
acgofficial
Cheater
Reputation: 0

Joined: 14 Aug 2018
Posts: 36

PostPosted: Mon Sep 03, 2018 7:33 pm    Post subject: Reply with quote

Corroder wrote:
This sample below not made using CE Form Designer. It is use CE lua.
Lend @freeER function, should be something like this :


Code:
LWA_COLORKEY = 1
LWA_ALPHA = 2

function makeFormTransparent(form, colorkey, alpha, flag)
 if form==nil or not form.className or form.className ~= 'TCEForm' then return false end
 colorkey = colorkey or 0x00FFFFFF
 alpha = alpha or 0xFF
 flag = flag or LWA_COLORKEY
 form.setLayeredAttributes(colorkey, alpha, flag)
end

function makeColor(r,g,b)
 local colorBitShiftRed = 0
 local colorBitShiftBlue = 16
 local colorBitShiftGreen = 8
 local function clamp(value, min, max) return math.min(math.max(value, min), max) end
 r = clamp(r, 0, 255); g = clamp(g, 0, 255); b = clamp(b, 0, 255);
 return (r << colorBitShiftRed) | (g << colorBitShiftGreen) | (b << colorBitShiftBlue)
end

function createScrollBox(Parent)
 local box = createComponentClass('TScrollBox', Parent)
 box.Parent = Parent
 return box
end

-- ===================================== -- GUI
myform = createForm()

a = createScrollBox(myform)
a.Top = 40
a.Left = 10
a.Width = 280
a.Height = 100
a.VertScrollBar.Increment = 500
a.VertScrollBar.Page = 80
a.VertScrollBar.Smooth = true
a.VertScrollBar.Range = 300

t1 = createLabel(a)
t1.Top = 10
t1.Left = 10
t1.Caption = 'TEXT 1. Test this text on transparent'

t2 = createLabel(a)
t2.Top = t1.Top + 50
t2.Left = 10
t2.Caption = 'TEXT 2. Test this text on transparent'

local col = makeColor(100,100,100) --- Change number to make any colors
local f = myform  -- your form name
f.Color = col
makeFormTransparent(f, col)


Surprised I don't understand, why so complicated, it's hard, really shouldn't use the code......
Thank you for your reply, I appreciate it.
I want to use to transparent color is not worried.
I think waiting for the next update.
I think not use the code is better!

_________________
I have a lot of kinds of code language is the whole stack engineer.
Boring time, discovered that I liked to the development of cheat.
I hope I can in CheatEngine make lots of friends.
qwq Study together, come on.
Back to top
View user's profile Send private message Send e-mail
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Tue Sep 04, 2018 2:02 am    Post subject: Reply with quote

This because you posted your case at 'Cheat Engine Lua Scripting' .

So, the script above was on lua script to show transparent scrollbox.
Just note, there is no transparent color for scrollbox made using CE Form Designer.

I am not sure if DB shall put new option/menu inside Form Designer for transparent scrollbox or other CE form sub classes.

If you are not interesting to learn lua script, then just leave that script above as a junk...nothing ro worry about.. Razz

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
acgofficial
Cheater
Reputation: 0

Joined: 14 Aug 2018
Posts: 36

PostPosted: Tue Sep 04, 2018 3:39 am    Post subject: Reply with quote

Corroder wrote:
This because you posted your case at 'Cheat Engine Lua Scripting' .

So, the script above was on lua script to show transparent scrollbox.
Just note, there is no transparent color for scrollbox made using CE Form Designer.

I am not sure if DB shall put new option/menu inside Form Designer for transparent scrollbox or other CE form sub classes.

If you are not interesting to learn lua script, then just leave that script above as a junk...nothing ro worry about.. Razz


Don't laugh, although no lua, make GUI picture color instead of transparent color, this is a stupid way, however, this is just for non-native English speakers.

Shocked I am a Chinese, I just don't want to use the code to change the color of the picture of the transparent color.

So I would be very grateful to the authors updated version.

_________________
I have a lot of kinds of code language is the whole stack engineer.
Boring time, discovered that I liked to the development of cheat.
I hope I can in CheatEngine make lots of friends.
qwq Study together, come on.
Back to top
View user's profile Send private message Send e-mail
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