obiot

Members
  • Content count

    90
  • Joined

  • Last visited

About obiot

  • Rank
    Advanced Member
  • Birthday July 20

Contact Methods

  • Website URL
    http://melonjs.org/
  • Twitter
    melonjs

Profile Information

  • Gender
    Male
  • Location
    Singapore

Recent Profile Visitors

374 profile views
  1. if you would check the documentation, you would realize that the setColor function only take as input a me.Color object or a CSS string, so you should use either : renderer.setColor(myColor); // where myColor is an instance of me.Color or renderer.setColor("#0000007F"); // the forth byte (7F) is to specify the opacity level http://melonjs.github.io/melonJS/docs/index.html
  2. indeed, the worldToLocal() method is definitely one of your friend here to convert to screen coordinates.
  3. in the UI Example, that's exactly what we do : we use a container, but then we have a child renderable that we use for the background (i personally find it cleaner that overriding the draw method). It is a sprite object in this case, but you could use a renderable and using the renderer (arguments from the draw method) to draw it, add opacity, etc... as explained by Aaron. https://github.com/melonjs/melonJS/blob/master/examples/UI/js/entities/UIContainer.js
  4. we have a wiki page that we maintain on this purpose : https://github.com/melonjs/melonJS/wiki/Upgrade-Guide also, there is some good upgrade guide made by Cian Games (unfortunaly they stop at version 2.x though) : http://blog.ciangames.com/2014/08/upgrading-to-melonjs-10.html http://blog.ciangames.com/2014/09/upgrading-to-melonjs-11.html http://blog.ciangames.com/2014/11/upgrading-to-melonjs-20.html http://blog.ciangames.com/2015/05/upgrading-to-melonjs-21.html and generally speaking I would definitely check our wiki page, as it contains tons of informations and how-to on various topics (especially the 3rd-party tools section) : https://github.com/melonjs/melonJS/wiki
  5. @gamify did you try drawing the path, and using the dev console to check what is going on ? At some point you have to experiment by yourself, and here we are just talking about drawing a line, and not some super advance game algorithm or stuff. So either from the melonJS renderer : https://melonjs.github.io/melonJS/docs/me.CanvasRenderer.html or just using the standard canvas API : https://www.w3schools.com/tags/canvas_lineto.asp
  6. using Texture Packer : https://www.codeandweb.com/texturepacker Tutorial here : https://www.codeandweb.com/texturepacker/tutorials/using-sprite-sheets-with-melonjs-tutorial which translates to this in the UI example : https://github.com/melonjs/melonJS/blob/master/examples/UI/js/game.js#L23-L28 https://github.com/melonjs/melonJS/blob/master/examples/UI/js/entities/UIContainer.js#L28 https://github.com/melonjs/melonJS/blob/master/examples/UI/js/entities/buttons.js#L21
  7. pointer event or not does not really matter, just pick up a point in world coordinate (e.g. an entity position or any random point) and give it as parameter to the getTile function : http://melonjs.github.io/melonJS/docs/me.TMXLayer.html#getTile i'm not sure what you mean by though
  8. toIso and to2d are class methods ! this.patrol_addPoint( (new me.Vector2d(100, 100)).toIso() );
  9. you just need to add a entity with a body shape, at the same place of the house, and check for collision from or with that entity. if you look at the melonJS source code, it's all we really we do : create an entity with a body, and configure them as WORLD_SHAPE for the the collision layer : https://github.com/melonjs/melonJS/blob/master/src/level/TMXTiledMap.js#L463-L465
  10. you just need to add a entity with a body shape, at the same place of the house, and check for collision from or with that entity. if you look at the melonJS source code, it's all we really we do : create an entity with a body, and configure them as WORLD_SHAPE for the the collision layer : https://github.com/melonjs/melonJS/blob/master/src/level/TMXTiledMap.js#L463-L465
  11. once you get a reference to the layer you want, you can get the tile information by using the getTile function : http://melonjs.github.io/melonJS/docs/me.TMXLayer.html#getTile here is an example here, where we use this to highlight the tile under the mouse pointer : https://github.com/melonjs/melonJS/blob/master/examples/isometric_rpg/js/screens/play.js#L46
  12. updateMovement is pretty old, it was from the 0.x and 1.0 version, before we added a full SAT based collision system. anyway, glad you solved it, and keep in mind that we have a page about migration tips : https://github.com/melonjs/melonJS/wiki/Upgrade-Guide
  13. indeed, our scale function (as for all matrix functions) follows the standard one : https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/scale
  14. game.currentMenu = this; assuming currentMenu is where you keep hold of the current menu, and assuming you do this from the current menu open (so this is your current menu instance)