【问题标题】:how to parse a value to a 2Dtext in spark ar如何在火花 ar 中将值解析为 2Dtext
【发布时间】:2020-02-11 15:43:18
【问题描述】:

我有一个 X 值,表示我在 spark AR 中张嘴的程度。如何将 X 值显示为 2d 文本?

我希望文本在运行效果时显示数字值。

【问题讨论】:

    标签: instagram augmented-reality spark-ar-studio


    【解决方案1】:

    你应该使用这个脚本:

    const Scene = require('Scene');
    
    // Use export keyword to make a symbol available in scripting debug console
    export const Diagnostics = require('Diagnostics');
    
    // To use variables and functions across files, use export/import keyword
    // export const animationDuration = 10;
    
    // Use import keyword to import a symbol from another file
    // import { animationDuration } from './script.js'
    
    // To access scene objects
    // const directionalLight = Scene.root.find('directionalLight0');
    
    // To access class properties
    // const directionalLightIntensity = directionalLight.intensity;
    
    // To log messages to the console
    Diagnostics.log('Console message logged from the script.');
    
    const Patches = require('Patches');
    
    const numberFormat = '{0}';
    const number = Patches.getScalarValue('number');
    
    Patches.setStringValue('value', number.format(numberFormat));

    enter image description here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-05-18
      • 2014-10-27
      • 2015-01-08
      • 2016-08-13
      • 2020-05-23
      • 2019-04-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多