• Content Count

  • Joined

  • Last visited

Everything posted by obiot

  1. 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
  2. so how many png or jpg are you loading totally ? how does your asset list looks like ?
  3. obiot

    How to set animation on GUI_Object using texture atlas?

    GUI object are just extending the me.Sprite object, so assuming you pass the right argument to the constructor, it should be working. Can you share how you instantiate your object ? if you pass game.texture for the image setting parameter it should do the trick.
  4. the issue is that WebGL has a limited amount of texture, and as of today the limit is 16 for ~70% of devices : in my opinion the only way to fix that is either to pack/merge your tilesets directly, or to use TexturePacker (that was the fix back in 2015) when possible (
  5. obiot

    [Noob Question] Rotate toward mouse cursor

    considering the result in wall to wall, I supposed you managed to fix it ? good mini-game by the way, I had fun playing it and almost did 100 points
  6. obiot

    Change image quality

    you are welcome, and happy it worked as you expected
  7. obiot

    Change image quality

    melonJS will overwrite whatever you set in the CSS based on the parameter(s) passed to the video init function : if you need/want to disable the pixelated rendering mode, just the set the antiAlias flag to true (for example) :, 600, {wrapper : "screen", scale : "auto", scaleMethod : "flex-width", antiAlias : true, subPixel : false })
  8. obiot

    [Noob Question] Rotate toward mouse cursor

    There is really nothing more to it, it’s a pretty simple and straighforeward function, and if it rotates in the wrong direction just negate the angle. I wish i could provide you a more detailed answer but on this year end i’m traveling and do not have my laptop. So unless someone else can provide a better answer you will have to experiment a bit by yourself to find the solution you need. Happy New Year !
  9. obiot

    How to change animation when game paused

    You can use the updateWhenPaused flag on any renderable based object to update them even when the game is paused:
  10. obiot

    [Noob Question] Rotate toward mouse cursor

    me.pointer.pointer.pos is already a Vector object, so you should be able to directly use it with the angle function, with something like “this.renderable.currentTransform.rotate(this.pos.angle(me.input.pointer.pos);” which version of melonJS are u using ? Older (5.x), required the renderable.autoTransform to be manually set to true.
  11. obiot

    melonJS 6.3.0

    on this Christmas Eve, I'm happy to be able to "put" a new 6.3.0 version of melonJS under your virtual Game Dev Christmas tree The menu today will be the following : the WebGL renderer went through some heavy internal changes to align it with the Canvas one in terms of graphic rendering, allowing to stroke and/or fill all shapes properly (see here for a simple example of the final result, demonstrating shape drawing + alpha blending + mask/clipping in WebGL). on top of the API improvement for shape drawing, the WebGL renderer has also been greatly optimised in terms of memory usage or shape drawing operations (faster, better, stronger) renderable now support rendering mask in both Canvas and WebGL mode, by simply adding a me.Shape mask object to any renderable. This feature is pretty cool, works with any object inheriting from me.Renderable (Container, Sprite, etc...) and is the easiest ever to use audio core has been updated, and improve the audio unlock features (since desktop browser now also need that...) other small fixes here and there to make all the elves secretly running your game loop happier See here as well for a more detailed changelog, there is only one API change but in a backward compatible way, so you can safely upgrade without breaking your game Wishing everybody a Merry Christmas ! --- the melonJS team
  12. obiot

    Entity glow

    Hi, different ways i see to acheive that : 1. Draw a glow sprite overlay on top of your sprite (extend the draw method and draw your glowing sprite after call the parent draw function) 2. Draw a glowing ellipse using the renderer fillEllipse function (note that you need the 6.3.0 version that also implement it for the webGL Renderer). 3. Use a webgl shader, but this would work only in webgl mode and we still lack anyway the possibility to add a shader effect on sprite object (in my todo list for the next 6.4 version) let me know what you came up with !
  13. obiot

    melonJS 6.2.0

    as always, happy to announce that the latest 6.2.0 version is now available, and come packed with some nice improvements : text object have been redesigned into a more generic object and can now be added to an object scene as any other renderable we greatly optimised object re-cycling within the engine, so that melonJS keeps better control of its own internal object instances and does not add any unnecassry "stress" on the Garbage Collector. Benefits and improvement is especially noticeable on low-end devices (additionally the debug panel also now display the amount of reusable object instances currently in the object pool) improved support for Tiled with text object support and orthogonal rendering order Camera implementation has been redesigned partially, this is still a work in progress, but it's halfway there in order to allow adding several camera with a different viewport. the preloader now supports Font face preloading Bunch of other small improvements and fixes here and there See here as well for a more detailed changelog, there are also a few API changes but in a backward compatible way, so you can safely upgrade without breaking your game Have fun and tell us what you think. !
  14. obiot

    Can't Add Image Layer from PNG

    also I'm on the 6.x master branch, which version of melonJS are u using ? (might be a bug in a previous version that was fixed since then)
  15. obiot

    Can't Add Image Layer from PNG

    there is must be something not right somewhere, because I just tried on my side and the following is perfectly working : me.ImageLayer(0,0, {image:"cityscene"}), 1); and cityscape is the name of an png image with the src set to "data/img/cityscene.png" Are you sure, the path to the image is correct, and that the image is properly returned by your server ? Else, can you share your example, because just like this I have no clue why it's not working.
  16. obiot

    Can't Add Image Layer from PNG

    Can u share your game.resource list to verify if background is the actual asset name ? (As opposed to the filename)
  17. well that's an interesting one too, I was just looking at the code and indeed there is nothing to manage key status when the window/browser is losing status. So two solutions to that : you can disable the pauseOnBlur feature (true by default), which means the game won't pause when the window will loose focus, and that the keys will properly "behave" or (and this is what I would do in melonJS to fix this), is to register on the state pause or resume event (that are called when the window is losing/regaining focus) and simulate the required keydown or registered keys using `triggerKeyEvent(YOU_KEY, false) these are more workaround, but at least they won't conflict with a later fix in melonJS
  18. obiot

    melonJS 6.1.0 release

    Hi fellow melon lovers Here is a 6.1.0 version, beside others small improvements, this version focus mainly on the issue(s) raised with the 6.0.0 version around Linux and our WebGL Renderer (as you can read it here). Download link : Full changelog : Audio : latest audio core update (2.0.15) Core : new linux detection flag under me.device Renderer : now systematically warn when using non POT texture in both Canvas and WebGL mode Sprite : new function to allow reversing a given or current animation TMX : support for the Tiled 1.2 beta JSON property format (backward compatible with previous 1.1 version) CanvasRenderer : fix drawImage sub-pixel rendering in Canvas mode when using the short notation (2 or 4 parameters) WebGLRenderer : only throw an exception (e.g. stop execution) when using repeat/wrap mode with a non POT texture WebGLRenderer : properly fallback to Canvas mode in AUTO and WEBGL mode when failing at creating a valid WebGL Context Also, there are no API breaking changes, so purely a "drop-in" replacement ! Cheers, -- the melonJS Team
  19. glad that you found it, thank you for the analysis and feedback, I guess a way to prevent this kind of error would be to throw an exception if the loader ecounters assets with duplicate/similar names. what do you think ?
  20. Hi, to help me track down the issue, or at least allow me to confirm it's still present in the current 6.2 version, could you define the most minimal example that reproduce the issue and share it ? you know that if this is a bug I'll fix it on the coming 6.2 version though.... so unless you want to back port it to the 5.1 version, you will have to upgrade thanks !
  21. obiot

    hidden GUI objects slow game render?

    @can2nac FYI I know that since you changed the way you implemented the UI, but yet I did the changes we discussed in the thread. how is your game progressing by the way ?
  22. obiot

    frame has no offset property

    oh ok good you did then ! what exactly was the issue ? (I fail to see how it was triggering the above exception) Else you should really upgrade to at least 6.1 (6.2 is not yet publicly released), tons of improvements since 5.1 and except for the utils.xxxx functions, there are no major breaking changes
  23. obiot

    melonJS 6.1.0 release

    Good catch on this one, was probably hanging there since version 5.x !
  24. added to master :
  25. there is no really an event for it currently, but you can check for the inViewport value to detect if the object is currently in the viewport or not. definitely a good addition though, created a ticket to keep it under our radar :