-
Notifications
You must be signed in to change notification settings - Fork 14
Object2D classes
Kiminaze edited this page May 1, 2022
·
3 revisions
The script comes with a variety of classes that make creating custom UI elements easier.
Currently some adjustments to your own fxmanifest.lua are necessary to make using these classes easier. You need to include the source files in the scripts where you want to use these functions. The order also matters (e.g. Color always needs to be before the Object2D classes).
fx_version 'cerulean'
games { 'gta5' }
author 'Philipp Decker'
description 'Example for using Object2D elements.'
version '0.1.0'
client_scripts {
-- Color needs to be included for all UI elements. Always include this!
'@ContextMenu/Utils/Color.lua',
-- TextAlignment and TextFont is of course only necessary if you want to display any form of text.
'@ContextMenu/Utils/TextAlignment.lua',
'@ContextMenu/Utils/TextFont.lua',
-- Object2D always needs to be included as well.
'@ContextMenu/Graphics2D/Object2D.lua',
-- Only include from this list what you actually need.
'@ContextMenu/Graphics2D/Rect.lua',
'@ContextMenu/Graphics2D/Text.lua',
'@ContextMenu/Graphics2D/Sprite.lua',
'@ContextMenu/Graphics2D/SpriteUV.lua',
'@ContextMenu/Graphics2D/Container.lua',
-- Now you can include any of your own files.
'myOwnScript.lua',
}Read more about them on their respective sites: