Commit 03f5c02a authored by wildfirecode's avatar wildfirecode

1

parent cd7551c9
......@@ -358,7 +358,41 @@
],
"uuid": "766058d7-563e-4c57-8e67-cb1273012272"
}
]
],
"disabled": true
},
{
"name": "ScenePlay",
"components": [
{
"script": "components/base/Transform",
"properties": {}
},
{
"script": "./scripts/scenes/ScenePlay",
"properties": {}
}
],
"uuid": "5bc2f6aa-a570-46cf-bf4e-b2fb1b749bee",
"children": [
{
"name": "Label",
"components": [
{
"script": "components/base/Transform",
"properties": {}
},
{
"script": "components/renderer/TextRenderer",
"properties": {
"text": "scene play"
}
}
],
"uuid": "708978c5-59b8-4daf-b8b6-4bec1da1f254"
}
],
"disabled": true
}
]
},
......@@ -391,6 +425,88 @@
],
"uuid": "3f66eb80-5d67-4b76-a0c1-f385e0a6e947",
"children": [
{
"name": "Rule",
"components": [
{
"script": "components/base/Transform",
"properties": {}
},
{
"script": "components/renderer/TextureRenderer",
"properties": {
"texture": "res|3a144581-2403-4ce9-845b-7470fc1d5bef"
}
},
{
"script": "./scripts/dialogs/RuleDialogContent",
"properties": {
"effect": "zoom",
"ruleContent": "dynamic|API|ajaxElement",
"Content": "entity|c3e928d6-785a-4a2a-be16-5341e341b6ec",
"ajaxElement": "dynamic|API|ajaxElement"
}
}
],
"uuid": "aae552b6-377b-4168-a67b-4adb75b4cb5e",
"children": [
{
"name": "CloseButton",
"components": [
{
"script": "components/base/Transform",
"properties": {
"position": {
"x": 0.9999999999999716,
"y": 346.6666666666667,
"_type_": "scilla/support/Vector2D"
}
}
},
{
"script": "components/renderer/TextureRenderer",
"properties": {
"texture": "res|fbb05192-e4f2-4706-a177-91b2c71f24f9"
}
},
{
"script": "components/animation/TouchZoom",
"properties": {
"easeName": "backOut"
}
},
{
"script": "components/ui/Button",
"properties": {
"disabledRes": "res|fbb05192-e4f2-4706-a177-91b2c71f24f9",
"downRes": "res|fbb05192-e4f2-4706-a177-91b2c71f24f9",
"upRes": "res|fbb05192-e4f2-4706-a177-91b2c71f24f9"
}
}
],
"children": [],
"uuid": "0ff6a935-78d7-4d96-9205-a5f4f2dd9a7d"
},
{
"name": "Content",
"components": [
{
"script": "components/base/Transform",
"properties": {}
},
{
"script": "components/renderer/HtmlRenderer",
"properties": {
"htmlText": "xxxxxx"
}
}
],
"uuid": "c3e928d6-785a-4a2a-be16-5341e341b6ec",
"disabled": false
}
],
"disabled": true
},
{
"name": "Alert",
"components": [
......@@ -400,7 +516,9 @@
},
{
"script": "./scripts/dialogs/AlertDialogContent",
"properties": {}
"properties": {
"effect": "zoom"
}
}
],
"uuid": "53bcf905-9be0-42c8-bfbd-e820076afbd2",
......@@ -423,7 +541,7 @@
"uuid": "8d0919e9-1681-46f8-ae76-bbc9ac7c2515"
},
{
"name": "CloseBtn",
"name": "CloseButton",
"components": [
{
"script": "components/base/Transform",
......@@ -459,7 +577,7 @@
"uuid": "a0fc547e-5d66-4d45-b2b1-1d0c1eee8424"
},
{
"name": "CloseButton2",
"name": "CloseButton",
"components": [
{
"script": "components/base/Transform",
......@@ -482,14 +600,7 @@
"properties": {
"disabledRes": "res|c4d9cb82-8eed-4444-9638-bec8180db868",
"downRes": "res|c4d9cb82-8eed-4444-9638-bec8180db868",
"upRes": "res|c4d9cb82-8eed-4444-9638-bec8180db868",
"onClick": [
{
"entity": "entity|53bcf905-9be0-42c8-bfbd-e820076afbd2",
"component": 1,
"method": "onClickConfirmButton"
}
]
"upRes": "res|c4d9cb82-8eed-4444-9638-bec8180db868"
}
}
],
......@@ -498,12 +609,13 @@
"name": "label",
"components": [
{
"script": "components/base/Transform"
"script": "components/base/Transform",
"properties": {}
},
{
"script": "components/renderer/TextRenderer",
"properties": {
"text": "button",
"text": "关闭",
"fillColor": "rgba(255, 255, 255, 1)"
}
}
......@@ -571,6 +683,22 @@
},
"resource-groups": {
"preload": [
{
"uuid": "5a26b406-3b16-4d29-a47a-e968294aa431",
"url": "sheets/rule.sht-disperse",
"config": {
"textures": [
{
"name": "closeBtn-1.png",
"uuid": "f6580694-d87b-487c-840e-8f4c990a43a7"
},
{
"name": "游戏说明-1.png",
"uuid": "3a144581-2403-4ce9-845b-7470fc1d5bef"
}
]
}
},
{
"uuid": "9158c461-d76d-42b6-8a4f-4151d551fbf2",
"url": "sheets/start.sht-disperse",
......
/**
* Created by rockyl on 2019-04-10.
*
* 规则对话框内容
*/
import HtmlRenderer from "components/renderer/HtmlRenderer";
import { dynamic, Entity } from "scilla";
import DialogContent from "../popup/DialogContent";
export default class RuleDialogContent extends DialogContent {
Content: Entity;
ajaxElement: dynamic;//ajax Element
private _contentRenderer: HtmlRenderer;
onAwake() {
super.onAwake();
this._contentRenderer = this.Content.getComponent(HtmlRenderer);
this._contentRenderer.color = '#ff0000';
}
setup(data) {
console.log(this._contentRenderer.htmlText, this.ajaxElement.rule)
this._contentRenderer.htmlText = this.ajaxElement.rule;
}
}
{"ver":"1.0.1","uuid":"f4ad775b-3c0d-4d15-8f28-4fc7ed078dea","subMetas":{},"type":"script"}
......@@ -7,14 +7,4 @@
import TextRenderer from "components/renderer/TextRenderer";
export default class CustomTextRenderer extends TextRenderer {
fillColorKey: string;
onAwake() {
super.onAwake();
const config = window['configJson'];
if(this.fillColorKey){
this.fillColor = config[this.fillColorKey];
}
}
}
......@@ -5,20 +5,20 @@
*/
import ScillaComponent from "components/base/ScillaComponent";
import {fade, flew, none, zoom} from "./PopupEffect";
import {raw} from "scilla";
import {decorators} from "scilla";
import { fade, flew, none, zoom } from "./PopupEffect";
import { raw } from "scilla";
import { decorators } from "scilla";
import { Button } from "scilla-components/src";
const {dirtyFieldTrigger} = decorators;
const { dirtyFieldTrigger } = decorators;
export default class DialogContent extends ScillaComponent {
@dirtyFieldTrigger
effect: PopupEffect = PopupEffect.none;
effect: PopupEffect = PopupEffect.zoom;
showEffectOptions: raw;
hideEffectOptions: raw;
protected _closeButton: Button;
protected _closeButtons: Button[];
effectImpl = none;
......@@ -33,11 +33,14 @@ export default class DialogContent extends ScillaComponent {
onAwake() {
super.onAwake();
if (!this._closeButton) {
if (!this._closeButtons) {
this._closeButtons = [];
const buttons = this.entity.getChildrenByName('CloseButton');
if (buttons.length > 0) {
this._closeButton = buttons[0].getComponent(Button);
this._closeButton.onClick.addListener(this.onTapCloseButton, this);
if (buttons) {
buttons.forEach(button => {
const closeBtn = button.getComponent(Button);
closeBtn.onClick.addListener(this.onTapCloseButton, this);
})
}
}
}
......
......@@ -60,7 +60,7 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
}
onGotDojoinError() {
console.log('onGotDojoinError');
console.log('onGotDojoinError')
}
onGot_getNgameStartStatus() {
......@@ -73,13 +73,9 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
console.log('onGotError_getNgameStartStatus');
}
// onAlertClose() {
// console.log('onAlertClose');
// };
onClick_rulebtn() {
console.log('onClick_rulebtn')
this.bubbling('showDialog', 'Alert')
console.log('onClick_rulebtn');
this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn() {
......
{"ver":"1.0.1","uuid":"5a26b406-3b16-4d29-a47a-e968294aa431","subMetas":{},"type":"sheet"}
{"ver":"1.0.1","uuid":"5a26b406-3b16-4d29-a47a-e968294aa431","subMetas":{"closeBtn-1.png":{"ver":"1.0.1","uuid":"f6580694-d87b-487c-840e-8f4c990a43a7","rawTextureUuid":"5a26b406-3b16-4d29-a47a-e968294aa431","type":"texture"},"游戏说明-1.png":{"ver":"1.0.1","uuid":"3a144581-2403-4ce9-845b-7470fc1d5bef","rawTextureUuid":"5a26b406-3b16-4d29-a47a-e968294aa431","type":"texture"}},"type":"sheet"}
......@@ -4,7 +4,8 @@
"main": "index.js",
"license": "MIT",
"scripts": {
"mock": "game-cli m -p 4001 -f './mock' "
"mock": "game-cli m -p 4001 -f './mock'",
"livereload": "livereload . -ee scene,jpg,png,html"
},
"build": {
"build-process": "scilla",
......@@ -18,4 +19,4 @@
"scilla-launcher": "git+http://gitlab2.dui88.com/laoqifeng/scilla-launcher#dev"
},
"devDependencies": {}
}
}
\ No newline at end of file
......@@ -31,9 +31,13 @@
# 日报
- 5.28 跑新的demo,运行成功
-
- 5.28
# 换皮
- 换皮可能会超级麻烦
# 可以优化的点
- 分离单个UI配置文件,方便复制
- editor内即时刷新组件属性
- http://localhost:52751/ port能固定不
- 改了图要退出editor才会刷新
......@@ -5,59 +5,68 @@
import {registerDef} from 'scilla'
import component0 from 'components/renderer/TextRenderer';
registerDef('components/renderer/TextRenderer', component0);
import component0 from 'components/ui/Button';
registerDef('components/ui/Button', component0);
import component1 from 'components/base/Transform';
registerDef('components/base/Transform', component1);
import component2 from 'components/base/TouchInterrupt';
registerDef('components/base/TouchInterrupt', component2);
import component2 from 'components/renderer/HtmlRenderer';
registerDef('components/renderer/HtmlRenderer', component2);
import component3 from 'components/renderer/RectRenderer';
registerDef('components/renderer/RectRenderer', component3);
import component3 from 'components/base/TouchInterrupt';
registerDef('components/base/TouchInterrupt', component3);
import component4 from 'components/other/FullStageSize';
registerDef('components/other/FullStageSize', component4);
import component5 from 'components/ui/Button';
registerDef('components/ui/Button', component5);
import component5 from 'components/renderer/RectRenderer';
registerDef('components/renderer/RectRenderer', component5);
import component6 from 'components/animation/TouchZoom';
registerDef('components/animation/TouchZoom', component6);
import component6 from 'components/other/CameraController';
registerDef('components/other/CameraController', component6);
import component7 from 'components/other/CameraController';
registerDef('components/other/CameraController', component7);
import component7 from 'components/animation/TouchZoom';
registerDef('components/animation/TouchZoom', component7);
import component8 from 'components/renderer/TextureRenderer';
registerDef('components/renderer/TextureRenderer', component8);
import component9 from '../../assets/scripts/scenes/SceneStart';
registerDef('./scripts/scenes/SceneStart', component9);
import component9 from 'components/renderer/TextRenderer';
registerDef('components/renderer/TextRenderer', component9);
import component10 from '../../assets/scripts/scenes/SceneController';
registerDef('./scripts/scenes/SceneController', component10);
import component10 from '../../assets/scripts/api/SampleApi';
registerDef('./scripts/api/SampleApi', component10);
import component11 from '../../assets/scripts/navigator/SingleSceneNavigator';
registerDef('./scripts/navigator/SingleSceneNavigator', component11);
import component11 from '../../assets/scripts/scenes/SceneStart';
registerDef('./scripts/scenes/SceneStart', component11);
import component12 from '../../assets/scripts/api/SamplePollingApi';
registerDef('./scripts/api/SamplePollingApi', component12);
import component13 from '../../assets/scripts/api/SampleApi';
registerDef('./scripts/api/SampleApi', component13);
import component13 from '../../assets/scripts/scenes/ScenePlay';
registerDef('./scripts/scenes/ScenePlay', component13);
import component14 from '../../assets/scripts/popup/Popup';
registerDef('./scripts/popup/Popup', component14);
import component14 from '../../assets/scripts/navigator/SingleSceneNavigator';
registerDef('./scripts/navigator/SingleSceneNavigator', component14);
import component15 from '../../assets/scripts/MainController';
registerDef('./scripts/MainController', component15);
import component15 from '../../assets/scripts/popup/Popup';
registerDef('./scripts/popup/Popup', component15);
import component16 from '../../assets/scripts/dialogs/AlertDialogContent';
registerDef('./scripts/dialogs/AlertDialogContent', component16);
import component16 from '../../assets/scripts/scenes/SceneController';
registerDef('./scripts/scenes/SceneController', component16);
import component17 from '../../assets/scripts/common/Toast';
registerDef('./scripts/common/Toast', component17);
import component17 from '../../assets/scripts/dialogs/RuleDialogContent';
registerDef('./scripts/dialogs/RuleDialogContent', component17);
import component18 from '../../assets/scripts/game/CustomTextRenderer';
registerDef('./scripts/game/CustomTextRenderer', component18);
import component18 from '../../assets/scripts/MainController';
registerDef('./scripts/MainController', component18);
import component19 from '../../assets/scripts/dialogs/AlertDialogContent';
registerDef('./scripts/dialogs/AlertDialogContent', component19);
import component20 from '../../assets/scripts/common/Toast';
registerDef('./scripts/common/Toast', component20);
import component21 from '../../assets/scripts/game/CustomTextRenderer';
registerDef('./scripts/game/CustomTextRenderer', component21);
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