usePixelPerfectCamera
usePixelPerfectCamera(
options?):PixelPerfectCamera
Defined in: packages/three-flatland/src/react/usePixelPerfectCamera.ts:42
Create and resize a PixelPerfectCamera from R3F’s CSS size and DPR.
The hook installs the camera as the root default unless makeDefault is
false, and restores the previous camera when unmounted. R3F’s own
orthographic resize path is marked manual so it cannot overwrite the
physical-pixel projection. The renderer viewport, R3F viewport metrics,
and pointer-event mapping follow the camera’s centered pixel viewport.
Parameters
Section titled “Parameters”options?
Section titled “options?”UsePixelPerfectCameraOptions = {}
Returns
Section titled “Returns”Example
Section titled “Example”function Scene() { usePixelPerfectCamera({ viewSize: 240 }) return <sprite2D pixelPerfect texture={texture} />}