Commit 36bd3751 authored by liujiangnan's avatar liujiangnan

feat: 照相

parent 5e595241
This diff is collapsed.
{
"ver": "1.0.1",
"uuid": "629483b1-3ced-4ec3-a5f2-92bba0c24437",
"subMetas": {}
}
\ No newline at end of file
{"name":"川阅阅","height":1024,"SubTexture":[{"name":"斗篷","x":391,"height":193,"y":781,"width":322},{"name":"手臂2","x":782,"height":50,"y":203,"width":116},{"name":"右脚落下","x":316,"height":130,"y":790,"width":73},{"name":"左脚落下","x":950,"height":132,"y":1,"width":71},{"name":"身体","x":715,"height":196,"y":781,"width":233},{"name":"右脚弯曲","x":861,"height":102,"y":1,"width":77},{"name":"右脚抬起","x":782,"height":96,"y":105,"width":80},{"name":"左脚弯曲","x":782,"height":102,"y":1,"width":77},{"name":"左脚抬起","x":287,"height":96,"y":922,"width":80},{"name":"头","x":1,"height":508,"y":1,"width":460},{"name":"眼睛闭","x":1,"height":19,"y":1004,"width":182},{"name":"眼睁","x":143,"height":61,"y":790,"width":171},{"name":"扇子收","x":864,"height":92,"y":105,"width":32},{"name":"扇子开","x":1,"height":89,"y":913,"width":170},{"name":"扇子合","x":173,"height":89,"y":853,"width":112},{"name":"手臂1","x":173,"height":48,"y":944,"width":105},{"name":"火焰1","x":391,"height":268,"y":511,"width":389},{"name":"火焰2","x":1,"height":277,"y":511,"width":388},{"name":"亮珠光芒","x":1,"height":121,"y":790,"width":140}],"imagePath":"cyy_tex.png","width":1024}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "2e1fc555-f6b2-468c-9ff9-048c3faa73d8",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "e1b4d971-9876-4832-803a-5a321964a78b",
"uuid": "a7483cb1-d314-40e2-a92c-d50a2f3f583d",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1280,
"height": 720,
"width": 1024,
"height": 1024,
"platformSettings": {},
"subMetas": {
"bg": {
"cyy_tex": {
"ver": "1.0.4",
"uuid": "8288e3d4-4c75-4b27-8f01-f7014417f4dd",
"rawTextureUuid": "e1b4d971-9876-4832-803a-5a321964a78b",
"uuid": "0b0dd5cd-3378-47e7-a8cd-1e139a185a90",
"rawTextureUuid": "a7483cb1-d314-40e2-a92c-d50a2f3f583d",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1280,
"height": 720,
"rawWidth": 1280,
"rawHeight": 720,
"offsetX": -1,
"offsetY": 0.5,
"trimX": 1,
"trimY": 1,
"width": 1020,
"height": 1021,
"rawWidth": 1024,
"rawHeight": 1024,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
......
This diff is collapsed.
......@@ -19,6 +19,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
showLoading() {
cc.find(`Canvas/loading`).active = true;
}
hideLoading() {
cc.find(`Canvas/loading`).active = false;
}
onLoadEnd() {
// TODO 加载完成后的逻辑写在这里, 下面的代码仅供参考
this.initData();
......@@ -38,12 +45,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
window["cameraHandler"].takePictureCallback = (err, url) => {
if (err) {
console.log(err);
this.hideLoading();
return;
}
const pic = cc.find(`Canvas/border/pic_bg/picture`);
getSpriteFrimeByUrl(url, (frame) => {
pic.getComponent(cc.Sprite).spriteFrame = frame;
pic.active = true;
this.hideLoading();
});
}
}
......@@ -56,6 +65,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
initListener() {
const btn = cc.find(`Canvas/border/upload`);
buttonOnClick(btn, () => {
this.showLoading();
window["cameraHandler"].openCamera();
});
}
......
......@@ -31,11 +31,6 @@
</div>
<!-- </div> -->
<!-- camera -->
<div id="VideoContainer" style="position: absolute; top: 0px; left: 0px; bottom: 0px; right: 0px; display: none;">
<video id="video" autoplay style="width: 100%;height: 100%;"></video>
</div>
<!-- <p class="footer">Made with <a href="https://www.cocos.com/products#CocosCreator" title="cocos creator">Cocos Creator</a></p> -->
<script src="src/settings.js" charset="utf-8"></script>
......
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