Skip to content

0.30.0-alpha.1148+a1e7f6f

New `ex.Screen.worldToPagePixelRatio` API that will return the ratio between excalibur pixels and the HTML pixels.
  * Additionally excalibur will now decorate the document root with this same value as a CSS variable `--ex-pixel-ratio`
  * Useful for scaling HTML UIs to match your game
    ```css
    .ui-container {
      pointer-events: none;
      position: absolute;
      transform-origin: 0 0;
      transform: scale(
        calc(var(--pixel-conversion)),
        calc(var(--pixel-conversion)));
    }
    ```
Assets 2
Loading