UofTMADLab / reach

A VR format for Twine
0 stars 0 forks source link

'hoist' images, links and videos from text panels into the current passage #45

Closed samesimilar closed 4 years ago

samesimilar commented 4 years ago

Currently when you make a text panel like this: `[[PanelName]]

reach will render the text in the panel as-is (after running any embedded scripts). So inline twitch codes like links, sounds and other panels are rendered as plain text, and not parsed out.

Instead we could parse these items from the text panel, and insert them into the current passage.

For example, if the text panel has an image panel code: [img[src]], this image panel would be 'hoisted' into the current passage as if it had been declared there. The position of the image panel would be relative to the current position of the text panel.

Multiple passages could link to the same text panel, thus saving some code.

Any embedded javascript template code would run in the context of the source passage.

(Currently you can dynamically create scene elements in text panels using javascript template code, e.g: <% window.passage.imagePanel(img, link, options) %>

works the same if it's in the source passage or in a text panel passage. )

samesimilar commented 4 years ago
samesimilar commented 4 years ago

In the latest commit I have added an experimental feature: "Mix Passages". You can create a 'mix passage' with the following syntax:

&[[MixPassageName]]

Since this uses the double-square-bracket syntax, the twine editor will create a link to a new passage with the name MixPassageName. Any content (like backgrounds, links, text panels, image panels, sounds) will be mixed into the scene generated by the current parent passage. Any template code in the mix passage will be run in the context of the parent passage.

Mix passages are re-usable: several different parent passages can refer to them and re-use their content.