Skip to main content
Version: 2.3.0

Eye Position

Requires API Version 1.0.0 or higher

The Eye Position API gives you access to eye and eyelid positions sent by the system.


Functions​

luniris.position(position_type, position)​

function luniris.position(position_type, position)
-- Receive eye and eyelid positions in real time
end

position_type​

  • 0: eye
  • 1: eyelid

position​

Values are normalized.

  • For Eyelid: position.EyelidClosurePercentage (between 0 and 1)
  • For Eye: position.X and position.Y (between -1 and 1)
One Declaration Only

This function can only be declared once in your entire codebase.

Receives eye and eyelid positions in real time from Luniris app features.


Example​

function luniris.position(position_type, position)
if position_type == 1 then
-- EYELID

-- Check to ensure the eyelid value is not nil
if position.EyelidClosurePercentage == nil then
return
end

normalizedEyelidClosure = position.EyelidClosurePercentage
else
-- EYE

-- Check to ensure the eye value is not nil
if position.X == nil or position.Y == nil then
return
end

normalizedEyePosition = position
end
end