axaq / traviso.js Goto Github PK
View Code? Open in Web Editor NEWTraviso is an open source JS engine that makes it easy to build isometric applications that run in a web browser.
License: MIT License
Traviso is an open source JS engine that makes it easy to build isometric applications that run in a web browser.
License: MIT License
Hello,
I've discovered Traviso, and I'm very interested to play with it.
I'm trying to display text over tiles or objects. I manage to do something like this:
function onEngineInstanceReady () {
var basicText = new PIXI.Text('Basic text in pixi');
pixiRoot.stage.addChild(engine);
var pos ={};
pos.r=11;
pos.c=12;
engine.addCustomObjectToLocation(basicText,pos);
}
The issue is that text is displayed below objects.
Is there any way to keep it on top of everything ?
Thanks in advance !
Clint
Path finding algorithm, while going diagonally, should take the objects into account and does not go through them but instead go around the corner as it is orthogonal.
Hello guys, I'am starting to create a project with travisojs and I would like to know how I can place items over other items in my game, below I leave a demonstration of stacking items which is what I want to do.
http://puu.sh/cGXsI/9450bae0ca.gif
i not see about in documentation.
The Data File Structure Tutorial Url is wrong.
It should be like that:
http://www.travisojs.com/blog/tutorial/2015/03/15/data-file-structure.html
Depending on the position of the object, I get some blurried items: really bad for pixel art items/objects that needs to be pixel-perfect without any filter applied on it.
There are my codes:
////// Global on-frame renderer function
function update()
{
renderer.render(stage);
requestAnimationFrame(update);
}
////// Here, we initialize the pixi stage
var gameCanvas;
var gameWidth, gameHeight;
gameCanvas = document.getElementById('mycanv');
gameWidth = window.innerWidth;
gameHeight = window.innerHeight;
// create an new instance of a pixi stage
stage = new PIXI.Container();
// create a renderer instance
renderer = PIXI.autoDetectRenderer(gameWidth, gameHeight, false , false);
// add the renderer view element to the DOM
document.body.appendChild(renderer.view);
update();
////// Here, we create our traviso instance and add on top of pixi
// engine-instance configuration object
var instanceConfig =
{
mapDataPath : "mapData.xml", // the path to the xml file that defines map data, required
assetsToLoad : ["test.png", "chair.gif", "carpet.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
tileHeight : "33",
isoAngle : "27",
initialZoomLevel : 0
};
var engine = TRAVISO.getEngineInstance(instanceConfig);
stage.addChild(engine);
and mapData.xml
<?xml version="1.0" encoding="utf-8" ?>
<map_data>
<tiles>
<tile id="1" movable="1">test.png</tile>
</tiles>
<objects>
<object id="1" movable="1" interactive="0" s="1x1">
<v id="idle">
<f>chair.gif</f>
</v>
</object>
<object id="2" movable="1" interactive="0" s="3x3">
<v id="idle">
<f>carpet.png</f>
</v>
</object>
</objects>
<ground_map>
<row>1 ,1 ,1 ,1, 1</row>
<row>1 ,1 ,1 ,1, 1</row>
<row>1 ,1 ,1 ,1, 1</row>
<row>1 ,1 ,1 ,1, 1</row>
<row>1 ,1 ,1 ,1, 1</row>
<row>0 ,1 ,0 ,1, 0</row>
<row>1 ,1 ,1 ,1, 1</row>
<row>1 ,1 ,1 ,1, 1</row>
<row>1 ,1 ,1 ,1, 1</row>
<row>1 ,1 ,1 ,1, 1</row>
<row>1 ,1 ,1 ,1, 1</row>
</ground_map>
<object_map>
<row>0 ,0 ,0 ,0, 0</row>
<row>0 ,0 ,0 ,0, 0</row>
<row>0 ,0 ,0 ,0, 0</row>
<row>2 ,0 ,0 ,0, 0</row>
<row>0 ,0 ,0 ,0, 0</row>
<row>0 ,0 ,0 ,0, 0</row>
<row>0 ,0 ,0 ,0, 0</row>
<row>0 ,0 ,0 ,0, 0</row>
<row>0 ,0 ,0 ,0, 0</row>
<row>0 ,2 ,0 ,0, 0</row>
<row>0 ,0 ,0 ,0, 0</row>
</object_map>
</map_data>
Hi, I see on the Readme that these two features are in development:
Built-in support for block-like tiles
Ground/terrain height
The game I'm making depends on these features. Is this still coming in the future? If not, do you have any suggestions on how they should be implemented? Thanks!
Merhaba Hakan bu scriptte haritaları bi progrma yardımı ilemi açıyoruz bunun bilgisini goremedim de
Hey @axaq, thanks for making this. It seems great. Is there any plan to add support for commonjs? Maybe we could even publish it on npm?
I'd be happy to help out w/ it.
I saw some really interesting features that were upcoming but little progress lately. Overall really nice job so far.
These features can take it to the next level. Fog of war is probably a really good feature that you probably want.
Are you still maintaining it?
Best regards
Hey, very cool project and clean architecture!
My question : .
What is the best way to create the map?
You mostly did it in your head or you wrote it down on a concepttional paper?
I would like to use traviso in electron app. So when I try to get map.xml I get error "cannot getElementsByTagName of null"
So responseXML is null,but response has all needed data
This engine seems to be for making a very specific isometric game type, where you point and click movement with path tracing is only used.
But how about being able to use input from the keyboard and the joypad?
And instead of using path finding on tiles, it lets you move the object in multiple axis - with ability to jump on platforms
examples:
sonic 3d blast
https://www.youtube.com/watch?v=R47qeLEzVEc
landstalker
https://www.youtube.com/watch?v=rh3LT4gl12k
Its possible to have a multiple walking square, like multiple users?
it finds a much longer path in some cases. Might be different execution of do-while loop in Safari.
Hey axaq,
Great work with traviso.js, I'm loving it.
It has almost everything I need, except pinch zoom for mobile.
I tried to integrate with hammer.js, without success.
What are the steps to make traviso work with pinch zoom?
Best regards
Hello,
For those of us who are not using twitter, how should we get in touch?
Any "traviso@<your_fav_domain_here>.com email ? or even a contact form on the website - I cannot find anything.
Cheers!
Kind Regards
Looks like the version on NPM with the tag "v0.1.4" contains the compiled "v0.1.3".
Also it would be very convenient if there was an event that was responsible for pointing the mouse at the object/tile, and not just when clicking
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.