obiot

Members
  • Content Count

    228
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by obiot

  1. me.Renderer is just a base class for both the Canvas and WebGL renderer to prevent duplicated code as half of it is anyway common to both. as for the setColor() methods, this is used to defined the current fill and stroke rendering color and is defined here for the canvas renderer : https://github.com/melonjs/melonJS/blob/master/src/video/canvas/canvas_renderer.js#L571-L586 and there for the WebGL one : https://github.com/melonjs/melonJS/blob/master/src/video/webgl/webgl_renderer.js#L591-L603 reason of this one not being in the base Renderer class is that, as you can see, the implementation is different based on the target renderer. hope this helps !
  2. obiot

    Passing Closed arguments to Timer

    FYI, I just added it to the current 7.0 version : https://github.com/melonjs/melonJS/commit/97d6a2eb1dd8d788112b40c6f92869e0b25b5b39 test build available below if you want to give it a try : https://melonjs-builds.s3.amazonaws.com/index.html?prefix=artifacts/master/2506/build/
  3. obiot

    Page zoom breaks inventory

    that's disappointing.... Would you mind trying with the the latest 7.0 build ? https://melonjs-builds.s3.amazonaws.com/index.html?prefix=artifacts/master/2503/build/ there is no api change between 6.4 and 7.0 that will impact you (so except maybe from the plugin it should work out of the box) also I added a me.video.renderer.updateBounds() function that you can call yourself (cleaner than a private variable) and that will update the internal cache position on the parent container. if just replacing the lib does not do anything, try calling the function from the console before/when opening the UI
  4. obiot

    Passing Closed arguments to Timer

    to keep it under my radar : https://github.com/melonjs/melonJS/issues/977
  5. obiot

    Page zoom breaks inventory

    the other issue with browser zooming is that it does not trigger any event and that melonJS is "caching" the parent relative position, see below and only recalculate it on a resize event : https://github.com/melonjs/melonJS/blob/master/src/video/video.js#L358-L367 therefore when one zoom in or out pointer coordinates are thereof off as the cached value is not correct anymore..... a quick way around it for now could be for you to set canvasOffset to null when the end user opens the UI, by doing " me.video._canvasOffset = null; " this is certainly a bit hackish, and I will probably rather add a method like "updateBoundingClientRect()" or something (that can be called from somewhere we can detect a zoom), but at least it can help validate my assumptions (if you don't mind testing it)
  6. obiot

    Passing Closed arguments to Timer

    Indeed this is a valid request and to be honest i don’t recall why arguments passlng has not been included when we implemented these functions, as this is indeed supported by the global « standard » ones. i’m glad that you found a way to make it work for you (passing arguments to bind was another one), but i’ll look anyway into adding it to our setTimeout and setInterval methods. Thanks !
  7. obiot

    Page zoom breaks inventory

    so I tried this morning, but I'm not getting how to actually zoom in or out the browser with the game going fullscreen when starting, and the browser switching back to the main screen (score/$ dashboard, screen "return to game/how to play/etc...), how do you actually zoom ?
  8. thanks for the feedback, but coming from the Unity word, isKinematic is kind of well know as they define the same property. Now admittedly the use of isKinematic has been slightly abused in melonJS to also apply to pointer event as well (if this is what you mean), where it should be limited to physic interactions/motions.
  9. obiot

    Page zoom breaks inventory

    Hi, did it help ?
  10. obiot

    Entity - set second bounding box

    y-order sorting is a way to cheat with sprite draw sorting, especially in isometric games, so that (simply put) things at the bottom of the screen are properly overlapping thing at the top if you google it (game y-order sorting) you'll find lots of discussion about it, vs z-ordering and with some examples and pro&cons. About changing colour, using the latest (6.4.0) version of melonJS and WebGL (tinting is not yet available with the Canvas Renderer), you can use the sprite tinting features : http://melonjs.github.io/melonJS/docs/me.Renderable.html#.tint (note that in the 6.x release cycle, WEBGL is not the default, you will have to force it in the video init method at least by specifying `renderer : me.video.AUTO`, this will change in the 7.x release as WebGL will now be the default). about hovering, you can use the `pointerEventer` and `pointerLeave` event (http://melonjs.github.io/melonJS/docs/me.input.html#.registerPointerEvent), see as well an example of a hover feature in the GUI example : https://github.com/melonjs/melonJS/blob/master/src/renderable/GUI.js As for the bounding box, I did not really "deeply" think about your issue, but yeah definitely, on top of the y sorting (if that helps) you should really consider upgrading to the latest version if possible. the changelog is quite huge since the 5.1.0 version : https://github.com/melonjs/melonJS/blob/master/CHANGELOG and except for all utility function that were moved under the me namespace, mostly all API changes since then were implemented in a backward compatible fashion, so updating should be relatively smooth : https://github.com/melonjs/melonJS/wiki/Upgrade-Guide. hope this all helps ! and yes I would love to try your games, will send you an email right after, thanks 😛
  11. obiot

    Boiler Plate Grunt for Self Hosting

    FYI I just finished replacing grunt by rollup to create our melonJS bundle. its pretty cool actually, and I can now truly external dependencies as they are and "bundle" at build time ! https://github.com/melonjs/melonJS/blob/master/rollup.config.js
  12. obiot

    Page zoom breaks inventory

    Hi, sorry for the long delay in replying, did you fix your issue ? there are actually 3 events you could subscribe to (also triggered in the following sequence): WINDOW_ONRESIZE : http://melonjs.github.io/melonJS/docs/me.event.html#.VIEWPORT_ONRESIZE (that actually follow the standard "DOM" size/orientation change event) VIEWPORT_ONRESIZE : http://melonjs.github.io/melonJS/docs/me.event.html#.VIEWPORT_ONRESIZE CANVAS_ONRESIZE : http://melonjs.github.io/melonJS/docs/me.event.html#.CANVAS_ONRESIZE so assuming all you "need to know" is when the window is being resize, you can then do : me.event.subscribe( me.event.WINDOW_ONRESIZE_CHANGE, function resizeMyUI() { // do something amazing } );
  13. obiot

    melonJS 6.4.0

    Hello, shortly after the Chinese new year, here is a new release of melonJS, High-Level Changes : New documentation format, including a better, more modern, layout and search feature. http://melonjs.github.io/melonJS/docs/index.html Support for Multiple Texture Packer Textures Added Colour Tint support for Renderable (WebGL mode only for now) Bunch of small fix and improvements on Renderable, Animations, Isometric rendering, and System renderers See here for a more detailed changelog, there is no API change this time (just some internal re-factoring), so you can safely upgrade without breaking your game Have fun guys, and let us know what you think about the new documentation ! (it certainly can be further tweaked/improved) --- the melonJS team
  14. obiot

    melonJS 6.4.0

    Add to what ? Can you be more specific? Thanks.
  15. obiot

    function of the Sprite Object not recognized

    Hi, since the 6.0.0 version we sandboxed all previous extensions under our me namespace : https://github.com/melonjs/melonJS/wiki/Upgrade-Guide#5xx-to-600 As a consequence the clamp method is since then only available through me.Math.clamp() http://melonjs.github.io/melonJS/docs/me.Math.html#clamp rather do : pos.x = me.Math.clamp(val, min, man) should fix your issue.
  16. obiot

    Boiler Plate Grunt for Self Hosting

    I would love to move to yarn or web pack actually, including for the engine itself, but I just did not have the time to look at it.
  17. obiot

    me.Renderable.onVisibilityChange()

    found and fixed a similar case https://github.com/melonjs/melonJS/commit/43d91c800fa684ae2fe61e26d183842cc254dfcb
  18. obiot

    Boiler Plate Grunt for Self Hosting

    Thanks, i will look into it, but only tomorrow
  19. obiot

    me.Renderable.onVisibilityChange()

    so yeah, not sure why to be honest, maybe the combination of bitwise operation and using getter, but indeed sometimes a non Boolean value was passed ! the fix is quite easy actually, have a look below in case you want to fix it in your current build without/while waiting for the 6.4.0 version (I will release it within a few days): https://github.com/melonjs/melonJS/commit/117d083b70d82bcacb35767c24d1c1aaba26579b thank you for the feedback !
  20. obiot

    me.Renderable.onVisibilityChange()

    really ??? ok, I'll investigate this one further to see where this 1 or 0 is coming, thanks !
  21. obiot

    me.Renderable.onVisibilityChange()

    hi, I'm not sure I understand what you mean; are u saying that inViewport is sometimes equal to 1 or 0 ? in theory this should not be possible, as the value is the one returned by the camera isVisible function, that always returns true or false : https://github.com/melonjs/melonJS/blob/master/src/renderable/container.js#L836 https://github.com/melonjs/melonJS/blob/master/src/camera/camera2d.js#L575
  22. obiot

    Keyboard Input not Working in Chrome

    Hi, using Chrome 71 (on macOS) and this online example also using version 6.3 (http://melonjs.github.io/melonJS/examples/platformer/) I'm not able to reproduce your issue. Are you doing anything special than just a html page or any plugin ? note that a similar issue has been reported with the Evernote plugin "stealing" user inputs, see here : https://github.com/melonjs/melonJS/issues/963 if not, would you be able to build a minimal version/build of your game and share it ?
  23. Yeah, anchor point is still an issue sometimes. We are trying to move away from the current messy entity implementation and favor the addition of a physic body to “standard” renderable. In the mean time using top-left coordinates as the anchor does indeed help.
  24. obiot

    Fix position after scale

    sorry man, I did not have the time on my side to look at it yet.... but if you are up to it, I'll be super happy to integrate/merge any proposition for improvements
  25. so how many png or jpg are you loading totally ? how does your asset list looks like ?