For fun and the sake of learning I recently started to work on my own html canvas project. Now I'm pretty much finished, I just want to upload it to Wallpaper Engine where user can set it as their own animated Wallpaper.
For that I wanted give the user the possibility for some options of the wallpaper.
I've followed the Instructions you can find here
Now I have the following problem, that a variable for an option, won't change globally, just inside its parent. See the code:
var scale = 1,
dotsize = 1,
dotgap = 8,
text = 'example',
fontFamily = 'Arial',
fontSize = 300,
radius = 200;
window.wallpaperPropertyListener = {
applyUserProperties: function(properties) {
if (properties.text) {
text = properties.text.value;
alert(text)
}
}
};
alert(text)
The first alert after taking the content from Wallpaper Engine shows me the right text (whatever the user put inside the text field)
However, the alert at the end will show me the 'example' string I have set above.
I tried different this like using window.text or var text etc, but can't figure it out.