Skip to content

Instantly share code, notes, and snippets.

@gHashTag
Created September 22, 2019 13:30
Show Gist options
  • Select an option

  • Save gHashTag/ee9c4fde0b2af743c120459e7c928f2e to your computer and use it in GitHub Desktop.

Select an option

Save gHashTag/ee9c4fde0b2af743c120459e7c928f2e to your computer and use it in GitHub Desktop.
const NativeUI = require('NativeUI')
const Scene = require('Scene')
const Textures = require('Textures')
const plane = Scene.root.find('faceMesh0')
const texture0 = Textures.get('texture0')
const texture1 = Textures.get('texture1')
const texture2 = Textures.get('texture2')
const picker = NativeUI.picker
const index = 0
const configuration = {
selectedIndex: index,
items: [
{image_texture: texture0},
{image_texture: texture1},
{image_texture: texture2}
]
}
picker.configure(configuration)
picker.visible = true
picker.selectedIndex.monitor().subscribe(function(index) {
plane.material.diffuse = configuration.items[index.newValue].image_texture;
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment