1

Google recently launched its new Google Identity platform and deprecated its old "Google Sign-In for Web" platform. I'm trying to add my own customized Google Sign-In button to a Phaser 3 game using the game framework's canvas-based GUI, but there doesn't seem to be an option to do so. Instead, Google seems to enforce extremely rigid personalization options and use of their own iframe.

With the new Google Identity, how can I create my own customized buttons rather than using Google's iframe? I need the button to scale as an object rendered through canvas rather than an DOM element.


Or, is there any way to change the properties of the button after it's rendered (see below)? Perhaps a workaround is to add a resize eventListener on window and scale the button manually. I don't see an option to even do this.

google.accounts.id.renderButton(document.getElementById('google-login'), {
            theme: 'outline',
            size: 'large',
            type: 'standard',
            width: '256', // <--- here
        })
3
  • Did you ever find a way around this? Commented Feb 9, 2023 at 15:20
  • @tdm No I haven't Commented Feb 9, 2023 at 21:01
  • I ended up working out a solution of hiding the real social login buttons under our custom ones and pointer-events: none to allow the clicks to pass through. Kind of fiddly and feels wrong, but it seems to work Commented Feb 10, 2023 at 19:51

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.