Commit ee3a7c81 authored by wildfirecode's avatar wildfirecode

1

parent adbb899c
...@@ -1168,6 +1168,12 @@ ...@@ -1168,6 +1168,12 @@
"y": -310 "y": -310
} }
} }
},
{
"script": "./scripts/dialogs/PrizeDialogContent",
"properties": {
"pic": "entity|5e468650-9e44-4f2d-8dba-be066cd89c37"
}
} }
], ],
"uuid": "48d00d27-5587-4a24-b5ba-f8a11a714e39", "uuid": "48d00d27-5587-4a24-b5ba-f8a11a714e39",
...@@ -1261,6 +1267,25 @@ ...@@ -1261,6 +1267,25 @@
], ],
"children": [], "children": [],
"uuid": "4a171b87-ea4d-41c2-9009-31eb1bf19383" "uuid": "4a171b87-ea4d-41c2-9009-31eb1bf19383"
},
{
"name": "pic",
"components": [
{
"script": "components/base/Transform",
"properties": {
"position": {
"x": 0,
"y": 30
}
}
},
{
"script": "components/renderer/TextureRenderer",
"properties": {}
}
],
"uuid": "5e468650-9e44-4f2d-8dba-be066cd89c37"
} }
], ],
"disabled": false "disabled": false
......
/**
* Created by rockyl on 2019-04-10.
*
* 警告对话框内容
*/
import { TextureRenderer } from "scilla-components/src";
import { EngineConfig, Entity, AssetsManager, Texture, createTexture } from "scilla/src";
import DialogContent from "../popup/DialogContent";
export default class PrizeDialogContent extends DialogContent {
private loadImage = (url: string): Promise<HTMLImageElement> => {
return new Promise<HTMLImageElement>((resolve, reject) => {
let img = new Image();
if (EngineConfig.imgCrossOrigin) {
img.setAttribute('crossOrigin', 'anonymous');
}
img.onload = function (e) {
resolve(img);
};
img.onerror = function (e) {
reject(e);
};
img.src = url;
});
}
private loadTexture = async (url: string): Promise<Texture> => {
const img = await this.loadImage(url);
const texture = createTexture(img);
return texture;
}
pic: Entity;
onAwake() {
super.onAwake();
AssetsManager
}
async setup(data: any = {}) {
const texRender = this.pic.getComponent(TextureRenderer);
const texture = await this.loadTexture('//yun1.duiba.com.cn/upload/uP99F1462438316972.png');
texRender.texture=texture;
}
}
{"ver":"1.0.1","uuid":"3321fa44-dadf-4d67-8e26-04ba5fb8bac7","subMetas":{},"type":"script"}
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
*/ */
import ScillaComponent from "scilla-components/src/base/ScillaComponent"; import ScillaComponent from "scilla-components/src/base/ScillaComponent";
import { dynamic, Entity } from "scilla/src"; import { dynamic, Entity, AssetsManager } from "scilla/src";
import { setText } from "../entityUtils"; import { setText } from "../entityUtils";
import { alien } from "../navigator/StackNavigator"; import { alien } from "../navigator/StackNavigator";
import { INavigatorViewBase } from "../navigator/VirtualNavigator"; import { INavigatorViewBase } from "../navigator/VirtualNavigator";
...@@ -29,9 +29,9 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie ...@@ -29,9 +29,9 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
console.log('fuck start scene') console.log('fuck start scene')
this._gifts = this.treeWrapper.getChildrenByName('gift'); this._gifts = this.treeWrapper.getChildrenByName('gift');
// setTimeout(() => { setTimeout(() => {
// this.bubbling('showDialog', 'Alert','fuck'); this.bubbling('showDialog', 'Prize','fuck');
// }, 1000); }, 1000);
} }
private setCountText(text: string) { private setCountText(text: string) {
...@@ -90,7 +90,7 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie ...@@ -90,7 +90,7 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
} }
} }
onGotDojoin() { onGotDojoin(error) {
console.log('onGotDojoin', this.doJoin); console.log('onGotDojoin', this.doJoin);
// this.startbtn.getComponent(Button).enabled = true; // this.startbtn.getComponent(Button).enabled = true;
this.broadcast('callApi', 1, 'getNgameStartStatus', { this.broadcast('callApi', 1, 'getNgameStartStatus', {
...@@ -100,17 +100,19 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie ...@@ -100,17 +100,19 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
onGotDojoinError(...argument) { onGotDojoinError(...argument) {
this.startbtn.getComponent(Button).enabled = true; this.startbtn.getComponent(Button).enabled = true;
console.log('onGotDojoinError',argument); console.log('onGotDojoinError', argument);
} }
onGot_getNgameStartStatus() { onGot_getNgameStartStatus() {
this.startbtn.getComponent(Button).enabled = true;
console.log('onGot_getNgameStartStatus', this.getNgameStartStatus); console.log('onGot_getNgameStartStatus', this.getNgameStartStatus);
//fuck 不可以循环引用 //fuck 不可以循环引用
// this.bubbling('fuck', 'play'); // this.bubbling('fuck', 'play');
} }
onGotError_getNgameStartStatus() { onGotError_getNgameStartStatus(...argument) {
console.log('onGotError_getNgameStartStatus'); this.startbtn.getComponent(Button).enabled = true;
console.log('onGotError_getNgameStartStatus', argument);
} }
onClick_rulebtn() { onClick_rulebtn() {
......
{"ver":"1.0.1","uuid":"f851b613-f1a9-48b0-83f1-be7fdc46a671","subMetas":{"test":{"ver":"1.0.1","uuid":"6eb9850d-5a36-4792-b544-a40cf2ed00d2","rawTextureUuid":"f851b613-f1a9-48b0-83f1-be7fdc46a671","type":"texture"}},"type":"texture","imagePath":"/Users/wanghongyuan/shuijf/assets/singles/test.png"}
{"success":true,"code":"0000000000","desc":"OK","timestamp":1548923950498,"data":{"element":{"success":false,"isCreditsTypeOpen":false,"needCredits":"100","myCredits":"999999630434","myCreditsLong":999999630434,"needCreditsLong":100,"freeLimit":-1,"status":1,"freeEmpty":true},"lottery":{"id":null,"type":"thanks","imgUrl":null,"link":null,"title":null,"itemId":null,"appItemId":null,"bonus":null,"bonusMin":null,"bonusMax":null,"needAccount":null,"appLucky":null,"tip":null,"useBtnText":null,"validate":null,"couponCode":null,"couponKey":null,"stInfoDpmImg":null,"stInfoDpmClose":null,"stInfoDpmGoUse":null,"showUse":null,"openUrl":null,"iosDownloadUrl":null,"androidDownloadUrl":null,"isDownloadUrl":null,"confirm":null,"phaseNumber":null,"happyCode":null,"appHidden":true,"zybangJson":null},"exposure":null,"creditsInfo":{"activityId":82567,"prizeId":4,"orderNum":null,"developerBizId":"3029576","score":null,"recordStatus":1,"errorMsg":null},"againTag":null}} {
"success": true,
"code": "0000000000",
"desc": "OK",
"timestamp": 1548923950498,
"data": {
"element": {
"success": false,
"isCreditsTypeOpen": false,
"needCredits": "100",
"myCredits": "999999630434",
"myCreditsLong": 999999630434,
"needCreditsLong": 100,
"freeLimit": -1,
"status": 1,
"freeEmpty": true
},
"lottery": {
"id": null,
"type": "thanks",
"imgUrl": null,
"link": null,
"title": null,
"itemId": null,
"appItemId": null,
"bonus": null,
"bonusMin": null,
"bonusMax": null,
"needAccount": null,
"appLucky": null,
"tip": null,
"useBtnText": null,
"validate": null,
"couponCode": null,
"couponKey": null,
"stInfoDpmImg": null,
"stInfoDpmClose": null,
"stInfoDpmGoUse": null,
"showUse": null,
"openUrl": null,
"iosDownloadUrl": null,
"androidDownloadUrl": null,
"isDownloadUrl": null,
"confirm": null,
"phaseNumber": null,
"happyCode": null,
"appHidden": true,
"zybangJson": null
},
"exposure": null,
"creditsInfo": {
"activityId": 82567,
"prizeId": 4,
"orderNum": null,
"developerBizId": "3029576",
"score": null,
"recordStatus": 1,
"errorMsg": null
},
"againTag": null
}
}
\ No newline at end of file
{ {
"success": true, "success": false,
"code": "0000000000", "code": "C000000001",
"desc": "OK", "desc": "OK",
"timestamp": 1550570639368, "timestamp": 1550570639368,
"data": { "data": {
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
import {registerDef} from 'scilla' import {registerDef} from 'scilla'
import component0 from 'components/ui/ScrollView'; import component0 from 'components/other/RelativeLayout';
registerDef('components/ui/ScrollView', component0); registerDef('components/other/RelativeLayout', component0);
import component1 from 'components/base/Transform'; import component1 from 'components/base/Transform';
registerDef('components/base/Transform', component1); registerDef('components/base/Transform', component1);
...@@ -29,8 +29,8 @@ registerDef('components/other/FullStageSize', component6); ...@@ -29,8 +29,8 @@ registerDef('components/other/FullStageSize', component6);
import component7 from 'components/renderer/TextRenderer'; import component7 from 'components/renderer/TextRenderer';
registerDef('components/renderer/TextRenderer', component7); registerDef('components/renderer/TextRenderer', component7);
import component8 from 'components/other/RelativeLayout'; import component8 from 'components/other/CameraController';
registerDef('components/other/RelativeLayout', component8); registerDef('components/other/CameraController', component8);
import component9 from 'components/renderer/TextureRenderer'; import component9 from 'components/renderer/TextureRenderer';
registerDef('components/renderer/TextureRenderer', component9); registerDef('components/renderer/TextureRenderer', component9);
...@@ -38,11 +38,11 @@ registerDef('components/renderer/TextureRenderer', component9); ...@@ -38,11 +38,11 @@ registerDef('components/renderer/TextureRenderer', component9);
import component10 from 'components/renderer/RectRenderer'; import component10 from 'components/renderer/RectRenderer';
registerDef('components/renderer/RectRenderer', component10); registerDef('components/renderer/RectRenderer', component10);
import component11 from 'components/other/CameraController'; import component11 from 'components/ui/ScrollView';
registerDef('components/other/CameraController', component11); registerDef('components/ui/ScrollView', component11);
import component12 from '../../assets/scripts/api/SampleApi'; import component12 from '../../assets/scripts/dialogs/RuleDialogContent';
registerDef('./scripts/api/SampleApi', component12); registerDef('./scripts/dialogs/RuleDialogContent', component12);
import component13 from '../../assets/scripts/api/SamplePollingApi'; import component13 from '../../assets/scripts/api/SamplePollingApi';
registerDef('./scripts/api/SamplePollingApi', component13); registerDef('./scripts/api/SamplePollingApi', component13);
...@@ -56,11 +56,11 @@ registerDef('./scripts/scenes/SceneController', component15); ...@@ -56,11 +56,11 @@ registerDef('./scripts/scenes/SceneController', component15);
import component16 from '../../assets/scripts/popup/Popup'; import component16 from '../../assets/scripts/popup/Popup';
registerDef('./scripts/popup/Popup', component16); registerDef('./scripts/popup/Popup', component16);
import component17 from '../../assets/scripts/scenes/SceneStart'; import component17 from '../../assets/scripts/api/SampleApi';
registerDef('./scripts/scenes/SceneStart', component17); registerDef('./scripts/api/SampleApi', component17);
import component18 from '../../assets/scripts/dialogs/RuleDialogContent'; import component18 from '../../assets/scripts/scenes/SceneStart';
registerDef('./scripts/dialogs/RuleDialogContent', component18); registerDef('./scripts/scenes/SceneStart', component18);
import component19 from '../../assets/scripts/game/CustomTextRenderer'; import component19 from '../../assets/scripts/game/CustomTextRenderer';
registerDef('./scripts/game/CustomTextRenderer', component19); registerDef('./scripts/game/CustomTextRenderer', component19);
...@@ -71,5 +71,8 @@ registerDef('./scripts/MainController', component20); ...@@ -71,5 +71,8 @@ registerDef('./scripts/MainController', component20);
import component21 from '../../assets/scripts/dialogs/AlertDialogContent'; import component21 from '../../assets/scripts/dialogs/AlertDialogContent';
registerDef('./scripts/dialogs/AlertDialogContent', component21); registerDef('./scripts/dialogs/AlertDialogContent', component21);
import component22 from '../../assets/scripts/common/Toast'; import component22 from '../../assets/scripts/dialogs/PrizeDialogContent';
registerDef('./scripts/common/Toast', component22); registerDef('./scripts/dialogs/PrizeDialogContent', component22);
import component23 from '../../assets/scripts/common/Toast';
registerDef('./scripts/common/Toast', component23);
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