user2163224
user2163224

Reputation: 141

Animate CC Canvas: Variable not printing in Console

so I am using Animate CC outputting to Canvas, and have the following in my script:

var width = canvas.width; 
var height = canvas.height;

console.log(width, height);

Question: When I open the console in the preview window and type in "canvas.width" or canvas.height it returns the correct values. However the console.log doesn't print the variable values. Any ideas what I am missing here?

Thanks!

Upvotes: 0

Views: 1603

Answers (1)

Papergrave
Papergrave

Reputation: 26

I'm not sure about the scope but maybe try console.log(this.width, this.height); or

this.width = width;
this.height = height;

console.log(this.width, this.height);

Only because I know Create.js has a scope limiter to try and keep locals local. Just guessing but hope it works

Upvotes: 0

Related Questions