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 


3D Text Effect / Text Shadow Cheat Engine

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Sun Aug 30, 2020 9:47 am    Post subject: 3D Text Effect / Text Shadow Cheat Engine Reply with quote

Just bored, so play around with simple text shadow (3D) trick using CE Lua.

Here is the short script:

Code:
local p = {}

function Command1_Click()
 CurrentX,CurrentY = p1.getPosition()
 a = CurrentX
 b = CurrentY
 for i = 1, 20 do
     p[i] = createLabel(f)
     p[i].Font.Size = 48
     p[i].Font.Color = 0
     p[i].Caption = "CHEAT ENGINE"
     a = a + 0.5
     b = b + 0.5
     CurrentX = a
     CurrentY = b
     p[i].setPosition(CurrentX,CurrentY)
     if i == 20 then p[i].Font.Color = 0xffffff end
 end
end


if f then f.destroy() end

f = createForm()
f.Position = 'poScreenCenter'
f.setSize(500,100)
f.Caption = 'Cheat Engine 3D Text Effect - Example by Corroder'

p1 = createLabel(f)
p1.setPosition(28,0)
p1.color = 0

f.show()
Command1_Click()


Enjoy Razz Razz



Capture.JPG
 Description:
3D Text Effect CE
 Filesize:  26.17 KB
 Viewed:  1424 Time(s)

Capture.JPG



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

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Mon Aug 31, 2020 10:07 am    Post subject: Reply with quote

Another test with form glass effect


Capture2.JPG
 Description:
Glass Effect with blue bg
 Filesize:  58.51 KB
 Viewed:  1385 Time(s)

Capture2.JPG



Capture.JPG
 Description:
Glass Effect with black bg
 Filesize:  59.3 KB
 Viewed:  1385 Time(s)

Capture.JPG



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

Joined: 13 Sep 2018
Posts: 189

PostPosted: Mon Aug 31, 2020 10:34 am    Post subject: Reply with quote

Corroder wrote:
Another test with form glass effect
Can glass effect, form translucency, label partial translucency and borderless shadow be realized in ce7.1? Can you upload a CT for me to test?
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Mon Aug 31, 2020 11:24 am    Post subject: Reply with quote

@lua : Here is the script:

Code:
function DwmExtendFrameIntoClientArea(hWnd, pMarInset)
 return executeCodeLocalEx("dwmapi.DwmExtendFrameIntoClientArea", hWnd, pMarInset)
end

function DwmEnableBlurBehindWindow(hwnd, ref)
 return executeCodeLocalEx("dwmapi.DwmEnableBlurBehindWindow", hWnd, ref)
end

function DwmIsCompositionEnabled(en)
 return executeCodeLocalEx("dwmapi.DwmIsCompositionEnabled",en)
end

function DwmSetWindowAttribute(hwnd, attr, attrValue, attrSize)
 return executeCodeLocalEx("dwmapi.DwmSetWindowAttribute", hwnd, attr, attrValue, attrSize)
end

function glassForm(hwnd, Ver, v, l, r, t, b)
 DwmSetWindowAttribute(hwnd, 2, v, 4)
 margins = createMemoryStream()
 margins.writeDword(l)
 margins.writeDword(r)
 margins.writeDword(t)
 margins.writeDword(b)
 DwmIsCompositionEnabled(Ver)
 DwmExtendFrameIntoClientArea(hwnd, margins.Memory)
end

function SetClassLong(hwnd, nIndex, dwNewLong)
 return executeCodeLocalEx("user32.SetClassLongA", hwnd, nIndex, dwNewLong)
end

function GetClassLong(hwnd, nIndex, dwNewLong)
 return executeCodeLocalEx("user32.GetClassLongA", hwnd, nIndex)
end

CS_DropSHADOW = 0x20000
GCL_STYLE = (-26)
------------------------------------------------------

if f then f.destroy() end

f = createForm()
f.Position = 'poScreenCenter'
f.BorderStyle = 'bsNone'
f.setSize(500,400)
f.color = 16760576

p1 = createLabel(f)
p1.setPosition(28,140)
p1.color = 0

local p = {}

function Command1_Click()
 CurrentX,CurrentY = p1.getPosition()
 a = CurrentX
 b = CurrentY
 for i = 1, 20 do
     p[i] = createLabel(f)
     p[i].Font.Size = 48
     p[i].Font.Color = 0
     p[i].Caption = "CHEAT ENGINE"
     a = a + 0.5
     b = b + 0.5
     CurrentX = a
     CurrentY = b
     p[i].setPosition(CurrentX,CurrentY)
     if i == 20 then p[i].Font.Color = 0xffffff end
 end
end

DWM_BLURBEHIND = {dwFlags, fEnable, hRgnBlur, fTransitionOnMaximized}
DWM_BB_ENABLE = 0x1
DWM_BB_BLURREGION  = 0x2
DWM_BB_TRANSITIONONMAXIMIZED = 0x4

bb = DWM_BLURBEHIND
bb.dwFlags = 1
bb.fEnable = true
bb.hRgnBlur = nil

f.color = 16760576
DwmEnableBlurBehindWindow(f.Handle, bb)
glassForm(f.handle, 6.2, 2, -1,-1,-1,-1)
SetClassLong(f.Handle, GCL_STYLE, GetClassLong(f.Handle, GCL_STYLE) | CS_DropSHADOW)
Command1_Click()

f.show()
f.OnMouseDown = function() f.dragNow() end
Command1_Click()

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

Joined: 13 Sep 2018
Posts: 189

PostPosted: Tue Sep 01, 2020 3:39 am    Post subject: Reply with quote

Corroder wrote:
@lua : Here is the script:Your function failed my test.
Code:
glassForm(f.handle, 6.2, 2, -1,-1,-1,-1)

The above function prompts this:(Error:Access violation)


I have a few more questions to explain:
first:
Code:
f.FormStyle='fsSystemStayOnTop'
Shadows do not appear at the top when other forms are displayed。
second:Is there any way to change the depth, width, and color of shadows。
Third:can the form have shadow all around?
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Tue Sep 01, 2020 10:51 am    Post subject: Reply with quote

Answer 1:
CS_DropSHADOW = 0x20000
GCL_STYLE = (-26)

Only show Shadow for form with border style 'bsNone' and only show shadow on right and bottom of the form (Vista style).

Answer 2:
Yes, by using GDI lib logic (some of GDI functions already have in CE)
I did make drop shadow with depth, size and color in C#/VB. I try to port the script to CE Lua, but is not successful yet. Some C# script/function that I don't know how to write in CE Lua.

Answer 3: Yes, look Answer 2

Note:
DropShadow and dwmapi functions will difference for each Windows version. DropShadow on work for Vista to Windows 7. In Windows 8 to 10, drop shadow using set component attributes.

Beside, in Windows 7, to take drop shadow effect, the Windows 7 setting must change to 'Show shadow under menu' (google for this)

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

Joined: 13 Sep 2018
Posts: 189

PostPosted: Wed Sep 02, 2020 12:32 am    Post subject: Reply with quote

UpdateLayeredwindow + GDI seems to be able to implement shadows as well
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