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

com.amanotes.widget2d

v1.0.1

Published

Responsive UI system for Unity

Downloads

180

Readme

Widget2D

Responsive UI system for Unity with automatic screen adaptation.

Features

  • ✅ Automatic component resizing based on screen configuration
  • ISizeListener interface for custom resize behavior
  • ✅ Support for SpriteRenderer, MeshRenderer, BoxCollider, etc.
  • ✅ Screen2D configuration assets
  • ✅ No dependencies on other packages

Installation

Add to your manifest.json:

{
  "dependencies": {
    "com.amanotes.widget2d": "1.0.0"
  }
}

Quick Start

using Amanotes.Widget2D;
using UnityEngine;

public class ResponsiveTile : MonoBehaviour
{
    void Start()
    {
        var widget = GetComponent<Widget2D>();
        widget.size = new Vector2(100, 100);
        
        // Widget automatically resizes attached components
        // (SpriteRenderer, MeshRenderer, BoxCollider, etc.)
    }
}

Usage

Basic Widget Setup

public class TileVisual : MonoBehaviour
{
    private Widget2D widget;
    
    void Awake()
    {
        widget = GetComponent<Widget2D>();
    }
    
    void Start()
    {
        // Set size - auto-resizes components
        widget.size = new Vector2(50, 50);
    }
}

Custom Resize Behavior

public class CustomResize : MonoBehaviour, ISizeListener
{
    public void OnSizeChanged(Vector2 size)
    {
        // Custom resize logic
        transform.localScale = new Vector3(size.x, size.y, 1f);
    }
}

Screen Configuration

// Create Screen2D asset
var screen = ScriptableObject.CreateInstance<Screen2D>();
screen.width = 1080f;
screen.height = 1920f;
screen.referenceResolution = new Vector2(1080, 1920);

// Assign to widget
widget.screen = screen;

API Reference

Widget2D Component

public class Widget2D : MonoBehaviour
{
    public Vector2 size;              // Widget size
    public Screen2D screen;           // Screen configuration
    
    public void UpdateSize();         // Manually trigger resize
}

ISizeListener Interface

public interface ISizeListener
{
    void OnSizeChanged(Vector2 size);
}

Screen2D Asset

public class Screen2D : ScriptableObject
{
    public float width;
    public float height;
    public Vector2 referenceResolution;
}

Supported Components

Widget2D automatically resizes:

  • SpriteRenderer (sprite bounds)
  • MeshRenderer (mesh bounds)
  • BoxCollider (collider size)
  • BoxCollider2D (collider size)
  • Components implementing ISizeListener

License

Copyright © Amanotes