microsim-add-icons

Add Creative Commons license and fullscreen icons to p5.js MicroSim control regions.

90|12|Updated Nov 1, 2025
One-click install
npx skills add https://github.com/dmccreary/claude-skills --skill microsim-add-icons
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: microsim-add-icons
Source: https://github.com/dmccreary/claude-skills/tree/main/skills/archived/microsim-add-icons
Command: npx skills add https://github.com/dmccreary/claude-skills --skill microsim-add-icons

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes assets (resource) components.

What problem does it solve?

This Skill adds clickable Creative Commons license and fullscreen icons to the control region of an existing p5.js MicroSim. The icons appear in the lower right corner and use distance-based click detection, enabling quick access to licensing and fullscreen features without cluttering the interface.

Core Features & Use Cases

  • Icon integration: Adds Creative Commons and fullscreen icons to an existing MicroSim.
  • UI consistency: Keeps a compact footprint (~40 lines of code) while enhancing usability.
  • Deterministic placement: Icons are positioned for predictable behavior across simulations.

Quick Start

  • Identify the target MicroSim JavaScript file (p5.js pattern with setup/draw/windowResized).
  • Insert icon variables and the drawIcons() function as described.
  • Call drawIcons() within draw(), and implement mousePressed() to handle clicks.

Frequently Asked Questions about microsim-add-icons

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add Creative Commons and fullscreen icons to a p5.js sketch?

Add clickable Creative Commons license and fullscreen icons to your p5.js sketch by implementing icon variables, a drawIcons() function called from draw(), and a mousePressed() handler that detects clicks using distance-based collision. Position icons in the lower-right control area and adjust sliderRightMargin in windowResized() to reserve space.

Can I use icon controls with an existing p5.js MicroSim?

Yes, this approach works with any p5.js sketch following the standard pattern—global variables, setup(), draw(), and windowResized(). It integrates into existing MicroSims without restructuring core logic, adding approximately 40 lines of UI code to the control region.

How does distance-based click detection work for UI icons?

Distance-based click detection measures the Euclidean distance from the mouse position to an icon's center point. When distance falls below a threshold radius, a click registers as a hit, enabling precise interaction without rectangular collision boxes and supporting circular or irregular icon shapes.

What's the best way to keep UI icons from overlapping interactive elements in p5.js?

Reserve dedicated space in your control region by updating layout margins—such as sliderRightMargin—during setup() and windowResized(). This ensures icons remain visible and clickable without competing with sliders, buttons, or other interactive components.

Do I need additional libraries to add icons and licensing features to p5.js?

No additional libraries are required. This Skill uses only p5.js core functions: ellipse() for icon shapes, mousePressed() for interaction detection, and link() to open license pages. All rendering and event handling operate within p5.js's built-in API.