npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

babylonjs-popover

v0.0.6

Published

Lightweight 3D popover component for Babylon.js: short-lived text in the scene (damage numbers, pickups, etc.).

Downloads

654

Readme

babylonjs-popover

Lightweight 3D popover component for Babylon.js: short-lived text in the scene (damage numbers, pickups, etc.).

Modes

  • 3D Billboard – text in the scene that always faces the camera. Use Popover3DPositioningMode.BILLBOARD.
  • 3D Vertical – text in the scene, upright (vertical to ground); rotates only around Y to face camera at creation, then stays fixed. Use Popover3DPositioningMode.VERTICAL.

Install

npm i babylonjs-popover
# or
yarn add babylonjs-popover

Usage

3D popover (Billboard or Vertical)

import Popover, { Popover3DPositioningMode } from 'babylonjs-popover'
import { Scene, Vector3 } from 'babylonjs'

const popover = Popover.getInstance()

// Billboard: always faces the camera
await popover.showText3D('-10%', scene, position, 'rgba(255,80,80,0.9)', 'rgba(0,0,0,0.85)', 2)

// Vertical: upright, fixed orientation (Y-only rotation at creation)
await popover.showText3D(
  '+1 Apple',
  scene,
  position,
  'rgba(200,208,198,0.95)',
  'rgba(0,0,0,0.85)',
  2,
  Popover3DPositioningMode.VERTICAL
)

Project-wide defaults (font, size)

Call configure() once before any getInstance() so the singleton uses your defaults:

import Popover from 'babylonjs-popover'

Popover.configure({ fontFamily: 'Helvetica', fontSize: 24 })
const popover = Popover.getInstance()

Per-instance font and size

popover.setFontFamily('YourFont')
popover.setFontSize(24)

3D texture width (avoid clipping last character)

Width is measured with CanvasRenderingContext2D.measureText() for the actual font, then multiplied by a padding factor (default 1.2 = 20% extra). If the last letter still clips (e.g. with some fonts), increase the factor:

Popover.configure({
  fontFamily: 'Helvetica',
  textureWidthPaddingFactor: 1.3,  // e.g. 30% extra width
  // texture3DMinWidth: 256,
  // texture3DMaxWidth: 1024,
})

Configure: 3D animation and rendering

All 3D defaults from POPOVER_CONFIG can be overridden via Popover.configure() (call before getInstance()). Example with common 3D options:

import Popover, { Popover3DPositioningMode } from 'babylonjs-popover'

Popover.configure({
  fontFamily: 'Helvetica',
  fontSize: 24,
  positioningMode3D: Popover3DPositioningMode.VERTICAL,
  // 3D animation
  animationOffsetY3D: 3.5,      // vertical offset (world units) during fade-out
  scaleFactor3D: 1.2,            // end scale multiplier
  animationSpeed3D: 40,          // ms per animation step
  alphaFadeStart3D: 0.7,         // start fade at 70% of duration (0–1)
  alphaFadeDuration3D: 800,     // fade duration in ms
  // 3D rendering
  textureAlpha3D: 0.8,
  planeBaseHeight3D: 1,
  renderingGroupId3D: 2,
  // texture size (if needed)
  textureWidthPaddingFactor: 1.2,
  texture3DMinWidth: 256,
  texture3DMaxWidth: 1024,
})

const popover = Popover.getInstance()

License

This project is licensed under the Apache License 2.0.