Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Set reference point
- function _M.setRP (object, ref_point)
- ref_point = string.lower(ref_point)
- if ref_point == 'topleft' then
- object.anchorX, object.anchorY = 0, 0
- elseif ref_point == 'topright' then
- object.anchorX, object.anchorY = 1, 0
- elseif ref_point == 'topcenter' then
- object.anchorX, object.anchorY = 0.5, 0
- elseif ref_point == 'bottomleft' then
- object.anchorX, object.anchorY = 0, 1
- elseif ref_point == 'bottomright' then
- object.anchorX, object.anchorY = 1, 1
- elseif ref_point == 'bottomcenter' then
- object.anchorX, object.anchorY = 0.5, 1
- elseif ref_point == 'centerleft' then
- object.anchorX, object.anchorY = 0, 0.5
- elseif ref_point == 'centerright' then
- object.anchorX, object.anchorY = 1, 0.5
- elseif ref_point == 'center' then
- object.anchorX, object.anchorY = 0.5, 0.5
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement