View previous topic :: View next topic |
Author |
Message |
eigocc Newbie cheater Reputation: 0
Joined: 22 Dec 2018 Posts: 15
|
Posted: Sat May 18, 2019 6:14 am Post subject: How to make people move |
|
|
Can't I set the position of the image in the image control? I want to know how to make people move, I don't know if the canvas can load the image.
Description: |
|
Filesize: |
10.9 KB |
Viewed: |
1988 Time(s) |
|
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Sat May 18, 2019 6:19 am Post subject: |
|
|
you can load the image in a separate picture and then use canvas copyrect to change the image of the picture
_________________
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 |
|
|
eigocc Newbie cheater Reputation: 0
Joined: 22 Dec 2018 Posts: 15
|
Posted: Sat May 18, 2019 7:18 am Post subject: |
|
|
Can you give an example? I don't know much about it!
|
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Sat May 18, 2019 10:48 am Post subject: |
|
|
If you don't want to use canvas, then following code is a sample I made in a primitive way to moving several png images like a sprite.
Code: | f = createForm()
f.setSize(500,250)
sonic = createImage(f)
sonic.setSize(60,60)
sonic.stretch = true
sonic.setPosition(10,70)
btn = createToggleBox(f)
btn.setSize(100,50)
btn.setPosition(10,180)
btn.caption = 'Start'
--------------------------------------------------------------
function hack1()
if (checkbox_getState(btn) == 1) then
t.enabled = true
btn.caption = 'Stop'
else
t.enabled = false
btn.caption = 'Start'
end
end
t = {}
t[1] = 'frame_001.png'
t[2] = 'frame_002.png'
t[3] = 'frame_003.png'
t[4] = 'frame_004.png'
pics={}
for i=1,4 do --- 4 is the total number of your pictures
pics[i]=createPicture()
pics[i].loadFromStream(findTableFile(t[i]).Stream)
end
pics.currentPicture=1
function t_tick()
x,y = sonic.getPosition()
x = x + 5 ------ delete this line if not want change position
sonic.Picture=pics[pics.currentPicture]
pics.currentPicture=(pics.currentPicture % 4)+1 -- carefull here
if x >= f.width then
t.enabled = false
sonic.Picture.loadFromStream(findTableFile('frame_001.png').Stream)
sonic.setPosition(10,50)
btn.State = 0
btn.caption = 'Start'
else
sonic.setPosition(x,y)
end
end
t = createTimer()
t.interval = 100
t.enabled = false
t.onTimer = t_tick
function exit()
closeCE()
return caFree
end
f.show()
btn.onChange = hack1
f.onClose = exit
|
Download CT file (6 Kb) - copy paste URL link below to your web browser.
https://mega.nz/#!e5M0EYTB!MYPvjs05NeRsgkrHRqyzgs4PZXUiKW9a-_Dlmqfbq80
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Back to top |
|
|
AylinCE Grandmaster Cheater Supreme Reputation: 30
Joined: 16 Feb 2017 Posts: 1234
|
Posted: Sat May 18, 2019 12:35 pm Post subject: |
|
|
The picture above is moving differently.
Here is a different Gif code from @Corroder and @FreeER.
Code: | ----------------------------------------------- GIF
function createGIF(form, width, top, frames, doCenter)
---- ImageGIF Code Creator: FreeER.. Thanks .. and Thanks Corroder ..
-------------------------------------------------------
local pics={}
for _,frame in pairs(frames) do
local pic
if frame.ClassName == 'TMemoryStream' then
pic = createPicture()
pic.loadFromStream(frame)
else -- first try to load as a tableFile then as a filepath
local file = findTableFile(frame)
if file then
pic = createPicture()
pic.loadFromStream(file.Stream)
else
local function file_exists(name)
local f=io.open(name,"r")
if f~=nil then io.close(f) return true else return false end
end
if file_exists(frame) then
pic = createPicture()
pic.loadFromFile(frame)
end
end
end
if pic then pics[#pics+1] = pic end
end
if #frames ~= 0 and #pics == 0 then return nil end
pics.currentPicture = 1
local mImage = createImage(form)
mImage.width = '179'
mImage.top = '22'
mImage.height = '194'
if doCenter then
mImage.left = (form.width-mImage.width) / 2
end
local gif = {}
gif.image = mImage
gif.pics = pics
gif.next = function()
pics.currentPicture = (pics.currentPicture % #pics) + 1
mImage.Picture = pics[pics.currentPicture]
end
gif.timer = createTimer(mImage)
gif.timer.Interval = 800 / #gif.pics -- frames per second
gif.timer.OnTimer = function(sender) gif.next() end
return gif
end
local frameNameFormat = 'frame_%03d.png'
local t = {}
for i=1,13 do
t[i] = findTableFile(frameNameFormat:format(i)).Stream
end
gif1 = createGIF(UDF1, UDF1.width, 10, t, true)
--[[
local t = {}
for i=8,9 do
t[#t+1] = findTableFile(frameNameFormat:format(i)).Stream
end
gif2 = createGIF(UDF1, UDF1.width, 10, t, false)
]]
------------------------------------------------ |
And an example (.CT):
https://www.dosyaupload.com/auyM
_________________
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Sat May 18, 2019 1:12 pm Post subject: |
|
|
here's my example
Code: |
int=getInternet()
img=int.getURL('https://forum.cheatengine.org/files/1_227.png')
ss=createStringStream(img)
offscreen=createPicture()
offscreen.loadFromStream(ss)
f=createForm()
f.borderstyle='bsSizeable'
img=createImage(f)
img.align='alClient'
img.stretch=true
f.show()
local imgwidth=offscreen.PNG.Width
local imgheight=offscreen.PNG.Height
local charwidth=imgwidth // 4
local charheight=imgheight // 4
img.Picture.Bitmap.Width=charwidth
img.Picture.Bitmap.Height=charheight
--print(string.format("charwidth=%d charheight=%x",charwidth,charheight))
local index=0
t=createTimer(nil)
t.Interval=250
t.OnTimer=function(tmr)
--convert index to x,y coordinates
local x=(index % 4)*charwidth
local y=((index // 4) % 4)*charheight
--print(string.format("x=%d y=%d",x,y))
img.picture.Bitmap.Canvas.clear()
img.picture.Bitmap.Canvas.copyRect(0,0,charwidth-1,charheight-1,offscreen.PNG.Canvas,x,y,x+charwidth,y+charheight)
index=index+1
end
t.Enabled=true
f.OnDestroy=function(frm)
t.destroy()
f=nil
end
|
also in .Ct format with the image source as invisible on the form
Description: |
|
Download |
Filename: |
example.CT |
Filesize: |
14.74 KB |
Downloaded: |
264 Time(s) |
_________________
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 |
|
|
AylinCE Grandmaster Cheater Supreme Reputation: 30
Joined: 16 Feb 2017 Posts: 1234
|
Posted: Sat May 18, 2019 3:29 pm Post subject: |
|
|
Now my brain has stopped!
Your code: A complete picture, in squares
splits and reads.
That's magic!
Excellent coding DB.
So awesome.
_________________
|
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
|
Back to top |
|
|
|