-
Notifications
You must be signed in to change notification settings - Fork 2
Hooks
The Fern edited this page Sep 11, 2018
·
4 revisions
Currently there are 6 hooks that you can use to change the visuals of the phone, these include
GPhonePreRenderTopbar (w,h) -- Called before rendering the topbar (The time and battery etc.)
GPhonePostRenderTopbar (w,h) -- Called after rendering the topbar
GPhonePreRenderBackground (w,h) -- Called before rendering the background on the homescreen or appscreen
GPhonePostRenderBackground (w,h) -- Called after rendering the background
GPhonePreRenderScreen (w,h) -- Called before rendering anything on the screen
GPhonePostRenderScreen (w,h) -- Called after rendering the entire screen except the cursor
GPhoneDataReceived (ply,name,data) -- Called before receiving shared data from any source and with any key
All hooks can be utilized via the default hook.Add command, like so
hook.Add("GPhonePreRenderTopbar", "TopbarBackgroundTest", function(w, h) -- Draws a green background behind the Topbar
surface.SetDrawColor(0, 255, 0, 255)
surface.DrawRect(0, 0, w, h)
end)