UNPKG

@needle-tools/engine

Version:

Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development with great integrations into editors like Unity or Blender - and can be deployed onto any device! It is flexible, extensible and networking and XR are built-in.

40 lines (39 loc) 1.11 kB
import { Behaviour } from "./Component.js"; export declare enum DeviceType { Never = 0, Desktop = 1, Mobile = 2 } /** * DeviceFlag shows or hides GameObjects based on device type. * Use for responsive 3D content - show different UI, models, or interactions * depending on mobile vs desktop. * * **Device types:** * - `Desktop` - Traditional computers with mouse/keyboard * - `Mobile` - Phones and tablets with touch input * - Combine with bitwise OR for multiple: `Desktop | Mobile` * * @example Show only on desktop * ```ts * const flag = myObject.addComponent(DeviceFlag); * flag.visibleOn = DeviceType.Desktop; * ``` * * @example Show on both mobile and desktop * ```ts * flag.visibleOn = DeviceType.Desktop | DeviceType.Mobile; * ``` * * @summary Show or hide GameObject based on device type * @category Utilities * @group Components * @see {@link DeviceType} for device options * @see {@link XRFlag} for XR-based visibility */ export declare class DeviceFlag extends Behaviour { visibleOn: DeviceType; onEnable(): void; apply(): void; private test; }