添加灯光模式

This commit is contained in:
zhw2590582 committed 2020-02-29 09:37:06 +08:00
1 parent 4867d8e25a
commit 3379e6091c
18 files changed
+170 -54

No files matched your search

+2
View File
@@ -21,6 +21,7 @@ import playingMix from './playingMix';
import autoSizeMix from './autoSizeMix';
import rectMix from './rectMix';
import flipMix from './flipMix';
import lightMix from './lightMix';
import { proxyPropertys } from '../utils';
export default class Player {
@@ -48,6 +49,7 @@ export default class Player {
autoSizeMix(art, this);
rectMix(art, this);
flipMix(art, this);
lightMix(art, this);
proxyPropertys(art, this);
}
}
+15
View File
@@ -0,0 +1,15 @@
import { def, getStyle, setStyle } from '../utils';
export default function lightMix(art, player) {
const { $undercover } = art.template;
def(player, 'light', {
get() {
return getStyle($undercover, 'display', false) !== 'none';
},
set(value) {
setStyle($undercover, 'display', value ? 'block' : 'none');
art.emit('light', value);
},
});
}