【问题标题】:Toggle image on click lua点击lua切换图片
【发布时间】:2014-11-18 10:48:30
【问题描述】:

我正在尝试在用户单击图像时切换图像。它旨在更改图像并使在后台播放的音频静音,反之亦然。我在一个名为 Indigo Autoplay media studio 8 的程序中使用 lua。

代码如下:

if (Audio.Play(CHANNEL_BACKGROUND) == true) then
    Audio.Pause(CHANNEL_BACKGROUND);
    Image.Load("playpause", "AutoPlay\\Images\\gg57570759.png");
else
    Image.Load("playpause", "AutoPlay\\Images\\gg57570759 on.png");
    Audio.Play(CHANNEL_BACKGROUND);
end

【问题讨论】:

    标签: image lua toggle autoplay-media-studio


    【解决方案1】:

    首先需要在图片的On Click事件中添加如下脚本:

    Audio.TogglePlay(CHANNEL_BACKGROUND);
    

    然后打开页面属性,在页面的On Audio事件中添加如下脚本:

    if (e_State == "Pause") then
        Image.Load("playpause", "AutoPlay\\Images\\gg57570759.png");
    else
        Image.Load("playpause", "AutoPlay\\Images\\gg57570759 on.png");
    end
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-11-22
      • 1970-01-01
      • 1970-01-01
      • 2011-09-18
      • 2017-04-16
      • 2022-07-25
      • 2022-01-26
      相关资源
      最近更新 更多