Commit 9dbc3a99 authored by rockyl's avatar rockyl

修复

parent c7394971
......@@ -170,11 +170,9 @@ export class GameStage extends Node {
loadingView = await this.instantiateView(loadingViewName, true, false);
this._loadingView.addChild(loadingView);
}
this._loadingView.visible = true;
Tween.get(this._loadingView, null, null, true)
.to({alpha: 0}, 200)
.call(() => {
this._loadingView.visible = true;
});
.to({alpha: 1}, 200);
}
/**
......@@ -183,7 +181,7 @@ export class GameStage extends Node {
hideInnerLoadingView() {
if (this._loadingView.visible) {
Tween.get(this._loadingView, null, null, true)
.to({alpha: 1}, 200)
.to({alpha: 0}, 200)
.call(() => {
this._loadingView.visible = false;
});
......@@ -330,6 +328,9 @@ export class GameStage extends Node {
};
async loadPreloadAssets(onPreloadAssetsProgress, onPreloadAssetsComplete) {
//直接显示菊花loading
onPreloadAssetsProgress && onPreloadAssetsProgress(0, 1);
const {assets, customs} = this._config;
let loaded = 0;
......@@ -340,6 +341,7 @@ export class GameStage extends Node {
if (assetsToLoad.length > 0) {
await this.showInnerLoadingView();
onPreloadAssetsComplete && onPreloadAssetsComplete();
await loadAssetsGroups({
preload: assetsToLoad,
}, async () => {
......
......@@ -5,6 +5,7 @@
import {GameStage} from "./GameStage";
import {Label, Rect, Node} from "./nodes/index";
import {Tween} from "../../2d/tween/index";
import {TEXT_ALIGN} from "../../2d/const";
export class Toast extends Node {
private _contentSample: Node;
......@@ -82,7 +83,7 @@ export class Toast extends Node {
}
if (!view) {
if (!this._contentSample) {
const {borderRadius = 10, labColor = 'white', labSize = 30, bgColor = 'black', bgAlpha = 0.7} = props;
const {borderRadius = 10, labColor = 'white', labSize = 30, labelAlign = TEXT_ALIGN.CENTER, bgColor = 'black', bgAlpha = 0.7} = props;
this._contentSample = new Node();
let bg = new Rect();
......@@ -96,6 +97,7 @@ export class Toast extends Node {
lab.name = 'lab';
lab.fillColor = labColor;
lab.size = labSize;
lab.textAlign = labelAlign;
this._contentSample.addChild(lab);
}
view = this._contentSample;
......
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