View previous topic :: View next topic |
Author |
Message |
usernotfound Expert Cheater Reputation: 0
Joined: 21 Feb 2016 Posts: 115
|
Posted: Mon Sep 12, 2016 2:59 am Post subject: Splash screen |
|
|
I wanted to have one of those little splash screen images in my trainers, like the ones you see in the bottom corner or middle of the screen when loading up a program.
Code: | f=createForm()
sleep (2000)
f.Destroy() |
My questions are:
1) How do I add an image to this form through Lua and not from the form designer
2) How do I adjust certain aspects of the form through Lua, specifically form size and making it borderless
3) Is it possible to control where the form appears like what I mentioned above, in the corner or middle of the screen
Thanks as always for any help!
|
|
Back to top |
|
|
usernotfound Expert Cheater Reputation: 0
Joined: 21 Feb 2016 Posts: 115
|
Posted: Mon Sep 12, 2016 2:42 pm Post subject: |
|
|
I managed to set the form size and position but am still lost on adding an image and making the form borderless.
Code: | f=createForm()
f.Top=400
f.Left=288
f.Width=600
f.Height=200
sleep (2000)
f.Destroy() |
I've tried using f.setBorderStyle(bsNone) but this just lags CE for a few seconds when opening the trainer and then proceeds, the form shows up for a split second and isn't borderless.
|
|
Back to top |
|
|
panraven Grandmaster Cheater Reputation: 54
Joined: 01 Oct 2008 Posts: 941
|
Posted: Mon Sep 12, 2016 5:25 pm Post subject: |
|
|
May try this function to add background, the tbFille is the name of image file in table fie, a table file can be added in menu/Table/Add File
Code: |
function attachBackground(wc,tblFile)
local p = createPicture()
p.loadFromStream(findTableFile(tblFile).Stream)
wc.OnPaint = function(sender)
local c = sender.getCanvas()
local bitmap = p.getBitmap()
c.draw(0,0,bitmap)
end
end
|
eg.
Code: |
attachBackground(f,'image.jpg')
|
The form as a Splash, may created invisible first, then position it , then show. To create form invisible first, try use a false parameter.
Code: |
local f = createForm(false)
|
It should be use BorderStyle = bsNone, but then you need some way to close/hide the form.
eg.
Code: |
f.BorderStyle = bsNone
f.OnClick = function(senderForm)senderForm.hide() end
|
bye~
_________________
- Retarded. |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Mon Sep 12, 2016 6:00 pm Post subject: |
|
|
get rid of that sleep and use a timer instead.
_________________
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 |
|
|
usernotfound Expert Cheater Reputation: 0
Joined: 21 Feb 2016 Posts: 115
|
Posted: Mon Sep 12, 2016 6:54 pm Post subject: |
|
|
Edit: Never mind! Solved thanks to panraven & Dark Byte, thank you for all the help!
|
|
Back to top |
|
|
|