≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
CopperCubePlugin Released
Posted by:
(you are not logged in)
Enter the missing letter in: "?nternational"
(you are not logged in)
Text:
[quote][b][/b] wrote: Hi sakura, Not trying to be mean, but can you explain what is a benefit of using this plugin? It's already possible to use multiple js files without the extension. For desktop all your data variables, functions, classes, and etc are mutually accessible from every action and behavior. I'm usually initializing my helper function and classes in an empty action files, and then add this file to "run before the first draw" on my first scene. I.e. I just create an action: [code]var data = { a: 2, b: 1}; function Dog(x, y,z) { this.x = x; this.y = y; this.z = z; } action_InitClasses = function () { } action_InitClasses.prototype.execute = function (node) { }[/code] And then I just add this to the "before the first draw". This way I have access to the Dog class and data variable from anywhere in my project. If you're targeting a webgl it's even simpler since you can just use js modules syntax, which is more flexible since you can import/export the exact functions you need instead of the whole script. Regarding importing shader text, you can still put everything into a separate file and just read the file content as string using built-in API command - that way you don't need to format hlsl to string. JSON object is a simple polyfill: [code]JSON = { parse: function (sJSON) { return eval('(' + sJSON + ')'); }, stringify: function (vContent) { if (vContent instanceof Object) { var sOutput = ''; if (vContent.constructor === Array) { for (var nId = 0; nId < vContent.length; sOutput += this.stringify(vContent[nId]) + ',', nId++); return '[' + sOutput.substr(0, sOutput.length - 1) + ']'; } if (vContent.toString !== Object.prototype.toString) { return '"' + vContent.toString().replace(/"/g, '\\$&') + '"'; } for (var sProp in vContent) { sOutput += '"' + sProp.replace(/"/g, '\\$&') + '":' + this.stringify(vContent[sProp]) + ','; } return '{' + sOutput.substr(0, sOutput.length - 1) + '}'; } return typeof vContent === 'string' ? '"' + vContent.replace(/"/g, '\\$&') + '"' : String(vContent); } };[/code] It also doesn't seem I don't need an extension for that.[/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