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 


Splash screen

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

Joined: 21 Feb 2016
Posts: 115

PostPosted: Mon Sep 12, 2016 2:59 am    Post subject: Splash screen Reply with quote

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
View user's profile Send private message
usernotfound
Expert Cheater
Reputation: 0

Joined: 21 Feb 2016
Posts: 115

PostPosted: Mon Sep 12, 2016 2:42 pm    Post subject: Reply with quote

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
View user's profile Send private message
panraven
Grandmaster Cheater
Reputation: 54

Joined: 01 Oct 2008
Posts: 941

PostPosted: Mon Sep 12, 2016 5:25 pm    Post subject: Reply with quote

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
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Mon Sep 12, 2016 6:00 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
usernotfound
Expert Cheater
Reputation: 0

Joined: 21 Feb 2016
Posts: 115

PostPosted: Mon Sep 12, 2016 6:54 pm    Post subject: Reply with quote

Edit: Never mind! Solved thanks to panraven & Dark Byte, thank you for all the help!
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