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 🙏

© 2024 – Pkg Stats / Ryan Hefner

cursor-style-manager-wle

v1.3.1

Published

Shared cursor styles for Wonderland Engine

Downloads

219

Readme

cursor-style-manager-wle

Centralises cursor style management in a single component so that the cursor style can be changed by multiple components at the same time without creating conflicts.

Usage

  1. Install this library as a dependency: npm install cursor-style-manager-wle
  2. Add a cursor-style-manager component to the scene
    • A dedicated object named CursorStyleManager is recommended so that it's easier to pick in the editor
  3. Change your mouse-look component to a csm-mouse-look component if it's present in the scene
    • Make sure to set the cursorStyleManagerObject property to the object that contains the cursor-style-manager component
  4. Change your custom button components so that they extend CSMComponent instead of Component, and implement the onButtonClick method
    • Make sure to set the cursorStyleManagerObject property
  5. If you rely on the styleCursor property in your cursor component, then replace the cursor component with a csm-cursor component
    • Note that other components that reference this component will now have to get the csm-cursor component instead of the cursor component
    • If this is not possible, then styleCursor can't be used. Consider making incompatible components extend the CSMComponent class instead of relying on styleCursor

Components

CSMComponent

An abstract component that provides a helper method for setting the cursor style in a manager, falling back to direct cursor style management if no manager is provided.

Extend this class if you want to create custom components that change the cursor style.

CSMButtonComponent

An abstract component that implements most of the functionality needed for a button, and changes cursor styles by using a manager (or directly if no manager is provided, like CSMComponent).

Extend this class and override the onButtonClick method to create a custom button class.

CSMCursor

A replacement for the official cursor component. Provides the same functionality as the cursor component, but cursor style changes are done via a cursor style manager (if the styleCursor property is enabled) and the object where the view component is placed can now be specified.

Use of this component is optional and not recommended. Only use this if you rely on the styleCursor property.

CSMMouseLook

A replacement for the official mouse-look component. Provides the same functionality as the mouse-look component, but cursor style changes are done via a cursor style manager.

CursorStyleManagerComponent

Manages the cursor style of an engine canvas. There must only be one manager in a scene.

This is just the default implementation of a cursor style manager. Custom cursor style managers with extra functionality can be created, so long as they follow the ICursorStyleManager interface. For most use-cases, this default implementation is good enough.

Credits

This project is being developed at Playko (website, github) and uses the following open-source projects:

This project also uses modified components from the Wonderland Engine components library (@wonderlandengine/components):

  • csm-mouse-look is a modified mouse-look component
  • csm-cursor is a modified cursor component

This project also uses a simplified version of lazy-widgets's (MIT license) cursor style sharing system.