Constructor for the CoordinateRatioMapper class. The default coordinate system will have a width and height of Context.MIN_RESOLUTION, and the coordinate system will not be in WebGL mode.
Constructor for the CoordinateRatioMapper class.
{number} - The width of the coordinate system. Minimum value is Context.MIN_RESOLUTION.
{number} - The height of the coordinate system. Minimum value is Context.MIN_RESOLUTION.
{boolean} - Is the coordinate system in WebGL mode?
Set the height of the coordinate system.
{number} - The height of the coordinate system. Minimum value is Context.MIN_RESOLUTION.
Set the width of the coordinate system.
{number} - The width of the coordinate system. Minimum value is Context.MIN_RESOLUTION.
Map a percentage vector to values on the x-axis and y-axis. A percentage value of 0.5 will be exactly in the middle of the respective axis, regardless of context resolution or aspect ratio.
{p5.Vector} - The percentage vector expressed as decimal numbers (e.g. 50% = 0.5)
The coordinate vector.
Map a percentage value to a value on the x-axis. A percentage value of 0.5 will be exactly in the middle of the x-axis, regardless of context resolution or aspect ratio.
{number} - The percentage expressed as a decimal number (e.g. 50% = 0.5)
The coordinate value on the x-axis.
Map a percentage value to a value on the y-axis. A percentage value of 0.5 will be exactly in the middle of the y-axis, regardless of context resolution or aspect ratio.
{number} - The percentage expressed as a decimal number (e.g. 50% = 0.5)
The coordinate value on the y-axis.
Utility class for mapping coordinates between a ratio and a coordinate system.
Since
2.0.0