MCPcopy Index your code
hub / github.com/axaq/traviso.js

github.com/axaq/traviso.js @v0.2.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.2.0 ↗ · + Follow
2,373 symbols 5,035 edges 26 files 115 documented · 5%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Traviso Isometric JS Engine

npm

traviso.js logo

JavaScript Isometric World Engine

Traviso is an open source JS engine that makes it easy to build isometric applications that run in a web browser. It aims maximum flexibility in order you to implement your own logic on top of it. Along with a set of optimised algorithms, Traviso is built on top of the awesomely fast pixi.js rendering engine.

If you’re interested, you can follow me on twitter (@axaq) or visit the website for more info.

Tutorials

Docs

You can find the documentation here

What is Ahead

  • More tutorials
  • Built-in multi-controllable support
  • Priority levels for moving objects
  • Built-in support for block-like tiles
  • Ground/terrain height
  • Fog of war

Contribute

Do you want to contribute? That's awesome. You can either message me through Twitter (@axaq) or use the Traviso.js blog.

How to build

After cloning the repo, install the build dependencies using npm:

$> npm install

Then build:

$> npm run build

This will create browser, CommonJS, and ES module versions of the library under dist folder. A minified version for browsers can be found at the same place.

Compatibility

traviso.js Supported pixi.js
0.1.x ^6.0.4
0.2.x ^7.0.0

Pixi 8 support is not included in the 0.2.x line yet. That will ship in a later release.

Usage

// Here, we initialize the pixi application
var pixiRoot = new PIXI.Application({
    width: 800,
    height: 600,
    backgroundColor: 0xffffff,
});

// add the renderer view element to the DOM
document.body.appendChild(pixiRoot.view);

// engine-instance configuration object
var instanceConfig = {
    mapDataPath: 'mapData.json', // the path to the json file that defines map data, required
    assetsToLoad: ['../assets/spritesheet.json', '../assets/house.png'], // array of paths to the assets that are desired to be loaded by traviso, no need to use if assets are already loaded to PIXI cache, default null
};

// initialize traviso instance and add it to the stage
var engine = TRAVISO.getEngineInstance(instanceConfig);
pixiRoot.stage.addChild(engine);

You can now also use traviso as a npm module:

$> npm install traviso.js pixi.js@^7.0.0
import * as TRAVISO from 'traviso.js';

var engine = TRAVISO.getEngineInstance(instanceConfig);

If you need to stay on Pixi 6, keep using traviso.js@0.1.12 with pixi.js@^6.0.4.

This content is released under the (http://opensource.org/licenses/MIT) MIT License.

Extension points exported contracts — how you extend this code

IObjectInfo (Interface)
(no doc)
src/utils/map.ts
IMovable (Interface)
(no doc)
src/map/MoveEngine.ts
IMapDataObject (Interface)
(no doc)
src/utils/map.ts
ITween (Interface)
(no doc)
src/map/MoveEngine.ts
ITweenTarget (Interface)
(no doc)
src/map/MoveEngine.ts

Core symbols most depended-on inside this repo

addEventListener
called by 64
test/setup.ts
existy
called by 35
src/utils/calculations.ts
removeEventListener
called by 31
test/setup.ts
add
called by 22
docs/assets/main.js
getContext
called by 21
test/setup.ts
push
called by 16
src/pathFinding/BinaryHeap.ts
trace
called by 12
src/utils/trace.ts
getTilePosXFor
called by 11
src/map/EngineView.ts

Shape

Method 1,642
Function 378
Class 348
Interface 5

Languages

TypeScript100%

Modules by API surface

examples/js/pixi.min.js1,957 symbols
examples/js/traviso.min.js158 symbols
src/map/EngineView.ts83 symbols
docs/assets/main.js68 symbols
src/map/MoveEngine.ts18 symbols
src/pathFinding/PathFinding.ts17 symbols
src/pathFinding/BinaryHeap.ts9 symbols
src/map/ObjectView.ts9 symbols
test/setup.ts8 symbols
src/utils/map.ts8 symbols
src/utils/calculations.ts8 symbols
src/pathFinding/GridNode.ts6 symbols

For agents

$ claude mcp add traviso.js \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page