Closed ellisonleao closed 10 years ago
Use the var
keyword to define the settings
, x
, and y
variables.
Everything else looks ok ... ? :confused:
same results :worried:
Probably due the the fact that the width and height properties are now mandatory, try adding them in the settings parameters
On 12 févr. 2014, at 21:33, Jason Oster notifications@github.com wrote:
Use the var keyword to define the settings, x, and y variables.
Everything else looks ok ... ?
— Reply to this email directly or view it on GitHub.
settings.spritewidth = 214;
settings.spriteheight = 75;
This ones?
Just add settings.width and settings.height with the same values
Can you tell us the full stack trace if chrome gives you one? Also what line number is the error being thrown on? Use the development non-minified build if you need to :)
Can you also try to compile and use the very last vesion of melonJS? We did fix a few bugs since yesterday, and i don't remember exactly which version I used when i updated clumsy bird. My here abobe comment still apply anyway .
Same error with the latest build.
The stacktrace is the following:
Uncaught TypeMismatchError: The type of an object was incompatible with the expected type of the parameter associated to the object.
melonJS-1.0.0.js:4481
me.SpriteObject.me.Renderable.extend.draw melonJS-1.0.0.js:4481
me.ObjectContainer.me.Renderable.extend.draw melonJS-1.0.0.js:6470
me.game.api.draw melonJS-1.0.0.js:1344
_renderFrame melonJS-1.0.0.js:7718
Add a console.log above the context.drawImage() call. Output the this.image
and the this.offset
. Something there is either returning undefined or null. Im leaning more towards the image being the problem.
The issue is here : https://github.com/melonjs/melonJS/blob/1.0.0-dev/src/renderable/GUI.js#L73-74 GUI_Object has not been updated to reflect last change and shoud pass width and height to the parent constructor instead of spritewidth and spriteheight.
I could fix it now, but i'm in a bar enjoyign some good belgian beers :)
i could do the fix and open a PR myself. Could be the first of many contributions hehe
If there's any excuse worthy of not fixing a bug, it's having some belgium beer.
Amem to that :+1:
Turns out the error was a missing image on the resources. But i've notice that the settings.spritewidth and settings.spriteheight is used in many places. Is it gonna change its typo to width and height? If yes i could do this change here.
Hi guys.
I'm experiencing a strange bug. I've created a simple Gui button entity and when i'm trying to add an instance of this button on the world i get the following error:
Uncaught TypeMismatchError: The type of an object was incompatible with the expected type of the parameter associated to the object.
The me.GUI_Object:
the code part when i'm trying to add it: