Commit 29fdedfc authored by limingzhe's avatar limingzhe

fix: 按钮名显示异常

parent 09310afe
import { MyCocosSceneComponent } from "../script/MyCocosSceneComponent";
import Attributes from "../script/Attributes";
import { callNetworkApiGet, callNetworkApiPost, jumpToCourseWare, buttonOnClick, jumpToBundle } from "../script/util";
import { callNetworkApiGet, callNetworkApiPost, jumpToCourseWare, buttonOnClick, jumpToBundle, delayCall } from "../script/util";
// @ts-ignore
import { assign, createMachine, interpret, actions, forwardTo, matchesState } from "../script/xstate";
const { pure, send, raise, sendParent } = actions;
......@@ -216,6 +216,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
titleNode.getComponent(cc.RichText).string = `<outline align=top color=${outline}
width=4>${name}</outline>`
delayCall(0.2, () => {
titleNode.getComponent(cc.RichText).string = `<outline align=top color=${outline}
width=4>${name}</outline>`
})
});
......
......@@ -520,3 +520,20 @@ export function buttonOnClick(button: cc.Node, callback: Function, scale = 1.0)
.start();
});
}
export function delayCall(time, cb) {
return cc.tween({})
.delay(time)
.call(() => {
if (cb) {
cb();
}
})
.start();
}
\ No newline at end of file
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