Growler Posted February 26, 2018 Share Posted February 26, 2018 I borrowed the code from http://melonjs.github.io/melonJS/examples/platformer/#debug to create my own game. I'm on Melon5.1. From that tutorial, the Tiled map is 35x35px tiles, and the resolution is 800x600 (see here: https://github.com/melonjs/melonJS/blob/master/examples/platformer/js/game.js). The GUI elements (sound, joystick, etc) this.opacity change work fine. onOver : function (/* event */) { this.setOpacity(1.0); }, My needs are for 16x16px tilesize, and heard 1280x640 is a good resolution for this. If I adjust to this, however, here are the issues: - Debug panel: click events no longer work. - GUI_Object element opacity: this.opacity doesn't change even though the hover event is firing. When I move the character, all of a sudden the opacity onOut (this.setOpacity(0.5)) fires. But only once. It's as if the hover event to setOpacity is called but doesn't update the opacity under I move the character (I guess which calls animation redraw?). And what's more weird: when I have debug panel open, hover works every time on the GUI buttons. See images below. - GUI_Object hover events: for my custom GUI element, which I've scaled to .5, .5: hover events are no longer registering. It registers when I refresh the game page, works a couple times, then stops. Why is this? Seems quite buggy. Note: resolution at 640x320, I am able to click the debug toolbar buttons. But at another multiple of 16 resolution, 1280x640, I cannot. if (!me.video.init(640, 320, {wrapper : "screen", scale : "auto", scaleMethod : "fit", renderer : me.video.AUTO, subPixel : false })) { alert("Your browser does not support HTML5 canvas."); return; } -------------------- Second question: me.GUI_Object doesn't accept width/height parameters. While you can set the framewidth and frameheight in settings, how can I scale the object down on screen? GUI_Object extends sprite which extends renderable, so I should be able to do this.scale(.5, .5), right? If I do this, it scales but looks very pixelated even on the down scale. Quote Link to comment Share on other sites More sharing options...
Growler Posted March 17, 2018 Author Share Posted March 17, 2018 @obiot @Parasyte any thoughts on this? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.