• Content Count

  • Joined

  • Last visited

1 Follower

About Growler

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. In Melon JS 8.0, how can I create a draggable line and check if, when dragged, it overlaps two circles? The start point of the line and end point of the line should be checked for overlap. I.e., the center of the line overlapping the circle shouldn't count. @obiot
  2. Hello, I'm on a Macbook Pro 15" monitor, on Google Chrome. MelonJS 5.1. 640 x 480 dimension. if (!, 480, { wrapper: 'screen', scale: 'auto', scaleMethod: 'fit', renderer:, subPixel: false, })) { alert('Your browser does not support HTML5 canvas.'); return; } I'm trying to request full screen. I'm using DOM elements for the GUI, so I'm requesting full screen on documentElement: me.device.requestFullscreen(document.documentElement); When I change to full screen, there's no issues with my pointer events— e.gameX, e.gameY. When I exit full screen, e.gameY seems to be permanently offset by the height difference expanding back to normal viewport, by about 84 pixels. This only happens when I have Chrome console closed. If Chrome console is open, there's no issue with e.gameY. Clicking in the same exact location each time, I get: Normal browser viewport: e.gameX: 3018.744 e.gameY: 2284.550 Full screen: e.gameX: 3018.138 e.gameY: 2284.371 Exited full screen: e.gameX: 3018.465 e.gameY: 2367.873 Why does this happen?
  3. Using Tiled 1.3.1 and MelonJS 7.1.1, I'm rotating your platformer tutorial tilesets with Tiled hotkeys x (flip active stamp horizontally), y (flip active stamp vertically), and z (rotate active stamp clockwise) - In tiled, using piece: I flip it around using x, y, z to achieve this. It seems like 180 degree/horizontal flips cause problems. Why is this? In the Tiled map editor: In game: @obiot @Parasyte
  4. @obiot @Parasyte any thoughts on this?
  5. How do I stroke the outside of a font? font.drawStroke seems to stroke the inside of the font. Something like this: (as shown in this issue here: Your example, here, doesn't seem to show clearly how to do this. @obiot My code: game.ClickableEntity = me.Entity.extend({ init: function(x, y, settings) { ... this.color = 'black'; this.font = new me.Font('Verdana', 14, this.color); this.font.bold(); this.font.strokeStyle.parseCSS('white'); this.font.lineWidth = 1; draw: function(renderer) { this.font.draw(renderer, this.text, (this.width/2)-10, (this.height/2)-10); this.font.drawStroke(renderer, this.text, (this.width/2)-10, (this.height/2)-10); }, How mine currently looks in game:
  6. @obiot This bug is happening again, but only on Mandarin version, even though I'm loading I think fewer overall assets than the working Spanish version. Question: what are texture units (i.e., what does "16 texture units" mean?) and how do I compare it to overall loaded texture size? If I print out game.map_texture, how do I compare it to see if it's below 16 units? game.map_texture = new me.loader.getJSON(`${country}_map_items`), me.loader.getImage(`${country}_map_items`) ); Mandarin Version: Printing out length for my three texture atlases: console.log('Game Texture: ', Object.keys(game.texture.atlas).length, game.texture); > length of game.texture.atlas is 1236 console.log('Game Map Texture: ', Object.keys(game.map_texture.atlas).length, game.map_texture); > length of game.map_texture.atlas is 354 console.log('Game Player Texture: ', Object.keys(game.player_texture.atlas).length, game.player_texture); > length of game.player_texture.atlas is 107 Working Spanish Version: Printing out length for my three texture atlases: > length of game.texture.atlas is 1215 > length of game.map_texture.atlas is 358 > length of game.player_texture.atlas is 107 --- Mind checking the game out? Spanish: Mandarin: Use promo code "LEEROY" for free full game access. You're able to see the asset list loaded. Images of my packed assets on disk: Spanish: - - map items - - texture Mandarin: - - map items - - texture
  7. In MelonJS 5.1, after I load the level and the player entity, I set the player's position somewhere else (testing positioning) via: this.pos.x = 1000; this.pos.y = 1000; For some reason, melon fades the screen out to white, re-renders the entire environment (it seems), and the player entity doesn't appear. I also get error: Uncaught TypeError: Cannot read property 'flipX' of undefined Which is complaining at line this.renderable.flipX(...) So it would appear the renderable is removed from the player entity. Moreover, other screen entities also appear to be destroyed, as I have logs in each entity's onDestroyEvent. All entities appear to be destroyed on a simple positioning of the player entity. Update: I tested logging the renderable and body property objects on the player entity before and after setting the position. Before, the renderable and body are both defined correctly according to the docs. After, both renderable and body are both undefined, yet the entity class is still instantiated. Question: Why is the entity or entity's renderable removed and why does the screen fade out on a simple entity repositioning? Note: I do not have a player entity object directly added to the Tiled map. Instead, I have a "spawn entity" object where I place at the position of where the player entity should ultimately be instantiated at a certain point in the game. I also have alwaysUpdate = true on the player entity. @obiot
  8. @obiot separately (I know I should probably start a new thread), do you know how can I maintain order of Tiled Layers? As you can see from the tiled Layers image below, Player should always appear behind building overlap (since it's ordered below in Tiled) yet in game he appears in front. Secondly, if I have to manually change the layering, how I can get access to the tiled layers within melonJS code?
  9. @obiot I just don't have time to read thru changes I need to make from 5.1 to latest. I guess the WebGL "Texture cache overflow: 16 texture units available." error is pretty annoying but not sure any Melon upgrades can solve that limitation. (I talk about it here: If you email me at I can send you the game so you can check it out. Perhaps as you play maybe you can find some reasons I should upgrade?
  10. Hello, I wanted to use this particle creator/editor as I have many times before but it's down now: Error throw in console is: Uncaught TypeError: context.beginPath is not a function Seems you've updated its MelonJS to latest without making necessary changes? I'm on Melon JS 5.1 and don't have plans to upgrade for the time being. Can you restore the functionality of this please? @obiot
  11. @PLAYERKILLERS What does sortOn "y" do? Can you elaborate a bit more on this answer and perhaps provide a couple examples?
  12. @obiot Hi Obiot. Wondering if you can help with this? Btw my game is ready if you're interested in trying it - please email me at
  13. Using Melon JS 5.1, I want to have an entity bounding box for collision, and a separate box for click interactions. Meaning, the smaller thin red rectangle is collision for the tree. If the player's Y coords are less than the tree's red collision rectangle, the tree appears behind the player. If the player's Y coords are greater than the tree's red collision rectangle, the tree appears in front of the player: Player in front: Player behind: game.TreeEntity = game.MapObjects.extend({ /** * constructor */ init: function(x, y, settings) { // super constructor this._super(game.MapObjects, 'init', [x, y, settings]); this.body.removeShape(this.body.getShape(0)); // Divide height by 10 because we want the collision box to be basically flat this.body.addShape(new me.Rect(0, 0, settings.width/2, settings.height/6)); this.anchorPoint.set(0.5, -2); ... me.input.registerPointerEvent('pointerdown', this, (e) => { console.log('This is a ', this.type); }); I've tried adding a second shape to the Tree. The idea, again, you have a large area to click on the tree and get information about it. This new click rectangle is causing the original centered collision red rectangle to offset to the top left: Problematic offset larger shape: // Clickable to get name this.body.addShape(new me.Rect(0, 0, 96, 192)); this.anchorPoint.set(0.5, 0.5); This is my desired end result: ------------------------- Moreover, the registered click event, registerPointerEvent, bound to this (the tree entity) only fires on clicking the smaller collision rectangle, not the larger shape intended for clicks. Questions: 1) how can I add a second clickable rectangle on the Tree entity that doesn't interfere with the current smaller red rectangle collision shape? 2) how can I specifically bind the registerPointerEvent to the larger clickable rectangle, not the smaller collision shape? 3) On hover, how can I change the coloring and/or opacity (to indicate that the tree is clickable) @obiot @Parasyte