How to use the mage-engine.engine function in mage-engine

To help you get started, we’ve selected a few mage-engine examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MageStudio / Mage-Studio / _OLD / app_OLD / Interface.Sidebar.Right.js View on Github external
_setShaderOptions: function(shaderName) {
        var options = require('mage-engine').engine.fx.shadersEngine.get(shaderName).options,
            container = document.querySelector('#shaderOptions');

        if (options) {
            // now creating form for shader option
            for (var k in options) {
                var input = app.interface.sidebarHelper.createFormInput(k, options[k]);
                container.appendChild(input);
            }

            container.appendChild(app.interface.sidebarHelper.createButton('update', app.interface.rightSidebar.meshListener.changeShaderOption))
        } else {
            console.warn('Selected shader doesn\'t have options.');
        }
    },
github MageStudio / Mage-Studio / _OLD / app_OLD / Interface.Sidebar.Right.js View on Github external
_setShaderSelector: function() {
        var engine = require('mage-engine').engine,
            shaders = engine.fx.shadersEngine.SHADERS;
        
        for (var i in shaders) {
            var li = document.createElement('li');
            li.role = 'presentation';
            var a = document.createElement('a');
            a.role = 'menuitem';
            a.tabindex = '-1';
            a.dataset['name'] = shaders[i];
            a.onclick = function() {
                app.interface.rightSidebar.meshListener.changeShader(this.dataset['name']);
                app.interface.rightSidebar._setShaderOptions(this.dataset['name']);
            }
            a.innerText = shaders[i];
            li.appendChild(a);
            $('#shaderSelector').append(li);