https://github.com/hughsk/glsl-editor
codemirror-powered GLSL editor component
https://github.com/hughsk/glsl-editor
Last synced: 3 months ago
JSON representation
codemirror-powered GLSL editor component
- Host: GitHub
- URL: https://github.com/hughsk/glsl-editor
- Owner: hughsk
- License: other
- Created: 2014-09-06T14:38:19.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-09-06T14:38:24.000Z (over 10 years ago)
- Last Synced: 2025-03-16T20:11:15.814Z (3 months ago)
- Language: JavaScript
- Homepage: http://hughsk.io/glsl-editor
- Size: 207 KB
- Stars: 15
- Watchers: 5
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# glsl-editor [](http://github.com/badges/stability-badges)
[CodeMirror](http://codemirror.net/)-powered GLSL editor component.
## Usage
[](https://nodei.co/npm/glsl-editor/)
### `editor = Editor(options)`
Creates a new editor, where `options` is passed directly onto CodeMirror. You
can find a full list [here](http://codemirror.net/doc/manual.html#config).Additionally, the `container` option determines which DOM element to attach the
editor to. By default, this will be `document.body`.### `editor.resize()`
Automatically resize the editor to fill its parent element. This on creating the
editor but you'll want to call it again when the window is resized.### `editor.getValue()`
Gets the text content of the editor.
### `editor.setValue(value)`
Sets the text content of the editor to `value`.
### `editor.editor`
The CodeMirror editor instance.
### `require('glsl-editor/css')`
### `require('glsl-editor/theme')`Inlines the base CodeMirror CSS and a default theme respectively. Useful for
just getting started quickly, but entirely optional.## License
MIT. See [LICENSE.md](http://github.com/hughsk/glsl-editor/blob/master/LICENSE.md) for details.