Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

  • hasTouchScreen(): boolean
  • Check if the device has a touchscreen

    Returns boolean

  • isMobile(): boolean
  • Check if the game runs on a mobile device (iPhone, iPad, Android). Note that the distinction between what is a mobile device and what is not is becoming blurry. If you use this for mobile controls, prefer to check if the device has touchscreen support.

    Returns boolean

  • Check if the game is running as a native desktop app - which in the case of an exported GDevelop game means: running packaged inside Electron.

    Parameters

    Returns boolean

    true if running inside Electron.

  • isNativeMobileApp(): boolean
  • Check if the game is running as a native mobile app - which in the case of an exported GDevelop game means: running packaged inside Cordova/Capacitor.js.

    Note: this could be improved to also detect running inside an embedded webview.

    Returns boolean

    true if running inside Cordova (or Capacitor.js).

  • Check if the game is running as a preview, launched from an editor.

    Parameters

    Returns boolean

    true if the game is running as a preview.

  • Check if the the device supports WebGL.

    Parameters

    Returns boolean

    true if WebGL is supported

Generated using TypeDoc