Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function GetScaleform(str)
- return RequestScaleformMovie(str)
- end
- -- pass the above result into the following functions for them to work properly.
- function UnloadScaleform(handle)
- if IsLoaded(handle) then
- SetScaleformMovieAsNoLongerNeeded(handle)
- end
- end
- function IsLoaded(handle)
- return HasScaleformMovieLoaded(handle)
- end
- function IsValid(handle)
- return handle ~= 0
- end
- function CallFunction(handle, func, ...)
- args = {...}
- PushScaleformMovieFunction(handle, func)
- for i,v in ipairs(args) do -- Using ipairs ensures the order of args given.
- if type(v) == "int" then
- PushScaleformMovieFunctionParameterInt(v)
- else if type(v) == "string" then
- BeginTextCommandScaleformString()
- AddTextComponentSubstringPlayerName(v) -- Why not PushScaleformMovieFunctionParameterString instead of this block????
- EndTextCommandScaleformString()
- else if type(v) == "float" then
- PushScaleformMovieFunctionParameterFloat(v)
- else if type(v) == "bool" then
- PushScaleformMovieFunctionParameterBool(v)
- --[[ else if type(v) == "ScaleformArgumentTXD" then
- PushScaleformMovieFunctionParameterString(v) ]] -- What do I do here?
- else
- print("Unknown Argument Type Passed Into Scaleform With Handle " .. handle)
- end
- end
- PopScaleformMovieFunctionVoid() -- Remove void to retrieve data from the func.
- end
- function RenderFullscreen(handle, r, g, b, a) -- 255 for each by default
- if r,g,b,a == nil then
- r,g,b,a = 255
- end
- DrawScaleformMovieFullscreen(handle, r, g, b, a, 0)
- end
- function RenderRegion(handle, x, y, width, height, r, g, b, a) -- 255 for each by default
- if r,g,b,a == nil then
- r,g,b,a = 255
- end
- DrawScaleformMovie(handle, x, y, width, height, r, g, b, a, 0
- end
- function RenderScaleform3D(xpos, ypos, zpos, xrot, yrot, zrot, xscale, yscale, zscale)
- DrawScaleformMovie3dNonAdditive(xpos, ypos, zpos, xrot, yrot, zrot, 2.0, 2.0, 1.0, xscale, yscale, zscale)
- end
- function RenderAdditive3D(xpos, ypos, zpos, xrot, yrot, zrot, xscale, yscale, zscale)
- DrawScaleformMovie3d(xpos, ypos, zpos, xrot, yrot, zrot, 2.0, 2.0, 1.0, xscale, yscale, zscale)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement