Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: Platform

[18:14] static extends: object

Helper for FXGL's Platform enum (com.almasb.fxgl.core.util.Platform). Provides runtime detection of the host (WINDOWS / MAC / LINUX / ANDROID / IOS / BROWSER / EMBEDDED) plus convenience predicates (isMobile / isDesktop / isBrowser / isEmbedded). Use through the static-style helper: Platform.current() returns the current platform name; Platform.isDesktop() and friends return convenience flags.

Methods

  • get ()

    Returns the current Platform enum value as an AussomJavaObject. Inspect via .invoke("name").

    • @r An AussomJavaObject around a Platform value.
  • current ()

    Returns the current Platform enum name as a string.

    • @r A string ("WINDOWS", "MAC", "LINUX", "ANDROID", "IOS", "BROWSER", or "EMBEDDED").
  • isDesktop ()

    Returns true when running on a desktop OS.

  • isMobile ()

    Returns true when running on a mobile platform.

  • isBrowser ()

    Returns true when running in a browser.

  • isEmbedded ()

    Returns true when running on an embedded platform.

  • valueOf (string Name)

    Resolves a specific Platform enum value by name.

    • @p Name is the Platform enum name.
    • @r An AussomJavaObject around the Platform value.