Giter Club home page Giter Club logo

foundryvtt-thegoodwins-terrain-ruler's Introduction

ko-fi

Terrain Ruler

This module makes Foundry's rulers respect difficult terrain that was put down using the Enhanced Terrain Layer module. In addition, other modules can use it as a library to easily perform measurements that take into account difficult terrain.

A ruler measuring distance including difficult terrain

Using this module as a library to measure difficult terrain

This section is not intended for users of the Enhanced Terrain Ruler module, but for module authors that want to use difficult terrain as a library to easily measure difficult terrain in their module.

Switching a ruler to difficult terrain mode

To make any ruler that your module spawns make use of difficult terrain, you can set the isTerrainRuler attribute of that ruler to true. This will cause it to make measurements that take into account difficult terrain.

Measuring distances via measureDistances

Terrain Ruler offers a method to measure distances using difficult terrain: terrainRuler.measureDistances. This method will behave exactly the same way as canvas.grid.measureDistances, but will take difficult terrain into account. In addition terrainRuler.measureDistances will modify the rays it gets passed onto, and attach the attribute terrainRulerVisitedSpaces to them. This attribute will contain an array of all grid spaces that were visited by the measured path, including the distance measured from the starting space to the listed space (cumulative distance).

foundryvtt-thegoodwins-terrain-ruler's People

Contributors

manuelvo avatar thegoodwin avatar sakusenerio avatar carnvanbeck avatar jdcalvert avatar juanfrank avatar alphastarguide avatar maclavell avatar rectulo 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.