For the complete documentation index, see llms.txt. This page is also available as Markdown.

Game.subscribeInfoOverlayHidden

功能说明

订阅游戏信息覆盖层完全消失的时刻。仅在显示游戏信息覆盖层的游戏中才会触发事件。

需要在覆盖层消失前订阅。已经消失的事件不会再次传递。返回的取消订阅函数在不再需要事件时调用。

类型

参数

interface SubscribeInfoOverlayHiddenEventParams {
  onEvent: () => void;
  onError: (error: unknown) => void;
}

响应

type Unsubscribe = () => void;

示例代码

import { Game } from "@apps-in-toss/web-framework";

const unsubscribe = Game.subscribeInfoOverlayHidden({
  onEvent: () => {
    console.log("游戏信息覆盖层已经消失了。");
  },
  onError: (error) => {
    console.error("未能订阅游戏信息覆盖层事件。", error);
  },
});

// 在不再需要事件时调用。
unsubscribe();

这有帮助吗?