CreateJS / TweenJS

A simple but powerful tweening / animation library for Javascript. Part of the CreateJS suite of libraries.
http://createjs.com/
MIT License
3.56k stars 966 forks source link

Tick listener and GetContext Error #93

Closed ratuspro closed 6 years ago

ratuspro commented 7 years ago

I'm using TweenJS and EaselJs installed using bower. I've encountered a problem recently where it seems the tick listener is calling the procedure this.canvas.getContext several times prompting this error:

image

Any suggestion?

lannymcnie commented 7 years ago

Sounds like the canvas is not null, but it has no context. What have you passed to the Stage as a canvas reference?

ratuspro commented 7 years ago

I've passed a canvas element. I'm trying to figure out what happened since I was able to run the code without errors in a different context. I think it has something to do with the canvas element not having a width or a height specified in html.

lannymcnie commented 7 years ago

Pretty sure a 0-size canvas still has a context. Can you provide a fiddle or something?

gskinner commented 7 years ago

A canvas tag without a context uses a default width / height (300 x 150), so that shouldn't be an issue. As Lanny mentioned though, the error you're getting would strongly indicate you may be passing in the wrong tag or something.

gskinner commented 6 years ago

Closing. Feel free to reopen if this is still an issue and more info is available.