Overlay
Overview
With GamePush, you can display ready-made game windows without the need to manually code them. On platforms that do not support certain functionality, we aim to use our windows to make the action available on all platforms. For example, share a link on social media.
List of ready-made windows from different modules:
- Leaderboards
- Achievements Lists
- Unlocked Achievement Badge
- Ready Chat
- Share with Friends
- Authorization
- Modal Windows
Modal Windows
FREEAction Confirmation
Open an overlay with confirmation of an action. Translated into all available languages.
- JavaScript
- Unity
const isConfirmed = await gp.windows.showConfirm();
if (isConfirmed) {
// action confirmed
}
GP_Windows.ShowConfirm(OnConfirm);
private void OnConfirm(bool isConfirmed){
if (isConfirmed) {
// action confirmed
}
}
Open an overlay with customized action confirmation.
- JavaScript
- Unity
const isConfirmed = await gp.windows.showConfirm({
// Window title
title: 'Drop Item',
// Window description
description: 'Are you sure you want to drop the item?\nThe item will disappear permanently.',
// Text for confirm button, default is "Confirm"
textConfirm: 'Yes',
// Text for cancel button, default is "Cancel"
textCancel: 'No',
// Invert button colors ("Confirm" will be gray), default is "false"
invertButtonColors: true,
});
if (isConfirmed) {
// action confirmed
}
private void ShowConfirm(){
ConfirmWindowData data = new ConfirmWindowData
{
// Window title
title = "Drop Item",
// Window description
description = "Are you sure you want to drop the item?\nThe item will disappear permanently.",
// Text for confirm button, default is "Confirm"
textConfirm = "Yes",
// Text for cancel button, default is "Cancel"
textCancel = "No",
// Invert button colors ("Confirm" will be gray), default is "false"
invertButtonColors = true
};
GP_Windows.ShowConfirm(data, OnConfirm);
}
private void OnConfirm(bool isConfirmed){
if (isConfirmed) {
// action confirmed
}
}
Confirmation Window close event.
- JavaScript
- Unity
gp.windows.on('confirm:close', (isConfirmed: boolean) => {
if (isConfirmed) {
// action confirmed
}
});
private void OnEnable()
{
GP_Windows.OnConfirm += OnConfirm;
}
private void OnDisable()
{
GP_Windows.OnConfirm -= OnConfirm;
}
private void OnConfirm(bool isConfirmed){
if (isConfirmed) {
// action confirmed
}
}
Stay in Touch
Other documents of this chapter available Here. To get started, welcome to the Tutorials chapter.
GamePush Community Telegram
: @gs_community.
For your suggestions e-mail
: [email protected]
We Wish you Success!