Git Product home page Git Product logo

fvtt-resource-icons's Introduction

All Downloads

Latest Release Download Count

Resource Icons x4

Resource Icons x4 is a Foundry VTT module that adds 4 customizable icons to tokens to track resources.

Fork

This is a fork I made quickly to allow having 4 icons instead of 3 because the system we play with my group nowadays has 4 basic resources. I don't intend to maintain this long-term except making sure it suits my group's needs, so please don't rely on this fork unless you know what you're doing.

Thanks to Jesse Vo for creating the original module.

Screenshot (from the original version with 3 icons)

Usage

Resource Icons are configured in the Resources tab of the Token Configuration window.

To activate an icon, select a resource for it to track. To deactivate an icon, select "None."

If no icon image is selected, the default icon image is a white circle.

The border, background, and tint of each icon can be individually set.

The border shape (circle/square), where the resource icons are anchored (above/below/left of/right of token), and icon alignemnt (inside/outside of token) can be changed in the module settings (per user with an option to use world default set by GM).

Technical Notes

Resource Icons patches (via lib-wrapper) CONFIG.Token.objectClass.prototype.draw to implement resource icon drawing. This drawing is handled by a new method added to the Token object class: drawResourceIcons. This method adds four PIXI container children to the token. Each of these PIXI containers themselves are assigned three PIXI children (based on resource icon configuration): background (which encompasses border), icon image, and value text.

Resource Icons also patches CONFIG.Token.objectClass.prototype._onUpdate to handle changes to resource icon configuration (in which case drawResourceIcons is called to re-draw the icons) and to handle changes to resoure values when a token's actor is updated. This updated is handled by another new method added to the Token object class: updateResourceIconValues. This method simply changes the value text child of each PIXI container to the new value of the assigned resource.

fvtt-resource-icons's People

Contributors

jessev14 avatar tues avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.