Skip to content

Instantly share code, notes, and snippets.

@ngokevin
Created January 31, 2017 12:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ngokevin/719ed8d2a475e23694ef8725cce563a9 to your computer and use it in GitHub Desktop.
Save ngokevin/719ed8d2a475e23694ef8725cce563a9 to your computer and use it in GitHub Desktop.
A-Frame Text Editor Plugin Spec
// If you're interested in developing text editor or IDE plugins for A-Frame, here are the A-Frame specific pieces.
1. Syntax highlighting of A-Frame's ECS syntax, which is the same as inline CSS styles.
2. Support autocompletion of component names. This includes core components like geometry, material, obj-model, light, position, rotation, scale. These can be programatically populated from `AFRAME.components`. But, we can also include community components from the Registry (e.g., physics, particle systems, mountains, animations). We can populate from these JSON files https://github.com/aframevr/aframe-registry/blob/master/build/0.4.0.json based on the A-Frame version. If a community component is selected, then inject the script tag into the <head>.
3. Support for autocompletion of component property names. Typing `material="` would expose a dropdown component properties color, roughness, src, envMap, displacementMap, etc. See https://aframe.io/docs/0.4.0/components/material.html#properties-1 for all the material properties. These can be populated from `AFRAME.components[<componentName>].Component.schema`.
4. Support for autocompletion of component property values. If a component has a discrete list of possible values, then display them. For example, `geometry="primitive: <VALUE>"` can be from box, sphere, cylinder, tetrahedron, etc. These can be populated from `AFRAME.components[<componentName>].Component.schema[<propertyName>].oneOf`.
5. Widgets based on property types. These can be populated from `AFRAME.components[<componentName>].Component.schema[<propertyName>].type`. See the list of property types https://aframe.io/docs/0.4.0/core/component.html#property-types . For example, we can display sliders for numbers and vectors, color widgets for color, texture modal for textures.
6. Highlighting of primitive tag names and their properties. These can be populated from `AFRAME.primitives` and `AFRAME.primitives[<primitiveName>].mappings`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment