How to use scratch-render - 2 common examples

To help you get started, we’ve selected a few scratch-render 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 LLK / scratch-gui / src / containers / stage.jsx View on Github external
mouseDownTimeoutId: null,
            mouseDownPosition: null,
            isDragging: false,
            dragOffset: null,
            dragId: null,
            colorInfo: null,
            question: null,
            sprites: null,
            stageURL: null
        };
        if (this.props.vm.renderer) {
            this.renderer = this.props.vm.renderer;
            this.canvas = this.renderer.canvas;
        } else {
            this.canvas = document.createElement('canvas');
            this.renderer = new Renderer(this.canvas);
            this.props.vm.attachRenderer(this.renderer);
        }
        this.props.vm.attachV2SVGAdapter(new V2SVGAdapter());
        this.props.vm.attachV2BitmapAdapter(new V2BitmapAdapter());
        this.props.vm.setVideoProvider(new VideoProvider());
        this.props.vm.on('LOADED_PROJECT', () => {
            console.log('LOADED PROJECT');
            requestAnimationFrame(this.step.bind(this));
        });
    }
    componentDidMount () {
github LLK / scratch-gui / src / components / gui / gui.jsx View on Github external
} = props;
    if (children) {
        return {children};
    }

    const tabClassNames = {
        tabs: styles.tabs,
        tab: classNames(tabStyles.reactTabsTab, styles.tab),
        tabList: classNames(tabStyles.reactTabsTabList, styles.tabList),
        tabPanel: classNames(tabStyles.reactTabsTabPanel, styles.tabPanel),
        tabPanelSelected: classNames(tabStyles.reactTabsTabPanelSelected, styles.isSelected),
        tabSelected: classNames(tabStyles.reactTabsTabSelected, styles.isSelected)
    };

    if (isRendererSupported === null) {
        isRendererSupported = Renderer.isSupported();
    }

    return isPlayerOnly ? (
        
    ) : (
        
            {previewInfoVisible ? (
                
            ) : null}
            {loading ? (

scratch-render

WebGL Renderer for Scratch 3.0

BSD-3-Clause
Latest version published 1 day ago

Package Health Score

75 / 100
Full package analysis

Popular scratch-render functions

Similar packages