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 


Please solve this images round up loop
Goto page 1, 2  Next
 
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: 1668

PostPosted: Sun Aug 02, 2020 8:47 pm    Post subject: Please solve this images round up loop Reply with quote

Say I have this script to animating 3 panels (or images) movement.

Code:
if f then f.destroy() end
if t then t.destroy() end

f = createForm()
f.setSize(600,400)
f.Position = 'poScreenCenter'
f.BorderStyle = 'bsSingle'

imL = createPanel(f)
imL.setSize(100,100)
imL.setPosition(50,150)
imL.Font.Size = 48
imL.Caption = '1'
imL.Color = 0xff00

imC = createPanel(f)
imC.setSize(200,200)
imC.setPosition(200,100)
imC.Font.Size = 48
imC.Caption = '2'
imC.Color = 0x00ff

imR = createPanel(f)
imR.setSize(100,100)
imR.setPosition(450,150)
imR.Font.Size = 48
imR.Caption = '3'
imR.Color = 0xffff

local a = 10
local b = 5
local c = 15
local d = 25
local e = 40
local img1 = imL
local img2 = imC
local img3 = imR

function roundUp()
 t.Enabled = true
 img1.Height = img1.Height + a
 img1.Width =  img1.Width + a
 img1.Top = img1.Top - b
 img1.Left = img1.Left + c
 img1.bringToFront()

 img2.Height = img2.Height - a
 img2.Width = img2.Width - a
 img2.Top = img2.Top + b
 img2.Left = img2.Left + d

 img3.Left = img3.Left - e
 img3.sendToBack()

 if img1.Left == 200 then   -- round 1
    t.Enabled = false
    img2 = imR
    img3 = imL
    img1 = imC
 end

 if img3.Left == 200 then  -- round 2
    t.Enabled = false
    img1 = imR
    img2 = imL
    img3 = imC
 end

end

t = createTimer()
t.Interval = 50
t.Enabled = false
t.OnTimer = roundUp

f.OnClick = roundUp


The script above will show one round complete images movement (image 1 position, move to position 2, then position 3 and back to his original position), follows by other images movement with synchronizing.
But, that logic only work for one round movement with right positions for each image. The next round have wrong logic.
So, please solve the problem and probably also have solution for some movement logic if more than 3 images.

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

Joined: 16 Feb 2017
Posts: 1432

PostPosted: Mon Aug 03, 2020 12:15 am    Post subject: Reply with quote

I agree with you. After a certain intensity, the brain gives "ERROR". Smile
It requires complex accounts.
But your code is now working properly.
If you want, 5-10 panels can be made. If the idea that the code will be extended is considered positive. Wink

Code:
if f then f.destroy() end

f = createForm()
f.setSize(600,400)
f.Position = 'poScreenCenter'
f.BorderStyle = 'bsSingle'

imL = createPanel(f)
imL.setSize(100,100)
imL.setPosition(50,150)
imL.Font.Size = 48
imL.Caption = '1'
imL.Color = 0xff00

imC = createPanel(f)
imC.setSize(200,200)
imC.setPosition(200,100)
imC.Font.Size = 48
imC.Caption = '2'
imC.Color = 0x00ff

imR = createPanel(f)
imR.setSize(100,100)
imR.setPosition(450,150)
imR.Font.Size = 48
imR.Caption = '3'
imR.Color = 0xffff

if t1 then t1.destroy() end
t1 = createTimer() t1.Interval=50 t1.Enabled=false

if t2 then t2.destroy() end
t2 = createTimer() t2.Interval=50 t2.Enabled=false

if t3 then t3.destroy() end
t3 = createTimer() t3.Interval=50 t3.Enabled=false

-------------------------------------
function slide1(pan1)
if pan1.left==200 then
t1.Enabled=true end
t1.OnTimer=function()
pan1.bringToFront()
pan1.left=pan1.left + 26
pan1.Width=pan1.Width - 10
pan1.Height=pan1.Height -10
pan1.top=pan1.top + 5
if pan1.left==460 then pan1.setSize(100,100) pan1.left=450 t1.Enabled=false end
end
end

function slide2(pan2)
if pan2.left==450 then
t2.Enabled=true end
t2.OnTimer=function()
pan2.sendToBack()
pan2.left=pan2.left - 41
if pan2.left==40 then pan2.setPosition(50,150) t2.Enabled=false end
end
end

function slide3(pan3)
if pan3.left==50 then
t3.Enabled=true end
t3.OnTimer=function()
pan3.bringToFront()
pan3.left=pan3.left + 16
pan3.Width=pan3.Width + 10
pan3.Height=pan3.Height + 10
pan3.top=pan3.top - 5
if pan3.left==210 then pan3.setSize(200,200) pan3.left=200 t3.Enabled=false end
end
end

function play1()
if imL.left==450 then slide2(imL) end
if imL.left==50 then slide3(imL) end
if imL.left==200 then slide1(imL) end
if imC.left==200 then  slide1(imC) end
if imC.left==450 then  slide2(imC) end
if imC.left==50 then  slide3(imC) end
if imR.Left==200 then slide1(imR) end
if imR.Left==450 then slide2(imR) end
if imR.Left==50 then slide3(imR) end
end


f.OnClick=function() play1() end

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Mon Aug 03, 2020 4:03 am    Post subject: Reply with quote

Bravo Aylin, you solve the problem. Your code work properly. Thank you.
Meanwhile, I try to find other possible solutions for this.
Because that is easy to make it using HTML, CSS and JS script. They have that 'Carousel Center Mode' or 'Slick Mode' for swipe / slide images.

Yeah, what I am trying to do is make a Carousel Center Mode Image Slider using CE Lua.

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

Joined: 16 Feb 2017
Posts: 1432

PostPosted: Mon Aug 03, 2020 4:28 am    Post subject: Reply with quote

How many pictures will there be?
There were some ideas while looking at the code;
Rotate other images around the main image in a hexagonal or octagonal circle.
Or with the current code; Behind the main picture, store more than three pictures.
As the idea is formed, the codes are also approaching. Smile

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Mon Aug 03, 2020 5:37 am    Post subject: Reply with quote

Aylin wrote:
How many pictures will there be?


It's depends on the user. Mean, user allow to open his image folder using file dialog.

How many images will show on the carousel slide?. Maybe six or ten by default.

For example:
https://www.youtube.com/watch?v=GUGziWMXK-4

and
https://www.youtube.com/watch?v=OJ6P_K6l2fo

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

Joined: 16 Feb 2017
Posts: 1432

PostPosted: Mon Aug 03, 2020 6:17 am    Post subject: Reply with quote

The function in the second video looks great.
This can be difficult at CE Lua.
But I will try to increase the 3 tables to 6-10 tables. Wink

Carousel view for ElementFlow:
https://www.youtube.com/watch?v=OJ6P_K6l2fo


EDIT :
And final Wink

Here is the calculation prepared for 7 panels.
If you want, use it for a 7-game Trainer.
To show the picture if you want.
Next and Selection function are included.

Code:
if f then f.destroy() end

f = createForm()
f.setSize(600,400) f.Position='poScreenCenter' f.BorderStyle='bsSingle'

im1=createPanel(f) im1.Width=120 im1.Height=120 im1.Left=240 im1.Top=175
im1.Font.Size=40 im1.Caption='1' im1.Color=0xffffe8 im1.bringToFront()

im2=createPanel(f) im2.Width=70 im2.Height=70 im2.Left=160 im2.Top=150
im2.Font.Size=30 im2.Caption='2' im2.Color=0xfff9e0 im2.sendToBack()

im3=createPanel(f) im3.Width=70 im3.Height=70 im3.Left=85 im3.Top=125
im3.Font.Size=30 im3.Caption='3' im3.Color=0xfffeaf im3.sendToBack()

im4=createPanel(f) im4.Width=70 im4.Height=70 im4.Left=10 im4.Top=100
im4.Font.Size=30 im4.Caption='4' im4.Color=0xf0ff99 im4.sendToBack()

im5=createPanel(f) im5.Width=70 im5.Height=70 im5.Left=520 im5.Top=100
im5.Font.Size=30 im5.Caption='5' im5.Color=0xd0e940 im5.sendToBack()

im6=createPanel(f) im6.Width=70 im6.Height=70 im6.Left=445 im6.Top=125
im6.Font.Size=30 im6.Caption='6' im6.Color=0xd1ce00 im6.bringToFront()

im7=createPanel(f) im7.Width=70 im7.Height=70 im7.Left=370 im7.Top=150
im7.Font.Size=30 im7.Caption='7' im7.Color=0xd1b000 im7.sendToBack()

im8=createPanel(f) im8.Width=120 im8.Height=30 im8.Left=240 im8.Top=360
im8.Font.Size=14 im8.Caption='Select' im8.Color=0xffff00 im8.cursor= -21

im9=createPanel(f) im9.Width=120 im9.Height=30 im9.Left=420 im9.Top=360
im9.Font.Size=14 im9.Caption='Next >' im9.Color=0xffff00 im9.cursor= -21

if t1 then t1.destroy() end
t1 = createTimer() t1.Interval=50 t1.Enabled=false

if t2 then t2.destroy() end
t2 = createTimer() t2.Interval=50 t2.Enabled=false

if t3 then t3.destroy() end
t3 = createTimer() t3.Interval=50 t3.Enabled=false

if t4 then t4.destroy() end
t4 = createTimer() t4.Interval=50 t4.Enabled=false

if t5 then t5.destroy() end
t5 = createTimer() t5.Interval=50 t5.Enabled=false

if t6 then t6.destroy() end
t6 = createTimer() t6.Interval=50 t6.Enabled=false

if t7 then t7.destroy() end
t7 = createTimer() t7.Interval=50 t7.Enabled=false

if t8 then t8.destroy() end
t8 = createTimer() t8.Interval=50 t8.Enabled=false

if t9 then t9.destroy() end
t9 = createTimer() t9.Interval=50 t9.Enabled=false

-------------------------------------
function slide1(pan1)
if pan1.left==240 then
t1.Enabled=true end
t1.OnTimer=function()
pan1.bringToFront()
pan1.left=pan1.left + 27
pan1.Width=pan1.Width - 10
pan1.Height=pan1.Height -10
pan1.top=pan1.top - 5
if pan1.left==375 then pan1.setSize(70,70) pan1.left=370 t1.Enabled=false end
end
end

function slide2(pan2)
if pan2.left==370 then
t2.Enabled=true end
t2.OnTimer=function()
pan2.bringToFront()
pan2.left=pan2.left + 16
pan2.top=pan2.top - 5
if pan2.left==450 then pan2.Left=445 pan2.Top=125 t2.Enabled=false end
end
end

function slide3(pan3)
if pan3.left==445 then
t3.Enabled=true end
t3.OnTimer=function()
pan3.bringToFront()
pan3.left=pan3.left + 16
pan3.top=pan3.top - 5
if pan3.left==525 then pan3.Left=520 pan3.Top=100 t3.Enabled=false end
end
end

function slide4(pan4)
if pan4.left==520 then
t4.Enabled=true end
t4.OnTimer=function()
pan4.sendToBack()
pan4.left=pan4.left - 105
if pan4.left==-5 then pan4.Left=10 t4.Enabled=false end
end
end

function slide5(pan5)
if pan5.left==10 then
t5.Enabled=true end
t5.OnTimer=function()
pan5.bringToFront()
pan5.left=pan5.left + 16
pan5.top=pan5.top + 5
if pan5.left==90 then pan5.Left=85 pan5.Top=125 t5.Enabled=false end
end
end

function slide6(pan6)
if pan6.left==85 then
t6.Enabled=true end
t6.OnTimer=function()
pan6.bringToFront()
pan6.left=pan6.left + 16
pan6.top=pan6.top + 5
if pan6.left==165 then pan6.Left=160 pan6.Top=150 t6.Enabled=false end
end
end

function slide7(pan7)
if pan7.left==160 then
t7.Enabled=true end
t7.OnTimer=function()
pan7.bringToFront()
pan7.left=pan7.left + 17
pan7.top=pan7.top + 5
pan7.Width=pan7.Width + 10
pan7.Height=pan7.Height + 10
if pan7.left==245 then pan7.Left=240 pan7.Top=175 pan7.setSize(120,120) pan7.bringToFront() t7.Enabled=false end
end
end
-----------------------------------------
local slc=false
local slcPn=im1

t8.OnTimer=function()
slcPn.Width=slcPn.Width + 20
slcPn.Height=slcPn.Height + 20
slcPn.left=slcPn.left - 10
slcPn.top=slcPn.top - 10
if slcPn.Width==220 then t8.Enabled=false end
end

function play1()
if im1.left==240 then slide1(im1) end
if im1.left==370 then slide2(im1) end
if im1.left==445 then slide3(im1) end
if im1.left==520 then slide4(im1) end
if im1.left==10 then slide5(im1) end
if im1.left==85 then slide6(im1) end
if im1.Left==160 then slcPn=im1 slide7(im1) end

if im2.left==240 then slide1(im2) end
if im2.left==370 then slide2(im2) end
if im2.left==445 then slide3(im2) end
if im2.left==520 then slide4(im2) end
if im2.left==10 then slide5(im2) end
if im2.left==85 then slide6(im2) end
if im2.Left==160 then slcPn=im2 slide7(im2) end

if im3.left==240 then slide1(im3) end
if im3.left==370 then slide2(im3) end
if im3.left==445 then slide3(im3) end
if im3.left==520 then slide4(im3) end
if im3.left==10 then slide5(im3) end
if im3.left==85 then slide6(im3) end
if im3.Left==160 then slcPn=im3 slide7(im3) end

if im4.left==240 then slide1(im4) end
if im4.left==370 then slide2(im4) end
if im4.left==445 then slide3(im4) end
if im4.left==520 then slide4(im4) end
if im4.left==10 then slide5(im4) end
if im4.left==85 then slide6(im4) end
if im4.Left==160 then slcPn=im4 slide7(im4) end

if im5.left==240 then slide1(im5) end
if im5.left==370 then slide2(im5) end
if im5.left==445 then slide3(im5) end
if im5.left==520 then slide4(im5) end
if im5.left==10 then slide5(im5) end
if im5.left==85 then slide6(im5) end
if im5.Left==160 then slcPn=im5 slide7(im5) end

if im6.left==240 then slide1(im6) end
if im6.left==370 then slide2(im6) end
if im6.left==445 then slide3(im6) end
if im6.left==520 then slide4(im6) end
if im6.left==10 then slide5(im6) end
if im6.left==85 then slide6(im6) end
if im6.Left==160 then slcPn=im6 slide7(im6) end

if im7.left==240 then slide1(im7) end
if im7.left==370 then slide2(im7) end
if im7.left==445 then slide3(im7) end
if im7.left==520 then slide4(im7) end
if im7.left==10 then slide5(im7) end
if im7.left==85 then slide6(im7) end
if im7.Left==160 then slcPn=im7 slide7(im7) end
end

im8.OnClick=function()
if slcPn.Width==220 then t8.Enabled=false
else
slc=true slcPn.bringToFront() t8.Enabled=true
end
end

t9.OnTimer=function()
slcPn.Width=slcPn.Width - 20
slcPn.Height=slcPn.Height - 20
slcPn.left=slcPn.left + 10
slcPn.top=slcPn.top + 10
if slcPn.Width==120 then slcPn="" slc=false play1() t9.Enabled=false end
end

im9.OnClick=function()
if slc==true then
t9.Enabled=true
else
play1()
end
end

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Tue Aug 04, 2020 5:52 am    Post subject: Reply with quote

Great! @Aylin. The logic explained how the carousel movement.
But that will be more excellent if the layout like picture attached.

Congratulations and thanks.



Capture.JPG
 Description:
 Filesize:  30.41 KB
 Viewed:  7284 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
AylinCE
Grandmaster Cheater Supreme
Reputation: 34

Joined: 16 Feb 2017
Posts: 1432

PostPosted: Tue Aug 04, 2020 3:58 pm    Post subject: This post has 1 review(s) Reply with quote

Corroder wrote:
But that will be more excellent if the layout like picture attached.


Final Smile
Select, load and slide image. Wink

Code:
if f then f.destroy() end

f = createForm()
f.setSize(600,400) f.Position='poScreenCenter' f.BorderStyle='bsSingle'

im1=createPanel(f) im1.Width=120 im1.Height=120 im1.Left=240 im1.Top=175
im1.Font.Size=40 im1.Caption='1' im1.Color=0xffffe8 im1.bringToFront()

im2=createPanel(f) im2.Width=70 im2.Height=70 im2.Left=160 im2.Top=150
im2.Font.Size=30 im2.Caption='2' im2.Color=0xfff9e0 im2.sendToBack()

im3=createPanel(f) im3.Width=70 im3.Height=70 im3.Left=85 im3.Top=125
im3.Font.Size=30 im3.Caption='3' im3.Color=0xfffeaf im3.sendToBack()

im4=createPanel(f) im4.Width=70 im4.Height=70 im4.Left=10 im4.Top=100
im4.Font.Size=30 im4.Caption='4' im4.Color=0xf0ff99 im4.sendToBack()

im5=createPanel(f) im5.Width=70 im5.Height=70 im5.Left=520 im5.Top=100
im5.Font.Size=30 im5.Caption='5' im5.Color=0xd0e940 im5.sendToBack()

im6=createPanel(f) im6.Width=70 im6.Height=70 im6.Left=445 im6.Top=125
im6.Font.Size=30 im6.Caption='6' im6.Color=0xd1ce00 im6.bringToFront()

im7=createPanel(f) im7.Width=70 im7.Height=70 im7.Left=370 im7.Top=150
im7.Font.Size=30 im7.Caption='7' im7.Color=0xd1b000 im7.sendToBack()

im8=createPanel(f) im8.Width=120 im8.Height=30 im8.Left=240 im8.Top=360
im8.Font.Size=14 im8.Caption='Select' im8.Color=0xffff00 im8.cursor= -21

im9=createPanel(f) im9.Width=120 im9.Height=30 im9.Left=420 im9.Top=360
im9.Font.Size=14 im9.Caption='Next >' im9.Color=0xffff00 im9.cursor= -21

----------------------
local pic1=createImage(im1) pic1.setSize(0,0)
pic1.Width=im1.Width pic1.Height=im1.Height pic1.Stretch=true

local pic2=createImage(im2) pic2.setPosition(0,0)
pic2.Width=im2.Width pic2.Height=im2.Height pic2.Stretch=true

local pic3=createImage(im3) pic3.setPosition(0,0)
pic3.Width=im3.Width pic3.Height=im3.Height pic3.Stretch=true

local pic4=createImage(im4) pic4.setPosition(0,0)
pic4.Width=im4.Width pic4.Height=im4.Height pic4.Stretch=true

local pic5=createImage(im5) pic5.setPosition(0,0)
pic5.Width=im5.Width pic5.Height=im5.Height pic5.Stretch=true

local pic6=createImage(im6) pic6.setPosition(0,0)
pic6.Width=im6.Width pic6.Height=im6.Height pic6.Stretch=true

local pic7=createImage(im7) pic7.setPosition(0,0)
pic7.Width=im7.Width pic7.Height=im7.Height pic7.Stretch=true
----------------------

if t1 then t1.destroy() end
t1 = createTimer() t1.Interval=50 t1.Enabled=false

if t2 then t2.destroy() end
t2 = createTimer() t2.Interval=50 t2.Enabled=false

if t3 then t3.destroy() end
t3 = createTimer() t3.Interval=50 t3.Enabled=false

if t4 then t4.destroy() end
t4 = createTimer() t4.Interval=50 t4.Enabled=false

if t5 then t5.destroy() end
t5 = createTimer() t5.Interval=50 t5.Enabled=false

if t6 then t6.destroy() end
t6 = createTimer() t6.Interval=50 t6.Enabled=false

if t7 then t7.destroy() end
t7 = createTimer() t7.Interval=50 t7.Enabled=false

if t8 then t8.destroy() end
t8 = createTimer() t8.Interval=50 t8.Enabled=false

if t9 then t9.destroy() end
t9 = createTimer() t9.Interval=50 t9.Enabled=false

-------------------------------------
function slide1(pan1, img1)
if pan1.left==240 then
t1.Enabled=true end
t1.OnTimer=function()
pan1.bringToFront()
pan1.left=pan1.left + 27
pan1.Width=pan1.Width - 10
pan1.Height=pan1.Height -10
pan1.top=pan1.top - 5
if pan1.left==375 then pan1.setSize(70,70) pan1.left=370 t1.Enabled=false end
pan1.OnResize=function()
img1.Width=pan1.Width img1.Height=pan1.Height
end
end
end

function slide2(pan2, img2)
if pan2.left==370 then
t2.Enabled=true end
t2.OnTimer=function()
pan2.bringToFront()
pan2.left=pan2.left + 16
pan2.top=pan2.top - 5
if pan2.left==450 then pan2.Left=445 pan2.Top=125 t2.Enabled=false end
pan2.OnResize=function()
img2.Width=pan2.Width img2.Height=pan2.Height
end
end
end

function slide3(pan3, img3)
if pan3.left==445 then
t3.Enabled=true end
t3.OnTimer=function()
pan3.bringToFront()
pan3.left=pan3.left + 16
pan3.top=pan3.top - 5
if pan3.left==525 then pan3.Left=520 pan3.Top=100 t3.Enabled=false end
pan3.OnResize=function()
img3.Width=pan3.Width img3.Height=pan3.Height
end
end
end

function slide4(pan4, img4)
if pan4.left==520 then
t4.Enabled=true end
t4.OnTimer=function()
pan4.sendToBack()
pan4.left=pan4.left - 105
if pan4.left==-5 then pan4.Left=10 t4.Enabled=false end
pan4.OnResize=function()
img4.Width=pan4.Width img4.Height=pan4.Height
end
end
end

function slide5(pan5, img5)
if pan5.left==10 then
t5.Enabled=true end
t5.OnTimer=function()
pan5.bringToFront()
pan5.left=pan5.left + 16
pan5.top=pan5.top + 5
if pan5.left==90 then pan5.Left=85 pan5.Top=125 t5.Enabled=false end
pan5.OnResize=function()
img5.Width=pan5.Width img5.Height=pan5.Height
end
end
end

function slide6(pan6, img6)
if pan6.left==85 then
t6.Enabled=true end
t6.OnTimer=function()
pan6.bringToFront()
pan6.left=pan6.left + 16
pan6.top=pan6.top + 5
if pan6.left==165 then pan6.Left=160 pan6.Top=150 t6.Enabled=false end
pan6.OnResize=function()
img6.Width=pan6.Width img6.Height=pan6.Height
end
end
end

function slide7(pan7, img7)
if pan7.left==160 then
t7.Enabled=true end
t7.OnTimer=function()
pan7.bringToFront()
pan7.left=pan7.left + 17
pan7.top=pan7.top + 5
pan7.Width=pan7.Width + 10
pan7.Height=pan7.Height + 10
if pan7.left==245 then pan7.Left=240 pan7.Top=175 pan7.setSize(120,120) pan7.bringToFront() t7.Enabled=false end
pan7.OnResize=function()
img7.Width=pan7.Width img7.Height=pan7.Height
end
end
end
-----------------------------------------
local slc = false
local slcPn = im1
local slcImg = pic1

t8.OnTimer=function()
slcPn.Width=slcPn.Width + 20
slcPn.Height=slcPn.Height + 20
slcPn.left=slcPn.left - 10
slcPn.top=slcPn.top - 10
slcImg.Width=slcPn.Width slcImg.Height=slcPn.Height
if slcPn.Width==220 then t8.Enabled=false end
end

function play1()
if im1.left==240 then slide1(im1, pic1) end
if im1.left==370 then slide2(im1, pic1) end
if im1.left==445 then slide3(im1, pic1) end
if im1.left==520 then slide4(im1, pic1) end
if im1.left==10 then slide5(im1, pic1) end
if im1.left==85 then slide6(im1, pic1) end
if im1.Left==160 then slcPn=im1  slcImg=pic1 slide7(im1, pic1) end

if im2.left==240 then slide1(im2, pic2) end
if im2.left==370 then slide2(im2, pic2) end
if im2.left==445 then slide3(im2, pic2) end
if im2.left==520 then slide4(im2, pic2) end
if im2.left==10 then slide5(im2, pic2) end
if im2.left==85 then slide6(im2, pic2) end
if im2.Left==160 then slcPn=im2  slcImg=pic2 slide7(im2, pic2) end

if im3.left==240 then slide1(im3, pic3) end
if im3.left==370 then slide2(im3, pic3) end
if im3.left==445 then slide3(im3, pic3) end
if im3.left==520 then slide4(im3, pic3) end
if im3.left==10 then slide5(im3, pic3) end
if im3.left==85 then slide6(im3, pic3) end
if im3.Left==160 then slcPn=im3  slcImg=pic3 slide7(im3, pic3) end

if im4.left==240 then slide1(im4, pic4) end
if im4.left==370 then slide2(im4, pic4) end
if im4.left==445 then slide3(im4, pic4) end
if im4.left==520 then slide4(im4, pic4) end
if im4.left==10 then slide5(im4, pic4) end
if im4.left==85 then slide6(im4, pic4) end
if im4.Left==160 then slcPn=im4  slcImg=pic4 slide7(im4, pic4) end

if im5.left==240 then slide1(im5, pic5) end
if im5.left==370 then slide2(im5, pic5) end
if im5.left==445 then slide3(im5, pic5) end
if im5.left==520 then slide4(im5, pic5) end
if im5.left==10 then slide5(im5, pic5) end
if im5.left==85 then slide6(im5, pic5) end
if im5.Left==160 then slcPn=im5  slcImg=pic5 slide7(im5, pic5) end

if im6.left==240 then slide1(im6, pic6) end
if im6.left==370 then slide2(im6, pic6) end
if im6.left==445 then slide3(im6, pic6) end
if im6.left==520 then slide4(im6, pic6) end
if im6.left==10 then slide5(im6, pic6) end
if im6.left==85 then slide6(im6, pic6) end
if im6.Left==160 then slcPn=im6  slcImg=pic6 slide7(im6, pic6) end

if im7.left==240 then slide1(im7, pic7) end
if im7.left==370 then slide2(im7, pic7) end
if im7.left==445 then slide3(im7, pic7) end
if im7.left==520 then slide4(im7, pic7) end
if im7.left==10 then slide5(im7, pic7) end
if im7.left==85 then slide6(im7, pic7) end
if im7.Left==160 then slcPn=im7  slcImg=pic7 slide7(im7, pic7) end
end

im8.OnClick=function()
if slcPn.Width==220 then t8.Enabled=false
else
slc=true slcPn.bringToFront() t8.Enabled=true
end
end

t9.OnTimer=function()
slcPn.Width=slcPn.Width - 20
slcPn.Height=slcPn.Height - 20
slcPn.left=slcPn.left + 10
slcPn.top=slcPn.top + 10
slcImg.Width=slcPn.Width slcImg.Height=slcPn.Height
if slcPn.Width==120 then slcPn="" slc=false play1() t9.Enabled=false end
end

im9.OnClick=function()
if slc==true then
t9.Enabled=true
else
play1()
end
end

------------ upload or change picture

function selectImage(imgPic)
local file_dialog = createOpenDialog()
file_dialog.InitialDir = 'C:\\'  --os.getenv('%USERPROFILE%')  -- or set to dir/folder which exe file placed
file_dialog.Filter = 'Image files|*.PNG;*.png|All files (*.*)|*'

if file_dialog.execute() then
   local file_name = file_dialog.FileName
   print(file_name)
   imgPic.picture.loadFromFile(file_name)
   return
else
   return nil
end
end

pic1.OnClick=function()
if im1.Width==220 then
local answer = messageDialog("You are about to upload images to the box or replace the existing image.\nDo you confirm?", mtWarning, mbYes, mbNo)
if answer == mrYes then
selectImage(pic1) end
else
messageDialog("Error! First move the box to the front and select it.", mtWarning, mbYes)
end
end

pic2.OnClick=function()
if im2.Width==220 then
local answer = messageDialog("You are about to upload images to the box or replace the existing image.\nDo you confirm?", mtWarning, mbYes, mbNo)
if answer == mrYes then
selectImage(pic2) end
else
messageDialog("Error! First move the box to the front and select it.", mtWarning, mbYes)
end
end

pic3.OnClick=function()
if im3.Width==220 then
local answer = messageDialog("You are about to upload images to the box or replace the existing image.\nDo you confirm?", mtWarning, mbYes, mbNo)
if answer == mrYes then
selectImage(pic3) end
else
messageDialog("Error! First move the box to the front and select it.", mtWarning, mbYes)
end
end

pic4.OnClick=function()
if im4.Width==220 then
local answer = messageDialog("You are about to upload images to the box or replace the existing image.\nDo you confirm?", mtWarning, mbYes, mbNo)
if answer == mrYes then
selectImage(pic4) end
else
messageDialog("Error! First move the box to the front and select it.", mtWarning, mbYes)
end
end

pic5.OnClick=function()
if im5.Width==220 then
local answer = messageDialog("You are about to upload images to the box or replace the existing image.\nDo you confirm?", mtWarning, mbYes, mbNo)
if answer == mrYes then
selectImage(pic5) end
else
messageDialog("Error! First move the box to the front and select it.", mtWarning, mbYes)
end
end

pic6.OnClick=function()
if im6.Width==220 then
local answer = messageDialog("You are about to upload images to the box or replace the existing image.\nDo you confirm?", mtWarning, mbYes, mbNo)
if answer == mrYes then
selectImage(pic6) end
else
messageDialog("Error! First move the box to the front and select it.", mtWarning, mbYes)
end
end

pic7.OnClick=function()
if im7.Width==220 then
local answer = messageDialog("You are about to upload images to the box or replace the existing image.\nDo you confirm?", mtWarning, mbYes, mbNo)
if answer == mrYes then
selectImage(pic7) end
else
messageDialog("Error! First move the box to the front and select it.", mtWarning, mbYes)
end
end



EDIT : And 7 panels Trainer version;


Code:
if f then f.destroy() end

f = createForm()
f.setSize(600,400) f.Position='poScreenCenter' f.BorderStyle='bsSingle'

im1=createPanel(f) im1.Width=120 im1.Height=120 im1.Left=240 im1.Top=175
im1.Font.Size=40 im1.Caption='1' im1.Color=0xffffe8 im1.bringToFront()

im2=createPanel(f) im2.Width=70 im2.Height=70 im2.Left=160 im2.Top=150
im2.Font.Size=30 im2.Caption='2' im2.Color=0xfff9e0 im2.sendToBack()

im3=createPanel(f) im3.Width=70 im3.Height=70 im3.Left=85 im3.Top=125
im3.Font.Size=30 im3.Caption='3' im3.Color=0xfffeaf im3.sendToBack()

im4=createPanel(f) im4.Width=70 im4.Height=70 im4.Left=10 im4.Top=100
im4.Font.Size=30 im4.Caption='4' im4.Color=0xf0ff99 im4.sendToBack()

im5=createPanel(f) im5.Width=70 im5.Height=70 im5.Left=520 im5.Top=100
im5.Font.Size=30 im5.Caption='5' im5.Color=0xd0e940 im5.sendToBack()

im6=createPanel(f) im6.Width=70 im6.Height=70 im6.Left=445 im6.Top=125
im6.Font.Size=30 im6.Caption='6' im6.Color=0xd1ce00 im6.bringToFront()

im7=createPanel(f) im7.Width=70 im7.Height=70 im7.Left=370 im7.Top=150
im7.Font.Size=30 im7.Caption='7' im7.Color=0xd1b000 im7.sendToBack()

im8=createPanel(f) im8.Width=120 im8.Height=30 im8.Left=240 im8.Top=360
im8.Font.Size=14 im8.Caption='Select' im8.Color=0xffff00 im8.cursor= -21

im9=createPanel(f) im9.Width=120 im9.Height=30 im9.Left=420 im9.Top=360
im9.Font.Size=14 im9.Caption='Next >' im9.Color=0xffff00 im9.cursor= -21

if t1 then t1.destroy() end
t1 = createTimer() t1.Interval=50 t1.Enabled=false

if t2 then t2.destroy() end
t2 = createTimer() t2.Interval=50 t2.Enabled=false

if t3 then t3.destroy() end
t3 = createTimer() t3.Interval=50 t3.Enabled=false

if t4 then t4.destroy() end
t4 = createTimer() t4.Interval=50 t4.Enabled=false

if t5 then t5.destroy() end
t5 = createTimer() t5.Interval=50 t5.Enabled=false

if t6 then t6.destroy() end
t6 = createTimer() t6.Interval=50 t6.Enabled=false

if t7 then t7.destroy() end
t7 = createTimer() t7.Interval=50 t7.Enabled=false

if t8 then t8.destroy() end
t8 = createTimer() t8.Interval=50 t8.Enabled=false

if t9 then t9.destroy() end
t9 = createTimer() t9.Interval=50 t9.Enabled=false

-------------------------------
local slc=false
local slcPn=im1
------------------------------- Trainer
local tra1=createPanel(f) tra1.Height=220 tra1.Width=220
tra1.Left=190 tra1.Top=125 tra1.bringToFront() tra1.visible=false tra1.color=slcPn.color
local traDesc=createLabel(tra1) traDesc.Left=10 traDesc.Top=5 traDesc.caption=slcPn.caption..". Game"
traDesc.AutoSize=false traDesc.Alignment="taCenter" traDesc.Font.Size=18 traDesc.Width=200 traDesc.Height=30
local traB1=createButton(tra1) traB1.Left=130 traB1.Top=60 traB1.caption="OFF"
local traB2=createButton(tra1) traB2.Left=130 traB2.Top=90 traB2.caption="OFF"
local traL1=createLabel(tra1) traL1.Left=10 traL1.Top=64 traL1.caption="Cash Hack ........."
local traL2=createLabel(tra1) traL2.Left=10 traL2.Top=94 traL2.caption="Coins Hack ........."

------------------------------- Hack Code
function Hack1() showMessage("1. Game Cash code is active") traB1.caption="ON" end
function Hack2() showMessage("1. Game Coins code is active") traB2.caption="ON" end
function Hack3() showMessage("2. Game Cash code is active") traB1.caption="ON" end
function Hack4() showMessage("2. Game Coins code is active") traB2.caption="ON" end
function Hack5() showMessage("3. Game Cash code is active") traB1.caption="ON" end
function Hack6() showMessage("3. Game Coins code is active") traB2.caption="ON" end
function Hack7() showMessage("4. Game Cash code is active") traB1.caption="ON" end
function Hack8() showMessage("4. Game Coins code is active") traB2.caption="ON" end
function Hack9() showMessage("5. Game Cash code is active") traB1.caption="ON" end
function Hack10() showMessage("5. Game Coins code is active") traB2.caption="ON" end
function Hack11() showMessage("6. Game Cash code is active") traB1.caption="ON" end
function Hack12() showMessage("6. Game Coins code is active") traB2.caption="ON" end
function Hack13() showMessage("7. Game Cash code is active") traB1.caption="ON" end
function Hack14() showMessage("7. Game Coins code is active") traB2.caption="ON" end
------------------------------- Trainer Buttons
traB1.OnClick=function()
if slcPn==im1 then Hack1() end
if slcPn==im2 then Hack3() end
if slcPn==im3 then Hack5() end
if slcPn==im4 then Hack7() end
if slcPn==im5 then Hack9() end
if slcPn==im6 then Hack11() end
if slcPn==im7 then Hack13() end
end

traB2.OnClick=function()
if slcPn==im1 then Hack2() end
if slcPn==im2 then Hack4() end
if slcPn==im3 then Hack6() end
if slcPn==im4 then Hack8() end
if slcPn==im5 then Hack10() end
if slcPn==im6 then Hack12() end
if slcPn==im7 then Hack14() end
end


-------------------------------

function slide1(pan1)
if pan1.left==240 then
t1.Enabled=true end
t1.OnTimer=function()
pan1.bringToFront()
pan1.left=pan1.left + 27
pan1.Width=pan1.Width - 10
pan1.Height=pan1.Height -10
pan1.top=pan1.top - 5
if pan1.left==375 then pan1.setSize(70,70) pan1.left=370 t1.Enabled=false end
end
end

function slide2(pan2)
if pan2.left==370 then
t2.Enabled=true end
t2.OnTimer=function()
pan2.bringToFront()
pan2.left=pan2.left + 16
pan2.top=pan2.top - 5
if pan2.left==450 then pan2.Left=445 pan2.Top=125 t2.Enabled=false end
end
end

function slide3(pan3)
if pan3.left==445 then
t3.Enabled=true end
t3.OnTimer=function()
pan3.bringToFront()
pan3.left=pan3.left + 16
pan3.top=pan3.top - 5
if pan3.left==525 then pan3.Left=520 pan3.Top=100 t3.Enabled=false end
end
end

function slide4(pan4)
if pan4.left==520 then
t4.Enabled=true end
t4.OnTimer=function()
pan4.sendToBack()
pan4.left=pan4.left - 105
if pan4.left==-5 then pan4.Left=10 t4.Enabled=false end
end
end

function slide5(pan5)
if pan5.left==10 then
t5.Enabled=true end
t5.OnTimer=function()
pan5.bringToFront()
pan5.left=pan5.left + 16
pan5.top=pan5.top + 5
if pan5.left==90 then pan5.Left=85 pan5.Top=125 t5.Enabled=false end
end
end

function slide6(pan6)
if pan6.left==85 then
t6.Enabled=true end
t6.OnTimer=function()
pan6.bringToFront()
pan6.left=pan6.left + 16
pan6.top=pan6.top + 5
if pan6.left==165 then pan6.Left=160 pan6.Top=150 t6.Enabled=false end
end
end

function slide7(pan7)
if pan7.left==160 then
t7.Enabled=true end
t7.OnTimer=function()
pan7.bringToFront()
pan7.left=pan7.left + 17
pan7.top=pan7.top + 5
pan7.Width=pan7.Width + 10
pan7.Height=pan7.Height + 10
if pan7.left==245 then pan7.Left=240 pan7.Top=175 pan7.setSize(120,120) pan7.bringToFront() t7.Enabled=false end
end
end
-----------------------------------------

t8.OnTimer=function()
slcPn.Width=slcPn.Width + 20
slcPn.Height=slcPn.Height + 20
slcPn.left=slcPn.left - 10
slcPn.top=slcPn.top - 10
if slcPn.Width==220 then tra1.bringToFront() traDesc.caption=slcPn.caption..". Game"
tra1.color=slcPn.color tra1.visible=true t8.Enabled=false end
end

function play1()
if im1.left==240 then slide1(im1) end
if im1.left==370 then slide2(im1) end
if im1.left==445 then slide3(im1) end
if im1.left==520 then slide4(im1) end
if im1.left==10 then slide5(im1) end
if im1.left==85 then slide6(im1) end
if im1.Left==160 then slcPn=im1 slide7(im1) end

if im2.left==240 then slide1(im2) end
if im2.left==370 then slide2(im2) end
if im2.left==445 then slide3(im2) end
if im2.left==520 then slide4(im2) end
if im2.left==10 then slide5(im2) end
if im2.left==85 then slide6(im2) end
if im2.Left==160 then slcPn=im2 slide7(im2) end

if im3.left==240 then slide1(im3) end
if im3.left==370 then slide2(im3) end
if im3.left==445 then slide3(im3) end
if im3.left==520 then slide4(im3) end
if im3.left==10 then slide5(im3) end
if im3.left==85 then slide6(im3) end
if im3.Left==160 then slcPn=im3 slide7(im3) end

if im4.left==240 then slide1(im4) end
if im4.left==370 then slide2(im4) end
if im4.left==445 then slide3(im4) end
if im4.left==520 then slide4(im4) end
if im4.left==10 then slide5(im4) end
if im4.left==85 then slide6(im4) end
if im4.Left==160 then slcPn=im4 slide7(im4) end

if im5.left==240 then slide1(im5) end
if im5.left==370 then slide2(im5) end
if im5.left==445 then slide3(im5) end
if im5.left==520 then slide4(im5) end
if im5.left==10 then slide5(im5) end
if im5.left==85 then slide6(im5) end
if im5.Left==160 then slcPn=im5 slide7(im5) end

if im6.left==240 then slide1(im6) end
if im6.left==370 then slide2(im6) end
if im6.left==445 then slide3(im6) end
if im6.left==520 then slide4(im6) end
if im6.left==10 then slide5(im6) end
if im6.left==85 then slide6(im6) end
if im6.Left==160 then slcPn=im6 slide7(im6) end

if im7.left==240 then slide1(im7) end
if im7.left==370 then slide2(im7) end
if im7.left==445 then slide3(im7) end
if im7.left==520 then slide4(im7) end
if im7.left==10 then slide5(im7) end
if im7.left==85 then slide6(im7) end
if im7.Left==160 then slcPn=im7 slide7(im7) end
end

im8.OnClick=function()
if slcPn.Width==220 then t8.Enabled=false
else
slc=true slcPn.bringToFront() t8.Enabled=true
end
end

t9.OnTimer=function()
tra1.visible=false
slcPn.Width=slcPn.Width - 20
slcPn.Height=slcPn.Height - 20
slcPn.left=slcPn.left + 10
slcPn.top=slcPn.top + 10
if slcPn.Width==120 then traB1.caption="OFF" traB2.caption="OFF"
slcPn="" slc=false play1() t9.Enabled=false end
end

im9.OnClick=function()
if slc==true then
t9.Enabled=true
else
play1()
end
end

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Tue Aug 04, 2020 11:42 pm    Post subject: Reply with quote

Great! +1 rep
_________________
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: 1668

PostPosted: Thu Aug 06, 2020 6:08 am    Post subject: Reply with quote

Finally!


Capture.JPG
 Description:
Carousel Image Slideshow
 Filesize:  52.82 KB
 Viewed:  7150 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
AylinCE
Grandmaster Cheater Supreme
Reputation: 34

Joined: 16 Feb 2017
Posts: 1432

PostPosted: Thu Aug 06, 2020 6:57 am    Post subject: Reply with quote

There are two different points of attention.
1) Is the sub-reflection of the pictures coding? Or is the picture with reflection effect?
2) The Trainer taskbar is compatible with slide pictures. Windows setting? Or coding?

It was clear that a good job would come out of this project.
The CE Art section (Maybe the Lua section) can be ideal for those who want to use it.
(Of course, if it is not a private project;))

Congratulations and thanks; Because you know with CE to continue the fun. Cool

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Thu Aug 06, 2020 9:47 am    Post subject: Reply with quote

@Aylin, answers:
1. Could be Yes or No.

If yes (by coding) then you need create to image with picture from same source, set those pictures with correct position and then get some works on image no.2 by use DaSpammer (flip image function) and combine with mgzIngPlayer (image opacity function).

Or use GDI32plus functions to draw DC, Bitmap. etc (search google for this). I think CE also have abilities to duplicate and draw image bitmap.

On my case, I am use the simple way by creating image reflections via online site. Here:

https://www.generateit.net/reflection/

(see sample image that I produced from the site)


2. Not really understand about no.2 question.



ImageWReflect.png
 Description:
 Filesize:  643.09 KB
 Viewed:  7121 Time(s)

ImageWReflect.png



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

Joined: 16 Feb 2017
Posts: 1432

PostPosted: Thu Aug 06, 2020 11:55 am    Post subject: Reply with quote

Corroder wrote:

2. Not really understand about no.2 question.


Probably Windows Aero feature.
Trainer border. It's a feature I haven't used for a long time. Very Happy


Reflections look beautiful. Congratulations again.



004956.png
 Description:
 Filesize:  212.25 KB
 Viewed:  7105 Time(s)

004956.png



_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Thu Aug 06, 2020 5:42 pm    Post subject: Reply with quote

Quote:
Probably Windows Aero feature.
Trainer border. It's a feature I haven't used for a long time.


That because I am use a single script to change app. Icon on window taskbar:

Code:
os.execute('REG ADD "HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced" /V TaskbarGlomLevel /T REG_DWORD /D 1 /F')



That code above, will give effect to windows form including CE.

And this is example to make image reflections:

Code:
-- DaSpammer module:
local a = findTableFile('customImagePicture.lua').stream
a = load(readStringLocal(a.memory,a.size))()
local b = findTableFile('assetsCache.lua').stream
b = load(readStringLocal(b.memory,b.size))()

if f then f.destroy() end

f = createForm()
f.setSize(500,500)
f.Position = 'poScreenCenter'

img1 = createImage(f)
img1.setSize(200,200)
img1.setPosition(150,50)
img1.transparent = true
img1.stretch = true

img2 = createImage(f)
img2.setSize(200,200)
img2.setPosition(150,img1.top + img1.height)
img2.transparent = true
img2.stretch = true

obj1 = assetsCache.loadImage('girl.png')
obj2 = obj1:duplicate()
obj2.flipHorz()
img1.setPicture(obj1)
img2.setPicture(obj2)


The result as attached image.
Then I try combine with mgzIngPlayer image Alphablend function, but not work for saved picture from img2. I don't know why.

Code:
--- add script to manipulating image alphablend
pic = img2.Picture
pic.saveToFile('D:/copy_girl.png')

s = findTableFile('girl_copy.png')
if s then
  s.delete()
  pic = createTableFile('girl_copy.png', [[D:/copy_girl.png]])
else
  pic = createTableFile('girl_copy.png', [[D:/copy_girl.png]])
end

-----------------------------------------
function TBlendFunction(SourceConstantAlpha)
  return byteTableToDword({0,0,SourceConstantAlpha,1})
end

function getCanvasHandle(canvas)
  canvas.getPixel(0,0)
  return readPointerLocal(userDataToInteger(canvas)+0xc8)
end

pngImage = createImage(nil)
pngImage.Picture.PNG.loadFromStream(findTableFile('girl_copy.png').Stream)
tmpImage = createImage(nil)
local width  = pngImage.Picture.Bitmap.Width
local height = pngImage.Picture.Bitmap.Height
tmpImage.Picture.Bitmap.PixelFormat = pf32bit
tmpImage.Picture.Bitmap.Width  = width
tmpImage.Picture.Bitmap.Height = height

executeCodeLocalEx("msimg32.AlphaBlend", getCanvasHandle(tmpImage.Picture.Bitmap.Canvas), 0, 0, width, height,
                    getCanvasHandle(pngImage.Picture.Bitmap.Canvas), 0, 0, width, height,
                    TBlendFunction(50))

img2.Picture.assign(tmpImage.Picture)
img2.repaint()
pngImage.destroy()
tmpImage.destroy()
os.remove('D:\\copy_girl.png')



image1.JPG
 Description:
 Filesize:  67.55 KB
 Viewed:  7084 Time(s)

image1.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: 1668

PostPosted: Fri Aug 07, 2020 2:27 pm    Post subject: Reply with quote

Finally..done!

Code:
local a = findTableFile('customImagePicture.lua').stream
a = load(readStringLocal(a.memory,a.size))()
local b = findTableFile('assetsCache.lua').stream
b = load(readStringLocal(b.memory,b.size))()


if f then f.destroy() end

f = createForm()
f.setSize(500,500)
f.Position = 'poScreenCenter'
f.Caption = 'Test Image Reflection'

img1 = createImage(f)
img1.setSize(200,200)
img1.setPosition(150,50)
img1.transparent = true
img1.stretch = true

img2 = createImage(f)
img2.setSize(200,200)
img2.setPosition(150,img1.top + img1.height)
img2.transparent = true
img2.stretch = true

obj1 = assetsCache.loadImage('girl.jpg')
obj2 = obj1:duplicate()
obj2.flipHorz()
img1.setPicture(obj1)
img2.setPicture(obj2)

pic = img2.Picture
pic.saveToFile('D:/copy_girl.jpg')

s = findTableFile('girl_copy.jpg')
if s then
   s.delete()
   pic = createTableFile('girl_copy.jpg', [[D:/copy_girl.jpg]])
else
   pic = createTableFile('girl_copy.jpg', [[D:/copy_girl.jpg]])
end



-----------------------------------------
function TBlendFunction(SourceConstantAlpha)
  if TBlendFunctionStruct==nil then
    TBlendFunctionStruct = createMemoryStream()
    TBlendFunctionStruct.writeByte(0)
    TBlendFunctionStruct.writeByte(0)
    TBlendFunctionStruct.writeByte(SourceConstantAlpha)
    TBlendFunctionStruct.writeByte(1)
  else
    TBlendFunctionStruct.Position = 2
    TBlendFunctionStruct.writeByte(SourceConstantAlpha)
  end
  TBlendFunctionStruct.Position = 0
  return TBlendFunctionStruct.readDword()
end


reflection = createImage(nil)
reflection.Picture.loadFromStream(findTableFile('girl_copy.jpg').Stream)

local width  = reflection.Picture.Bitmap.Width
local height = reflection.Picture.Bitmap.Height

img2.Picture.Bitmap.PixelFormat = pf32bit
img2.Picture.Bitmap.Width  = width
img2.Picture.Bitmap.Height = height

function getCanvasHandle(canvas)
  return readPointerLocal(userDataToInteger(canvas)+0xc8)
end

img2.Picture.Bitmap.Canvas.getPixel(0,0)
reflection.Picture.Bitmap.Canvas.getPixel(0,0)

executeCodeLocalEx("msimg32.AlphaBlend", getCanvasHandle(img2.Picture.Bitmap.Canvas), 0, 0, width, height,
                                         getCanvasHandle(reflection.Picture.Bitmap.Canvas), 0, 0, width, height, TBlendFunction(110))
img2.repaint()
reflection.destroy()
os.remove('D:\\copy_girl.jpg')



Capture.JPG
 Description:
CE Image Reflection (Flip + Opacity)
 Filesize:  35.14 KB
 Viewed:  7008 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
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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