app.unit.Types

Unit constants. We use this for parameters of app.unit.convert.

Constants#

NameTypeDescription
PXnumberPixels unit. Main reference of any units. Value: 1
DPnumberDensity-independent Pixels unit. Value: PX * app.display.scale
PTnumberPoints unit. The value may vary on each device
SPnumberScaled Points unit. Value: PT * app.display.scale
VWnumberViewport Width unit. It is percent with "100%" == app.display.width
VHnumberViewport Height unit. It is percent with "100%" == app.display.height

Methods#

NameReturn TypeDescription
percentnumberCalculate unit constant from percent factor.

percent#

app.units.Types.percent(factor);

Calculate unit constant from percent factor.

Parameters:

  1. factor: (number type) Tells "100%" is equals what pixels.

Return: number