Commit 5a078770 authored by wildfirecode's avatar wildfirecode

1

parent 6331f693
{"currentScene":"assets/prefabs/rankItem.pfb"}
\ No newline at end of file
{"currentScene":"assets/scenes/main.scene"}
\ No newline at end of file
......@@ -18,25 +18,181 @@
{
"script": "components/base/Transform",
"properties": {}
},
{
"script": "./scripts/scenes/result/RankItem",
"properties": {
"avatar": "entity|922f8140-959a-4d58-ad74-fbaa0f0ba3e4",
"rank": "entity|ec0185d3-ce9d-4929-b8bd-a44531efe131",
"score": "entity|723b6f9f-ed88-4e03-ae63-9b5efc3990c6",
"name": "entity|6cee4655-01a5-49ea-b21b-bc269f9a7572"
}
}
],
"children": [
{
"name": "rankTxt",
"name": "Image",
"components": [
{
"script": "components/base/Transform",
"properties": {}
},
{
"script": "components/renderer/TextureRenderer",
"properties": {
"texture": "res|71e44311-e161-4503-8f98-61e49083fbc4"
}
}
],
"uuid": "f80351a3-2f07-4797-884a-ffc68372547c",
"disabled": true
},
{
"name": "bg",
"components": [
{
"script": "components/base/Transform",
"properties": {
"position": {
"x": 0,
"y": 24.392156862745097
}
}
},
{
"script": "components/renderer/TextureRenderer",
"properties": {
"texture": "res|1c417086-3713-4fc1-94fa-2f29f3a34f09"
}
}
],
"uuid": "f7797dd2-ce00-4226-9568-22702807f1b8"
},
{
"name": "score",
"components": [
{
"script": "components/base/Transform",
"properties": {
"position": {
"x": 269.4117647058823,
"y": -4.705882352941177
}
}
},
{
"script": "components/renderer/TextRenderer",
"properties": {
"text": "1",
"fillColor": "rgba(255, 247, 224, 1)"
"text": "100颗",
"fillColor": "rgba(255, 247, 224, 1)",
"textStyle": {
"fontSize": 20
}
}
}
],
"uuid": "723b6f9f-ed88-4e03-ae63-9b5efc3990c6"
},
{
"name": "name",
"components": [
{
"script": "components/base/Transform",
"properties": {
"position": {
"x": -125.88235294117649,
"y": -4.705882352941177
}
}
},
{
"script": "components/renderer/TextRenderer",
"properties": {
"text": "隔壁老王",
"fillColor": "rgba(255, 247, 224, 1)",
"textStyle": {
"fontSize": 20
}
}
}
],
"uuid": "6cee4655-01a5-49ea-b21b-bc269f9a7572"
},
{
"name": "rank",
"components": [
{
"script": "components/base/Transform",
"properties": {
"position": {
"x": -283.5294117647059,
"y": -5.882352941176471
}
}
},
{
"script": "components/renderer/TextRenderer",
"properties": {
"text": "44",
"fillColor": "rgba(255, 247, 224, 1)",
"textStyle": {
"fontSize": 20
}
}
}
],
"uuid": "ec0185d3-ce9d-4929-b8bd-a44531efe131"
},
{
"name": "imgWrap",
"components": [
{
"script": "components/base/Transform",
"properties": {
"position": {
"x": -229.41176470588235,
"y": -5.882352941176471,
"_type_": "scilla/support/Vector2D"
}
}
},
{
"script": "components/renderer/RectRenderer",
"properties": {
"width": 40,
"height": 40,
"cornerRadius": 20,
"useCacheMode": false,
"maskVisible": false,
"isMask": true
}
}
],
"uuid": "f2de6959-6413-4218-9694-9f4f0a374f41",
"children": [
{
"name": "avatar",
"components": [
{
"script": "components/base/Transform",
"properties": {
"position": {
"x": 0,
"y": 0,
"_type_": "scilla/support/Vector2D"
}
}
},
{
"script": "components/renderer/TextureRenderer",
"properties": {
"texture": "res|8ad59445-0ff2-4382-bb1c-9f7a07845e48"
}
}
],
"uuid": "922f8140-959a-4d58-ad74-fbaa0f0ba3e4"
}
]
}
]
}
......
......@@ -674,7 +674,20 @@
{
"script": "./scripts/scenes/SceneResult",
"properties": {
"avatar": "entity|61c74585-ab3c-4297-90ba-0dde2ba89b9f"
"avatar": "entity|61c74585-ab3c-4297-90ba-0dde2ba89b9f",
"avatar1": "entity|5e84cf5c-3eb5-487b-a4ac-64ee28afc84a",
"myavatar": "entity|71ec7386-f1d9-4d50-9c47-2b1b3c205b0d",
"avatar2": "entity|b5a4ca1f-578a-4e3c-b7ea-ad7bd502a114",
"avatar3": "entity|4ce9e059-524d-40ac-a437-fed2e15308d7",
"name2": "entity|108b063c-3442-4eec-b211-5e89f7e3d5eb",
"name1": "entity|a75e1f38-8c14-4f51-88e8-aa8cb8cd9f10",
"name3": "entity|73b97462-7a7f-4801-916a-34ec161b6910",
"score1": "entity|b9000662-9059-4983-a2da-517555dfda1f",
"score2": "entity|6a1c76cf-a939-4c38-b14b-897f8f4b4180",
"score3": "entity|1a35431a-c2ab-494e-baa9-8b4e1f1e7c16",
"myname": "entity|61fc871c-9f18-499e-abb5-2dfe8b381223",
"myscore": "entity|d30c7a2a-e95a-42e4-a288-ebe7022e1f3e",
"myrank": "entity|3ed68a8c-bbcc-4a85-a9da-5f44eff0d08e"
}
}
],
......@@ -695,7 +708,8 @@
}
}
],
"uuid": "28f8ab52-4eaa-48c0-a2a6-05d6200f596f"
"uuid": "28f8ab52-4eaa-48c0-a2a6-05d6200f596f",
"disabled": true
},
{
"name": "bg",
......@@ -712,7 +726,7 @@
}
],
"uuid": "e847879d-0105-4293-8475-7bd5f1623f78",
"disabled": true
"disabled": false
},
{
"name": "imgWrapper1",
......@@ -740,7 +754,7 @@
"uuid": "61c74585-ab3c-4297-90ba-0dde2ba89b9f",
"children": [
{
"name": "Image",
"name": "avatar1",
"components": [
{
"script": "components/base/Transform",
......@@ -794,7 +808,7 @@
"uuid": "89f3d124-9551-4fba-a0e9-fda2d333bba3",
"children": [
{
"name": "Image",
"name": "myavatar",
"components": [
{
"script": "components/base/Transform",
......@@ -848,7 +862,7 @@
"uuid": "af30c398-63ea-4d46-b2b8-3581658c4b97",
"children": [
{
"name": "Image",
"name": "avatar2",
"components": [
{
"script": "components/base/Transform",
......@@ -902,7 +916,7 @@
"uuid": "eca1b7fe-52fa-4f86-8148-7fcada11e673",
"children": [
{
"name": "Image",
"name": "avatar3",
"components": [
{
"script": "components/base/Transform",
......@@ -1094,6 +1108,31 @@
],
"uuid": "61fc871c-9f18-499e-abb5-2dfe8b381223"
},
{
"name": "myrank",
"components": [
{
"script": "components/base/Transform",
"properties": {
"position": {
"x": -244.7177658942364,
"y": 247.67676767676767
}
}
},
{
"script": "components/renderer/TextRenderer",
"properties": {
"fillColor": "rgba(255, 255, 255, 1)",
"text": "39",
"textStyle": {
"fontSize": 40
}
}
}
],
"uuid": "3ed68a8c-bbcc-4a85-a9da-5f44eff0d08e"
},
{
"name": "myscore",
"components": [
......@@ -1206,8 +1245,7 @@
"position": {
"x": -1.8181818181819318,
"y": -149.09090909090912
},
"alpha": 0.5
}
}
},
{
......@@ -1216,7 +1254,7 @@
"fillColor": "rgba(255, 255, 255, 0.7)",
"cornerRadius": 20
},
"disabled": false
"disabled": true
},
{
"script": "components/ui/ScrollView",
......@@ -1225,6 +1263,13 @@
"content": "entity|f66d93c5-5fee-4c7b-b29c-8af633cae769",
"lockingType": 1
}
},
{
"script": "./scripts/scenes/result/RankList",
"properties": {
"content": "entity|f66d93c5-5fee-4c7b-b29c-8af633cae769",
"item": "res|681aaec9-4063-4399-b56f-2a88de1a902e"
}
}
],
"uuid": "49c19e54-83a0-463c-a396-0ee66288fa38",
......@@ -1269,8 +1314,9 @@
"script": "components/renderer/RectRenderer",
"properties": {
"fillColor": "rgba(30, 180, 255, 1)",
"height": 511,
"cornerRadius": 20
"height": 100,
"cornerRadius": 20,
"alpha": 0
}
},
{
......@@ -1283,59 +1329,7 @@
}
],
"uuid": "f66d93c5-5fee-4c7b-b29c-8af633cae769",
"children": [
{
"name": "Label",
"components": [
{
"script": "components/base/Transform",
"properties": {
"position": {
"x": -9.090909090909092,
"y": 0,
"_type_": "scilla/support/Vector2D"
}
}
},
{
"script": "components/renderer/TextRenderer",
"properties": {
"text": "ad防守打法",
"fillColor": "rgba(255, 1, 1, 1)"
}
}
],
"uuid": "77bbe175-8fd9-47c2-a4da-511b889cc69c"
},
{
"name": "Label",
"components": [
{
"script": "components/base/Transform",
"properties": {
"position": {
"x": -7.272727272727273,
"y": -412.7272727272727
}
}
},
{
"script": "components/renderer/TextRenderer",
"properties": {
"text": "地方发送到发送到",
"fillColor": "rgba(255, 1, 1, 1)"
}
},
{
"script": "components/other/RelativeLayout",
"properties": {
"bottom": 0
}
}
],
"uuid": "cc6ba73f-062b-45ce-b62d-bc3d70da6358"
}
]
"children": []
}
]
}
......@@ -2137,6 +2131,10 @@
"uuid": "d6c6eb9d-b2bf-4da7-9017-1fdde2766886",
"url": "prefabs/i1.pfb"
},
{
"uuid": "681aaec9-4063-4399-b56f-2a88de1a902e",
"url": "prefabs/rankItem.pfb"
},
{
"uuid": "1f737398-ebbb-4a65-9851-0303fd5def02",
"url": "sheets/play.sht-disperse",
......@@ -2245,6 +2243,10 @@
{
"name": "返回首页.png",
"uuid": "96f7f590-a82a-422f-803d-6e4e454b6dc5"
},
{
"name": "rankbg.png",
"uuid": "1c417086-3713-4fc1-94fa-2f29f3a34f09"
}
]
}
......@@ -2337,6 +2339,10 @@
"uuid": "6c90daea-7dde-4b18-823a-e4f8141b7b41",
"url": "singles/rankbg.jpg"
},
{
"uuid": "71e44311-e161-4503-8f98-61e49083fbc4",
"url": "singles/rankitem_cankao.jpg"
},
{
"uuid": "20070530-0eaf-4e77-af40-bee6392b5e52",
"url": "singles/按钮.png"
......
......@@ -8,7 +8,6 @@ export default class SceneController extends ScillaComponent {
}
fuck(p) {
// console.log('fuck',p)
const nav = this.entity.getComponent(SingleSceneNavigator);
nav.push(p)
}
......
import ScillaComponent from "scilla-components/src/base/ScillaComponent";
import { createTexture, EngineConfig, Entity, Texture } from "scilla/src";
import { alien } from "../navigator/StackNavigator";
import { INavigatorViewBase } from "../navigator/VirtualNavigator";
import { Entity } from "scilla/src";
import { RectRenderer, Transform } from "scilla-components/src";
import { TextureRenderer } from "scilla-components/src";
import { setScale } from "../transformUtils";
export default class SceneResult extends ScillaComponent implements INavigatorViewBase {
avatar: Entity;
onAwake() {
super.onAwake();
// const rectRender = this.avatar.getComponent(RectRenderer);
// rectRender.isMask = true;
// rectRender.maskVisible = true;
this.loadAvatar(this.avatar1, '//yun.duiba.com.cn/db_games/1.jpg', 78);
this.loadAvatar(this.avatar2, '//yun.duiba.com.cn/db_games/1.jpg', 64);
this.loadAvatar(this.avatar3, '//yun.duiba.com.cn/db_games/1.jpg', 64);
this.loadAvatar(this.myavatar, '//yun.duiba.com.cn/db_games/1.jpg', 78);
}
// _timer
onDidEnter(last: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = true;
}
......@@ -37,4 +37,47 @@ export default class SceneResult extends ScillaComponent implements INavigatorVi
return undefined;
}
async loadAvatar(avatar: Entity, url: string, width: number) {
const texRender = avatar.getComponent(TextureRenderer);
const texture = await this.loadTexture('//yun.duiba.com.cn/db_games/1.jpg');
texRender.texture = texture;
setScale(avatar, width / texture.bounds.width);
}
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;
}
avatar1: Entity;
myavatar: Entity;
avatar2: Entity;
avatar3: Entity;
name2: Entity;
name1: Entity;
name3: Entity;
myname: Entity;
myscore: Entity;
score2: Entity;
score1: Entity;
score3: Entity;
myrank: Entity;
}
import ScillaComponent from 'components/base/ScillaComponent';
import { Entity, EngineConfig, Texture, createTexture } from 'scilla/src';
import { setText } from 'assets/scripts/entityUtils';
import { TextureRenderer } from 'scilla-components/src';
import { setScale } from 'assets/scripts/transformUtils';
export default class RankItem extends ScillaComponent {
score: Entity;
rank: Entity;
name: Entity;
avatar: Entity;
onAwake() {
super.onAwake();
}
async setdata(data) {
//yun.duiba.com.cn/db_games/1.jpg
setText(this.rank, data + '');
const texRender = this.avatar.getComponent(TextureRenderer);
const texture = await this.loadTexture('//yun.duiba.com.cn/db_games/1.jpg');
texRender.texture = texture;
setScale(this.avatar,40/texture.bounds.width)
}
onUpdate(t) {
super.onUpdate(t);
}
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;
}
}
{"ver":"1.0.1","uuid":"ea6e2329-3083-471f-b71a-a9bdbe9f3cb2","subMetas":{},"type":"script"}
......@@ -5,9 +5,37 @@
*/
import ScillaComponent from 'components/base/ScillaComponent';
import { Entity, resource, instantiate, EngineConfig, Texture, createTexture } from 'scilla/src';
import { RectRenderer, Transform } from 'scilla-components/src';
import RankItem from './RankItem';
export default class RankList extends ScillaComponent {
item: resource;
content: Entity;
private _list: Entity[];
private _bg: RectRenderer;
onAwake() {
super.onAwake();
this._bg = this.content.getComponent(RectRenderer);
if (this._list) {
this._list.forEach(item => {
this.content.removeChild(item);
})
}
const itemHeight = 73;
const data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const totalHeight = itemHeight * data.length;
this._list = [];
this._bg.height = totalHeight;
// console.log(totalHeight);
data.forEach((item, index) => {
const rank = instantiate(this.item);
rank.getComponent(RankItem).setdata(item);
this.content.addChild(rank);
rank.getComponent(Transform).position.y = index * itemHeight - totalHeight / 2 + itemHeight / 2 + 10;
});
}
}
{"ver":"1.0.1","uuid":"1fbceff5-d327-43eb-ab17-4cd54cb440a5","subMetas":{"1.png":{"ver":"1.0.1","uuid":"598c0eb5-ea0e-41dc-adcb-d808fe0ac95f","rawTextureUuid":"1fbceff5-d327-43eb-ab17-4cd54cb440a5","type":"texture"},"2.png":{"ver":"1.0.1","uuid":"cf2931eb-bd7a-4ef6-8b71-9b67dc633306","rawTextureUuid":"1fbceff5-d327-43eb-ab17-4cd54cb440a5","type":"texture"},"3.png":{"ver":"1.0.1","uuid":"d6139441-67ce-4290-94b4-43971b310753","rawTextureUuid":"1fbceff5-d327-43eb-ab17-4cd54cb440a5","type":"texture"},"返回首页.png":{"ver":"1.0.1","uuid":"96f7f590-a82a-422f-803d-6e4e454b6dc5","rawTextureUuid":"1fbceff5-d327-43eb-ab17-4cd54cb440a5","type":"texture"}},"type":"sheet"}
{"ver":"1.0.1","uuid":"1fbceff5-d327-43eb-ab17-4cd54cb440a5","subMetas":{"1.png":{"ver":"1.0.1","uuid":"598c0eb5-ea0e-41dc-adcb-d808fe0ac95f","rawTextureUuid":"1fbceff5-d327-43eb-ab17-4cd54cb440a5","type":"texture"},"2.png":{"ver":"1.0.1","uuid":"cf2931eb-bd7a-4ef6-8b71-9b67dc633306","rawTextureUuid":"1fbceff5-d327-43eb-ab17-4cd54cb440a5","type":"texture"},"3.png":{"ver":"1.0.1","uuid":"d6139441-67ce-4290-94b4-43971b310753","rawTextureUuid":"1fbceff5-d327-43eb-ab17-4cd54cb440a5","type":"texture"},"返回首页.png":{"ver":"1.0.1","uuid":"96f7f590-a82a-422f-803d-6e4e454b6dc5","rawTextureUuid":"1fbceff5-d327-43eb-ab17-4cd54cb440a5","type":"texture"},"rankbg.png":{"ver":"1.0.1","uuid":"1c417086-3713-4fc1-94fa-2f29f3a34f09","rawTextureUuid":"1fbceff5-d327-43eb-ab17-4cd54cb440a5","type":"texture"}},"type":"sheet"}
assets/sheets/start.sht/rankbtn.png

1.49 KB | W: | H:

assets/sheets/start.sht/rankbtn.png

2.93 KB | W: | H:

assets/sheets/start.sht/rankbtn.png
assets/sheets/start.sht/rankbtn.png
assets/sheets/start.sht/rankbtn.png
assets/sheets/start.sht/rankbtn.png
  • 2-up
  • Swipe
  • Onion skin
{"ver":"1.0.1","uuid":"71e44311-e161-4503-8f98-61e49083fbc4","subMetas":{"rankitem_cankao":{"ver":"1.0.1","uuid":"10bcaeb9-a710-4d08-ba2d-3ab8aa407bb1","rawTextureUuid":"71e44311-e161-4503-8f98-61e49083fbc4","type":"texture"}},"type":"texture","imagePath":"/Users/wanghongyuan/shuijf2/assets/singles/rankitem_cankao.jpg"}
This diff is collapsed.
This diff is collapsed.
......@@ -47,11 +47,11 @@ registerDef('./scripts/scenes/ScenePlay', component12);
import component13 from '../../assets/scripts/navigator/SingleSceneNavigator';
registerDef('./scripts/navigator/SingleSceneNavigator', component13);
import component14 from '../../assets/scripts/Icon';
registerDef('./scripts/Icon', component14);
import component14 from '../../assets/scripts/scenes/SceneGuide';
registerDef('./scripts/scenes/SceneGuide', component14);
import component15 from '../../assets/scripts/scenes/SceneResult';
registerDef('./scripts/scenes/SceneResult', component15);
import component15 from '../../assets/scripts/scenes/result/RankItem';
registerDef('./scripts/scenes/result/RankItem', component15);
import component16 from '../../assets/scripts/scenes/SceneStart';
registerDef('./scripts/scenes/SceneStart', component16);
......@@ -59,32 +59,38 @@ registerDef('./scripts/scenes/SceneStart', component16);
import component17 from '../../assets/scripts/api/SamplePollingApi';
registerDef('./scripts/api/SamplePollingApi', component17);
import component18 from '../../assets/scripts/MainController';
registerDef('./scripts/MainController', component18);
import component18 from '../../assets/scripts/scenes/result/RankList';
registerDef('./scripts/scenes/result/RankList', component18);
import component19 from '../../assets/scripts/popup/Popup';
registerDef('./scripts/popup/Popup', component19);
import component19 from '../../assets/scripts/MainController';
registerDef('./scripts/MainController', component19);
import component20 from '../../assets/scripts/api/SampleApi';
registerDef('./scripts/api/SampleApi', component20);
import component20 from '../../assets/scripts/popup/Popup';
registerDef('./scripts/popup/Popup', component20);
import component21 from '../../assets/scripts/dialogs/RuleDialogContent';
registerDef('./scripts/dialogs/RuleDialogContent', component21);
import component21 from '../../assets/scripts/api/SampleApi';
registerDef('./scripts/api/SampleApi', component21);
import component22 from '../../assets/scripts/game/CustomTextRenderer';
registerDef('./scripts/game/CustomTextRenderer', component22);
import component22 from '../../assets/scripts/dialogs/RuleDialogContent';
registerDef('./scripts/dialogs/RuleDialogContent', component22);
import component23 from '../../assets/scripts/scenes/SceneController';
registerDef('./scripts/scenes/SceneController', component23);
import component23 from '../../assets/scripts/game/CustomTextRenderer';
registerDef('./scripts/game/CustomTextRenderer', component23);
import component24 from '../../assets/scripts/dialogs/AlertDialogContent';
registerDef('./scripts/dialogs/AlertDialogContent', component24);
import component24 from '../../assets/scripts/scenes/SceneController';
registerDef('./scripts/scenes/SceneController', component24);
import component25 from '../../assets/scripts/dialogs/PrizeDialogContent';
registerDef('./scripts/dialogs/PrizeDialogContent', component25);
import component25 from '../../assets/scripts/dialogs/AlertDialogContent';
registerDef('./scripts/dialogs/AlertDialogContent', component25);
import component26 from '../../assets/scripts/common/Toast';
registerDef('./scripts/common/Toast', component26);
import component26 from '../../assets/scripts/dialogs/PrizeDialogContent';
registerDef('./scripts/dialogs/PrizeDialogContent', component26);
import component27 from '../../assets/scripts/scenes/SceneGuide';
registerDef('./scripts/scenes/SceneGuide', component27);
import component27 from '../../assets/scripts/common/Toast';
registerDef('./scripts/common/Toast', component27);
import component28 from '../../assets/scripts/Icon';
registerDef('./scripts/Icon', component28);
import component29 from '../../assets/scripts/scenes/SceneResult';
registerDef('./scripts/scenes/SceneResult', component29);
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