≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Is there any list of polyfills for es3?
Posted by:
(you are not logged in)
Enter the missing letter in: "Interna?ional"
(you are not logged in)
Text:
[quote][b][/b] wrote: Ok, this seems to work: [code]var timers = []; // define setTimeout function setTimeout(fn, ms, args) { var executeAt = (new Date()).getTime() + ms; timers.push({ fn: function () { return fn.apply(this, args); }, executeAt: executeAt }); } // register onFrameEvent which checks for // the functions which should be called ccbRegisterOnFrameEvent(function () { var now = (new Date()).getTime(); for (var i = 0; i < timers.length; i++) { if (timers[i].executeAt <= now) { timers[i].fn(); // This array remove method is slow for small arrays // but I guess you can get OutOfMemory otherwise timers.splice(i, 1); } } });[/code] Setup example: [url]https://drive.google.com/file/d/1gbCJhBGpvsIBzJ7_jFLLOegLSlZh5iB6/view?usp=sharing[/url] Notice, that if you need to pass any data you should use args arguments for that - it should be an array. I also didn't test what will happen in case you're not providing it, so if it doesn't work just put empty array there. Usage example would be: [code]var node = ccbGetCurrentNode(); setTimeout(function(node, text) { ccbSetSceneNodeProperty(node, 'Text', text); }, 1500, [node, 'a text from the script']);[/code][/quote]
Possible Codes
Feature
Code
Link
[url] www.example.com [/url]
Bold
[b]bold text[/b]
Image
[img]http://www.example.com/image.jpg[/img]
Quote
[quote]quoted text[/quote]
Code
[code]source code[/code]
Emoticons
Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact