[Plugin SDK] document not defined in edittime

Bugs will be moved here once resolved.

Post » Thu Nov 03, 2011 1:20 pm

It appears that document is not available in edittime...

This throws undefined document:

var canvas2 = document.createElement('canvas')

Unless there is another way to create an offscreen canvas in edittime, I have no other way of rendering textures outside the existing canvas (for caching, image composition etc.).

In runtime, document is accessible.Mipey2011-11-03 13:21:10
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Thu Nov 03, 2011 1:28 pm

This isn't a bug - from the SDK docs:

[quote]You cannot use browser features in the edittime, since the edittime script is interpreted by Google's V8 javascript engine rather than a real browser.[/quote]

'document' is a browser feature, and there is no browser running when running the editor, so you cannot use any browser features at all! It's only the javascript engine, so assume nothing is available except the documented functions.Ashley2011-11-03 13:28:13
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,630

Post » Thu Nov 03, 2011 1:36 pm

Ah, somehow missed that bit. Fair enough, thanks for prompt answer!

I was hoping to get some kind of preview for my spritefont plugin, looks like I may have to do it the hard way.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 0 guests