Commit 7dce9413 authored by wildfirecode's avatar wildfirecode

1

parent 0e180872
......@@ -2,7 +2,7 @@
<e:Skin class="NoPrizeSkin" width="750" height="1000" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image id="light" source="common_prizelight_png" x="374.19" y="329.51" anchorOffsetX="375.76" anchorOffsetY="327.27"/>
<e:Image y="109.55" source="擦肩而过弹窗 _png" horizontalCenter="0.5"/>
<e:Button id="closeBtn" label="" x="617" y="323">
<e:Button id="closeBtn" label="" x="617" y="279">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="closeCommonBtn_png" source.down="closeCommonBtn_png" source.disabled="closeCommonBtn_png"/>
......
......@@ -2,8 +2,8 @@
<e:Skin class="Prize2Skin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<w:Config id="169005181d0"/>
<e:Image id="light" source="common_prizelight_png" x="374.19" y="329.51" anchorOffsetX="375.76" anchorOffsetY="327.27"/>
<e:Image source="prizePanelbg_png" y="142.96" horizontalCenter="0"/>
<e:Button id="closeBtn" label="" x="608" y="333">
<e:Image source="prizePanelbg_png" y="134.96" horizontalCenter="0.5"/>
<e:Button id="closeBtn" label="" x="616" y="307">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="closeCommonBtn_png" source.down="closeCommonBtn_png" source.disabled="closeCommonBtn_png"/>
......
......@@ -3,7 +3,7 @@
<w:Config id="169005181d0"/>
<e:Image id="light" source="common_prizelight_png" x="374.19" y="329.51" anchorOffsetX="375.76" anchorOffsetY="327.27"/>
<e:Image source="prizePanelbg_png" y="136.9" horizontalCenter="0.5"/>
<e:Button id="closeBtn" label="" x="608" y="333">
<e:Button id="closeBtn" label="" x="618" y="311">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="closeCommonBtn_png" source.down="closeCommonBtn_png" source.disabled="closeCommonBtn_png"/>
......
let bgOn = true;
let bgChannel: egret.SoundChannel;
let loading = false;
export const toggleGameBg = () => {
bgOn = !bgOn;
if (bgChannel) {
if (!bgOn) {
bgChannel.stop();
bgChannel = null;
}
} else {
if (bgOn) {
playGameBg();
}
}
}
export const playGameBg = async () => {
if (bgChannel) return;
if (loading) return;
loading = true;
const bg = await RES.getResAsync('playBg_mp3');
bgChannel = bg.play();
loading = false;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment