-
Notifications
You must be signed in to change notification settings - Fork 0
Lua API
Enable lua features by calling extra methods below.
Quill will look into StreamingAssets/LUA
directory for the main.lua
file.
public class AppStartup : MonoBehaviour
{
private void Start()
{
Quill.Init();
QuillLua.Run();
}
private void Update()
{
QuillLua.Update();
}
private void OnDestroy()
{
QuillLua.Exit();
}
}
Here is the structure of the StreamingAssets/LUA/main.lua
function OnInit()
end
function OnUpdate(dt)
end
function OnExit()
end
quill.screenHeight
quill.screenWidth
quill.mainRoot()
quill.empty()
quill.label()
quill.box()
quill.button()
quill.loadFont(name, size)
quill.setDefaultFont(name)
quill.mousePosition()
quill.log(text)
element:show()
element:hide()
element:destroy()
element:addChild(element)
element:setPivot(x,y)
element:setSize(x,y)
element:setAnchoredPosition(x,y)
element:setAnchorsMin(x,y)
element:setAnchorsMax(x,y)
element:resetTransform()
element:stretchToParent()
label:getText()
label:setText(text)
label:getFont()
label:setFont(fontName)
label:getColor()
label:setColor(r,g,b)
label:setColor(r,g,b,a)
label:setColor(table)
label:setTextAnchor(textAnchor)
box:getColor()
box:setColor(r,g,b)
box:setColor(r,g,b,a)
box:setColor(table)
box:sprite(path)
box:sprite(path, options)
box:setImageType(type)
button.box
button.label
button.onClick:add(function)
button.onClick:remove(function)