Star class - sonataFarm/lost_in_wiki GitHub Wiki
Star handles the display logic for each individual star in StarField. Stylistic properties are defined by the util files get-material.js and star-style.js.
Instance Methods
-
constructor: Takes an options hash representing the initial state of the star being generated. E.gnew Star(isLink: true, isFocus: false). Then assigns a material based on the state, then renders the star. -
focus,unfocus,makeLink,unmakeLink: Assigns/unassigns theisFocusandisLinkproperties on the state and refreshes the material to reflect the new state.
Utility methods
getMaterial: Takes a star's state, returns a three.jsmaterialobject for rendering. Theradiusandcolorproperties of the material are defined instar-style.js.