### Get Buffer Start Time Source: https://docs.flaxengine.com/api-cpp/AudioClip Retrieves the start time in seconds for a specified audio buffer. Requires the buffer index as input. ```cpp public float GetBufferStartTime(int32 bufferIndex) const ``` -------------------------------- ### Get Start Time Source: https://docs.flaxengine.com/api-cpp/AudioSource Retrieves the time in seconds at which the audio clip will start playing if 'Play On Start' is enabled. This allows for delayed playback initiation. ```cpp public float GetStartTime() const ``` -------------------------------- ### Get Autoplay on Start Setting Source: https://docs.flaxengine.com/api-cpp/AudioSource Determines whether the audio clip should automatically start playing when the level begins. Returns true if autoplay is enabled, false otherwise. ```cpp public bool GetPlayOnStart() const ``` -------------------------------- ### SkinnedMesh Setup Skeleton (Nodes Only) Source: https://docs.flaxengine.com/api-cpp/SkinnedModel Sets up the skeleton for the SkinnedMesh using only node hierarchy information. It calculates the offset matrix automatically. The provided nodes array must start with a root node. This is useful when bone hierarchy details are implicitly defined by nodes. ```cpp public bool SetupSkeleton(const Array& nodes) ``` -------------------------------- ### C# Scripting: Basic Initialization Source: https://docs.flaxengine.com/manual/get-started/flax-for-godot-devs/index Demonstrates the equivalent 'ready' or 'start' functions for scripts in Godot and Flax. Godot uses '_Ready()' within a 'Node' class, while Flax uses 'OnStart()' within a 'Script' class. Both examples print a message to the console upon script initialization. ```csharp public class MyScript : Node { public override void _Ready() { GD.print("It is Godot!"); } } ``` ```csharp public class MyScript : Script { public override void OnStart() { Debug.Log("It is Flax!"); } } ``` -------------------------------- ### NetworkManager Mode Starting Methods Source: https://docs.flaxengine.com/api-cpp/NetworkManager Methods to initiate the network in different modes. These include starting as a client or starting as a host. They return true if there was a failure, such as invalid configuration. ```csharp public static bool StartClient() public static bool StartHost() ``` -------------------------------- ### Get Current Playback Time Source: https://docs.flaxengine.com/api-cpp/AudioSource Gets the current playback time in seconds. If playback hasn't started, it returns the scheduled start time. The time is within the range [0, ClipLength]. ```cpp public float GetTime() const ``` -------------------------------- ### SetupPresentQueue Vulkan Presentation Setup Source: https://docs.flaxengine.com/api-cpp/GPUDeviceVulkan Sets up the presentation queue to be ready for rendering to a given window surface. This is essential for displaying rendered content on the screen. ```cpp public void SetupPresentQueue(VkSurfaceKHR surface) ``` -------------------------------- ### Init Method (C++) Source: https://docs.flaxengine.com/api-cpp/AudioBackend Initializes the audio backend system. This public static method attempts to set up the audio backend and returns a boolean value indicating success or failure. ```cpp public static bool Init() ``` -------------------------------- ### SetupSkeleton (Nodes, Bones, AutoOffset) Source: https://docs.flaxengine.com/api-cpp/SkinnedModel Sets up the skinned model skeleton with explicit bone data and offset matrix calculation option. ```APIDOC ## SetupSkeleton (Nodes, Bones, AutoOffset) ### Description Sets up the skinned model skeleton. ### Method `public bool SetupSkeleton(const Array& nodes, const Array& bones, bool autoCalculateOffsetMatrix)` ### Parameters #### Path Parameters * None #### Query Parameters * None #### Request Body * **nodes** (Array) - The nodes hierarchy. The first node must be a root one (with parent index equal -1). * **bones** (Array) - The bones hierarchy. * **autoCalculateOffsetMatrix** (bool) - If true, the OffsetMatrix for each bone will be auto-calculated; otherwise, provided values will be used. ### Request Example ```json { "nodes": [ {"name": "Root", "parentIndex": -1} ], "bones": [ {"name": "RootBone", "offsetMatrix": "..."} ], "autoCalculateOffsetMatrix": true } ``` ### Response #### Success Response (200) * **bool** - True if failed, otherwise false. #### Response Example ```json { "success": true } ``` ``` -------------------------------- ### Setup Model Level of Detail (LODs) Source: https://docs.flaxengine.com/api-cpp/Model Initializes the model's Level of Detail (LOD) collection and creates the necessary meshes based on the provided counts per LOD. Returns true if setup fails. ```cpp public bool SetupLODs(const Span& meshesCountPerLod) ``` -------------------------------- ### Get Rigidbody Start Awake (C++) Source: https://docs.flaxengine.com/api-cpp/RigidBody Determines if the Rigidbody should start in an awake state. If true, it will be active at the beginning of the simulation. Returns a boolean value. ```csharp public bool GetStartAwake() const ``` -------------------------------- ### SetupSkeleton (Nodes) Source: https://docs.flaxengine.com/api-cpp/SkinnedModel Sets up the skinned model skeleton using a hierarchy of nodes. ```APIDOC ## SetupSkeleton (Nodes) ### Description Sets up the skinned model skeleton. Uses the same nodes layout for skeleton bones and calculates the offset matrix by auto. ### Method `public bool SetupSkeleton(const Array& nodes)` ### Parameters #### Path Parameters * None #### Query Parameters * None #### Request Body * **nodes** (Array) - The nodes hierarchy. The first node must be a root one (with parent index equal -1). ### Request Example ```json { "nodes": [ {"name": "Root", "parentIndex": -1}, {"name": "Bone1", "parentIndex": 0} ] } ``` ### Response #### Success Response (200) * **bool** - True if failed, otherwise false. #### Response Example ```json { "success": true } ``` ``` -------------------------------- ### Get Scene Asset References Source: https://docs.flaxengine.com/api-cpp/Scene Retrieves a collection of GUIDs representing asset references within a scene. This functionality is only supported in the editor. The method returns an Array of Guids. ```C++ public Array GetAssetReferences() const ``` -------------------------------- ### SetupPresentQueue Source: https://docs.flaxengine.com/api-cpp/GPUDeviceVulkan Configures the presentation queue for a given window surface. ```APIDOC ## SetupPresentQueue ### Description Configures the presentation queue to be ready for rendering to the specified window surface. ### Method POST ### Endpoint /websites/flaxengine/gpu/present/queue/setup ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **surface** (VkSurfaceKHR) - Required - The handle to the window surface for presentation. ### Request Example ```json { "surface": "0xabcdef1234567890" } ``` ### Response #### Success Response (200) (No specific response body described, typically a 200 OK indicates success) #### Response Example ```json {} ``` ``` -------------------------------- ### BackBufferDX12.Setup() Method (C++) Source: https://docs.flaxengine.com/api-cpp/BackBufferDX12 This C++ snippet defines the Setup() method for the BackBufferDX12 class. It is used to configure the back buffer wrapper, taking a GPUSwapChainDX12 parent window and the ID3D12Resource representing the back buffer as parameters. ```cpp public void Setup(GPUSwapChainDX12* window, ID3D12Resource* backbuffer) ``` -------------------------------- ### Get Video Frame Texture Source: https://docs.flaxengine.com/api/FlaxEngine.VideoPlayer Gets the video frame texture, which is a GPU resource created upon playback start. This texture can be bound to materials and shaders to display the video image. ```csharp public GPUTexture Frame { get; } ``` -------------------------------- ### Init Source: https://docs.flaxengine.com/api-cpp/GPUDeviceVulkan Initializes device resources for the GPU. ```APIDOC ## Init ### Description Initializes essential device resources for the GPU. This method should be called before other GPU operations. ### Method POST ### Endpoint /websites/flaxengine/gpu/init ### Parameters None ### Request Example ```json {} ``` ### Response #### Success Response (200) - **success** (bool) - True if the initialization failed, otherwise false. #### Response Example ```json { "success": false } ``` ``` -------------------------------- ### Extract Substring from Start Index (C++) Source: https://docs.flaxengine.com/api-cpp/StringView Retrieves a substring starting from a specified index to the end of the StringView. This method is useful for getting a suffix of the string from a given position. ```cpp public StringView Substring(int32 startIndex) const { // Implementation details for substring from start index to end return StringView(); } ``` -------------------------------- ### GPUParticles Init Method Source: https://docs.flaxengine.com/api-cpp/GPUParticles Initializes the GPU particles simulation runtime. Requires owner, shader cache stream, material parameters stream, and custom data size. ```csharp public bool Init(ParticleEmitter* owner, MemoryReadStream& shaderCacheStream, ReadStream* materialParamsStream, int32 customDataSize) ``` -------------------------------- ### Start Property - C# Source: https://docs.flaxengine.com/api/FlaxEditor.GUI.Timeline.Media.ProxyBase-2 Gets or sets the start frame of the media event in seconds. This property is visible when 'UseFrames' is true and includes editor display and order attributes. ```csharp [EditorDisplay("General", null)] [EditorOrder(-10010)] [VisibleIf("UseFrames", true)] [Tooltip("Start frame of the media event (in seconds).")] public float Start { get; set; } ``` -------------------------------- ### C++ BinaryAssetUpgrader setup Method Source: https://docs.flaxengine.com/api-cpp/BinaryAssetUpgrader Protected method to set up the upgrade process by providing an array of upgraders and their count. This is intended for internal configuration of the BinaryAssetUpgrader. ```cpp protected void setup(Upgrader const* upgraders, int32 upgradersCount) ``` -------------------------------- ### Get or Set TypeName Property Source: https://docs.flaxengine.com/api/FlaxEngine.SoftTypeReference Allows getting or setting the fully qualified name of the type. This is the string representation used to identify the type within the scripting environment. For example, 'FlaxEngine.Actor'. ```csharp public string TypeName { get; set; } ``` -------------------------------- ### Get Prefab ID in Flax Engine Source: https://docs.flaxengine.com/api-cpp/SceneObject Retrieves the unique identifier (Guid) of the prefab asset associated with this object. If the object is not linked to a prefab, an empty Guid is returned. This method is const. ```cpp public Guid GetPrefabID() const ``` -------------------------------- ### Setup Atlas Pixel Format and Padding (C++) Source: https://docs.flaxengine.com/api-cpp/FontTextureAtlas The Setup method configures the atlas with a specified PixelFormat and PaddingStyle after its creation. This is essential for defining how texture data is stored and laid out. ```C++ public void Setup(PixelFormat format, PaddingStyle paddingStyle) ``` -------------------------------- ### Initialize Online Platform - C# and C++ Source: https://docs.flaxengine.com/manual/networking/online/index Demonstrates how to initialize the Online system with a specific online platform implementation, such as Steam. This setup step is typically performed when the game's main menu opens. ```csharp using FlaxEngine.Online; using FlaxEngine.Online.Steam; var platform = platform = new OnlinePlatformSteam(); Online.Initialize(platform); ``` ```cpp #include "Engine/Online/Online.h" #include "OnlinePlatformSteam/OnlinePlatformSteam.h" auto platform = New(); Online::Initialize(platform); ``` -------------------------------- ### Get Scene Object ID Source: https://docs.flaxengine.com/api-cpp/Actor Retrieves the unique identifier (Guid) of the scene object. This is an overridden method from SceneObject. ```csharp public virtual Guid GetSceneObjectId() const override ``` -------------------------------- ### Configure Renderer Setup for Frame Drawing in Flax Engine Source: https://docs.flaxengine.com/api-cpp/RenderList The Setup field is of type RenderSetup and holds the renderer setup configurations for the current frame drawing. This ensures the renderer is correctly configured before each frame's rendering process. ```csharp public RenderSetup Setup ``` -------------------------------- ### Get Skeleton Retargeting Configurations (C++) Source: https://docs.flaxengine.com/api-cpp/SkinnedModel Retrieves the list of configured skeleton retargeting setups. This method returns an Array of SkeletonRetarget objects. ```cpp public Array GetSkeletonRetargets() const ``` -------------------------------- ### SkinnedMesh Setup Skeleton (Nodes, Bones, and Offset Matrix Calculation) Source: https://docs.flaxengine.com/api-cpp/SkinnedModel Sets up the SkinnedMesh's skeleton with both node and bone hierarchy information. It allows control over whether the offset matrix for each bone is auto-calculated or provided. This method offers greater flexibility in skeleton configuration. ```cpp public bool SetupSkeleton(const Array& nodes, const Array& bones, bool autoCalculateOffsetMatrix) ``` -------------------------------- ### Get Decoded Frames Count Source: https://docs.flaxengine.com/api/FlaxEngine.VideoPlayer Gets the count of video frames decoded and sent to the GPU during playback. This can help detect if video playback has started with visible changes to the frame texture. Valid only when media is loaded by the video backend. ```csharp public int FramesCount { get; } ``` -------------------------------- ### SetupLODs() Source: https://docs.flaxengine.com/api-cpp/SkinnedModel Sets up the Level of Detail (LOD) collection for the model, including mesh creation. ```APIDOC ## SetupLODs() ### Description Sets up the model LODs collection including meshes creation. ### Method `public bool SetupLODs(const Span& meshesCountPerLod)` ### Parameters #### Path Parameters * None #### Query Parameters * None #### Request Body * **meshesCountPerLod** (Span) - An array specifying the number of meshes per LOD. ### Request Example ```json { "meshesCountPerLod": [10, 5, 2] } ``` ### Response #### Success Response (200) * **bool** - True if failed, otherwise false. #### Response Example ```json { "success": false } ``` ``` -------------------------------- ### Setup Online Platform - C# and C++ Source: https://docs.flaxengine.com/manual/networking/online/index_tabs=code-csharp Initializes the Flax Online system with a specific online platform implementation. This is typically done during game startup, such as when the main menu loads. The chosen platform (e.g., Steam, Xbox Live) depends on the runtime environment. The `Online.Initialize()` method takes an instance of the platform implementation. ```csharp using FlaxEngine.Online; using FlaxEngine.Online.Steam; var platform = platform = new OnlinePlatformSteam(); Online.Initialize(platform); ``` ```cpp #include "Engine/Online/Online.h" #include "OnlinePlatformSteam/OnlinePlatformSteam.h" auto platform = New(); Online::Initialize(platform); ``` -------------------------------- ### Get Prefab Object ID in Flax Engine Source: https://docs.flaxengine.com/api-cpp/SceneObject Retrieves the unique identifier (Guid) of the specific object within a prefab that is synchronized with this object. Returns an empty Guid if no prefab link exists. This method is const. ```cpp public Guid GetPrefabObjectID() const ``` -------------------------------- ### GetPrefabID API Source: https://docs.flaxengine.com/api-cpp/SceneObject Gets the prefab asset ID. Returns an empty GUID if no prefab link exists. ```APIDOC ## GET /websites/flaxengine/Actor/GetPrefabID ### Description Gets the unique identifier for the prefab asset linked to this object. If the object is not linked to a prefab, an empty GUID is returned. ### Method GET ### Endpoint /websites/flaxengine/Actor/GetPrefabID ### Parameters #### Path Parameters None #### Query Parameters None ### Request Body None ### Request Example None ### Response #### Success Response (200) - **Guid** (Guid) - The prefab asset ID. This will be an empty GUID if no prefab link exists. #### Response Example ```json { "prefabId": "00000000-0000-0000-0000-000000000000" } ``` ``` -------------------------------- ### Setup Prefab Instances Source: https://docs.flaxengine.com/api-cpp/SceneObjectsFactory Initializes prefab instances within scene objects for proper reference deserialization. Should be called after spawning scene objects but before deserialization. ```C# public static void SetupPrefabInstances(Context& context, const PrefabSyncData& data) ``` -------------------------------- ### setupResources() Method Source: https://docs.flaxengine.com/api-cpp/GlobalSignDistanceFieldPass Sets up the necessary resources for rendering. This method is a virtual override from the base class. ```APIDOC ## setupResources() ### Description Sets up the necessary resources for rendering. This method is a virtual override from the base class. ### Method Protected virtual ### Endpoint N/A (Method within a class) ### Parameters None ### Request Example N/A ### Response #### Success Response - **bool** - Returns true if resources were set up successfully, false otherwise. #### Response Example ```json { "success": true } ``` ``` -------------------------------- ### GetSkeletonMapping Source: https://docs.flaxengine.com/api-cpp/SkinnedModel Gets the skeleton mapping for a given asset, utilizing identity mapping or a manually created retargeting setup. It can optionally perform automatic retargeting. ```APIDOC ## GetSkeletonMapping(Asset* source, bool autoRetarget=true) ### Description Gets the skeleton mapping for a given asset (animation or other skinned model). Uses identity mapping or manually created retargeting setup. ### Method GET ### Endpoint /websites/flaxengine ### Parameters #### Path Parameters None #### Query Parameters * **source** (Asset*) - Required - The source asset (animation or other skinned model) to get mapping to its skeleton. * **autoRetarget** (bool) - Optional - Enables automatic skeleton retargeting based on nodes names. Can be disabled to query existing skeleton mapping or return null if not defined. Defaults to true. #### Request Body None ### Request Example ```json { "source": "Asset object pointer", "autoRetarget": true } ``` ### Response #### Success Response (200) * **SkeletonMapping** (SkeletonMapping) - The skeleton mapping for the source asset into this skeleton. #### Response Example ```json { "mapping": { "sourceBone": "boneA", "targetBone": "boneX" } } ``` ``` -------------------------------- ### CanvasScaler CurrentScale Property Source: https://docs.flaxengine.com/api/FlaxEngine.GUI.CanvasScaler Gets the current UI scale, which is computed based on the setup during layout. This is a read-only property. ```csharp public float CurrentScale { get; } ``` -------------------------------- ### Init Method Source: https://docs.flaxengine.com/api-cpp/CommandQueueDX12 Initializes the necessary resources for the CommandQueueDX12. Returns true if initialization fails, false otherwise. ```csharp public bool Init() ``` -------------------------------- ### Get Asset References Source: https://docs.flaxengine.com/api-cpp/MaterialParams Collects all asset Guid references used by the material parameters. This is useful for dependency tracking and asset management. ```C++ public void GetReferences(Array& assets) const ``` -------------------------------- ### Get Spline Loop Status (C++) Source: https://docs.flaxengine.com/api-cpp/Spline Checks whether the spline is configured to loop. If true, the spline is considered closed, and the start and end points should ideally be at the same location. ```cpp public bool GetIsLoop() const ``` -------------------------------- ### Init Source: https://docs.flaxengine.com/api-cpp/PhysicsBackend Initializes the physics system. ```APIDOC ## POST /websites/flaxengine/init ### Description Initializes the physics system. This function must be called before using other physics functions. ### Method POST ### Endpoint /websites/flaxengine/init ### Parameters None ### Response #### Success Response (200) - **Initialized** (bool) - True if initialization was successful, false otherwise. #### Response Example ```json { "Initialized": true } ``` ``` -------------------------------- ### Get Material Parameter by ID Source: https://docs.flaxengine.com/api-cpp/MaterialParams Retrieves a pointer to a material parameter using its unique Guid identifier. Returns nullptr if the parameter is not found. ```C++ public MaterialParameter* Get(const Guid& id) ``` -------------------------------- ### LightPass SetupLights Method (C++) Source: https://docs.flaxengine.com/api-cpp/LightPass Sets up the lights rendering process for batched scene drawing. It takes the main render context and the rendering context batch as parameters. ```cpp public void SetupLights(RenderContext& renderContext, RenderContextBatch& renderContextBatch) ``` -------------------------------- ### Get Script By ID Source: https://docs.flaxengine.com/api-cpp/Actor Retrieves a script attached to the actor using its unique identifier (Guid). Returns a pointer to the script or null if not found. ```csharp public Script* GetScriptByID(const Guid& id) const ``` -------------------------------- ### Method: InitCompilationOptions Source: https://docs.flaxengine.com/api-cpp/Material Prepares and sets up the shader compilation options for the material. ```APIDOC ## POST /material/initCompilationOptions ### Description Prepares the shader compilation options for this material. ### Method POST ### Endpoint `/material/initCompilationOptions` ### Parameters #### Request Body - **options** (ShaderCompilationOptions&) - Required - The output structure to be filled with compilation options. ### Request Example ```json { "options": { "target": "High", "defines": ["USE_NORMAL_MAP"] } } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the operation was successful. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Set Selection Range Source: https://docs.flaxengine.com/api/FlaxEngine.GUI.TextBoxBase Gets or sets the range of characters that are selected within the text box. This is typically defined by a start index and a length. ```csharp [EditorOrder(50)] public TextRange SelectionRange { get; set; } ``` -------------------------------- ### Get Engine Startup Time - C# Source: https://docs.flaxengine.com/api/FlaxEngine.Engine Retrieves the local time when the engine started. This property can be used for performance analysis or logging. ```csharp DateTime startTime = Engine.StartupTime; ``` -------------------------------- ### Handle Play Mode Begin with OnPlayBegin Source: https://docs.flaxengine.com/api/FlaxEditor.Windows.GameWindow Called when the editor is transitioning into play mode. Overrides the base EditorWindow method. ```csharp public override void OnPlayBegin() { // Implementation for entering play mode } ``` -------------------------------- ### EditorWindow OnPlayBeginning Method Source: https://docs.flaxengine.com/api/FlaxEditor.Windows.EditorWindow Callback method executed just before the editor enters play mode. ```csharp public virtual void OnPlayBeginning() ``` -------------------------------- ### GetPrefabObjectID API Source: https://docs.flaxengine.com/api-cpp/SceneObject Gets the ID of the object within a prefab that is used for synchronization. Returns an empty GUID if no prefab link exists. ```APIDOC ## GET /websites/flaxengine/Actor/GetPrefabObjectID ### Description Retrieves the specific object ID within a prefab asset that this object is synchronized with. Returns an empty GUID if no prefab linkage is established. ### Method GET ### Endpoint /websites/flaxengine/Actor/GetPrefabObjectID ### Parameters #### Path Parameters None #### Query Parameters None ### Request Body None ### Request Example None ### Response #### Success Response (200) - **Guid** (Guid) - The ID of the object within the prefab for synchronization. Returns an empty GUID if no prefab link exists. #### Response Example ```json { "prefabObjectId": "00000000-0000-0000-0000-000000000000" } ``` ``` -------------------------------- ### BeginPlay Method Source: https://docs.flaxengine.com/api-cpp/AnimatedModel Called when adding an object to the game, used for initialization. ```APIDOC ## BeginPlay ### Description Called when adding object to the game. ### Method `protected virtual void BeginPlay(SceneBeginData* data)` ### Parameters - **data** (SceneBeginData*) - The initialization data (e.g. used to collect joints to link after begin). ### Overrides Actor::BeginPlay(SceneBeginData* data) ``` -------------------------------- ### Get Particle Parameter by ID C# Source: https://docs.flaxengine.com/api/FlaxEngine.ParticleEffect Retrieves a specific particle parameter using its emitter track name and parameter ID. This method is used to get detailed information about a parameter. It takes a string for the emitter track name and a Guid for the parameter ID, returning a ParticleEffectParameter or null if not found. ```csharp public ParticleEffectParameter GetParameter(string emitterTrackName, Guid paramId) ``` -------------------------------- ### Get Current Rendering Viewport Source: https://docs.flaxengine.com/api-cpp/Render2D Retrieves the current rendering viewport settings. This information is crucial for understanding the active drawing area and for camera or projection setups. ```csharp public static Viewport GetViewport() ``` -------------------------------- ### Begin Method (C#) Source: https://docs.flaxengine.com/api/FlaxEditor.Windows.Profiler.ProfilerMode.SharedUpdateData Initializes the SharedUpdateData container, preparing it for data usage at the start of a profiler session or update. ```csharp public void Begin() ``` -------------------------------- ### Set Is Multiline Scrollable Source: https://docs.flaxengine.com/api/FlaxEngine.GUI.TextBoxBase Gets or sets a boolean value indicating whether the text in a multiline text box can be scrolled, for example, using the mouse wheel. ```csharp [EditorOrder(41)] public bool IsMultilineScrollable { get; set; } ``` -------------------------------- ### OnPlayBegin Method Source: https://docs.flaxengine.com/api/FlaxEditor.Windows.Assets.BehaviorTreeWindow Callback invoked when the editor begins entering play mode. ```APIDOC ## OnPlayBegin() Method ### Description Called when the Editor is entering play mode. ### Method POST ### Endpoint /websites/flaxengine/OnPlayBegin ### Parameters ### Request Body None ### Response #### Success Response (200) - **Status** (string) - Indicates the operation was successful. #### Response Example ```json { "Status": "Success" } ``` ``` -------------------------------- ### SamplesBuffer Methods: Count, First, Get, HasItems (C#) Source: https://docs.flaxengine.com/api-cpp/SamplesBuffer This C# snippet covers utility methods for SamplesBuffer. 'Count' returns the current number of elements, 'First' retrieves the first element, 'Get' provides a pointer to the start of the data array, and 'HasItems' checks if any elements are present. ```C# public int32 Count() const public T First() const public T* Get() const public bool HasItems() const ``` -------------------------------- ### EditorWindow OnInit Method Source: https://docs.flaxengine.com/api/FlaxEditor.Windows.EditorWindow Called when the editor window is initialized. At this point, the main window, content database, and default editor windows are ready for use. ```csharp public virtual void OnInit() ``` -------------------------------- ### Setup and Resize Output Texture for Rendering Source: https://docs.flaxengine.com/manual/graphics/tutorials/render-fps-weapon Manages the output texture for weapon rendering. If the texture is not allocated or needs resizing, it creates or updates the texture description based on the provided width, height, and format. It also resizes the rendering task to match the new dimensions. ```csharp // Setup rendering resolution if (!_outputTexture.IsAllocated) { var outputDesc = GPUTextureDescription.New2D(width, height, _renderingTask.Buffers.OutputFormat); _outputTexture.Init(ref outputDesc); } _renderingTask.Resize(width, height); ``` -------------------------------- ### Get Video Frame Texture - C++ Source: https://docs.flaxengine.com/api-cpp/VideoPlayer Retrieves the GPU resource representing the current video frame. This texture is created at the start of playback and can be bound to materials and shaders for displaying the video image. ```cpp public GPUTexture* GetFrame() const ``` -------------------------------- ### PrefabDiffContextMenu Class Documentation Source: https://docs.flaxengine.com/api/FlaxEditor.GUI.PrefabDiffContextMenu Documentation for the PrefabDiffContextMenu class, its constructors, fields, methods, and events. ```APIDOC ## Class PrefabDiffContextMenu ### Description Represents a context menu for prefab differences. ### Syntax ```csharp public class PrefabDiffContextMenu : ContextMenuBase, IComparable, IDrawable ``` ### Constructors #### PrefabDiffContextMenu(Single, Single) Initializes a new instance of the PrefabDiffContextMenu class. ##### Declaration ```csharp public PrefabDiffContextMenu(float width = 280F, float height = 260F) ``` ##### Parameters - **width** (System.Single) - The control width. - **height** (System.Single) - The control height. ### Fields #### Tree The tree control where you should add your nodes. ##### Declaration ```csharp public readonly Tree Tree ``` ##### Field Value FlaxEditor.GUI.Tree.Tree ### Methods #### Hide() ##### Declaration ```csharp public override void Hide() ``` ##### Overrides FlaxEditor.GUI.ContextMenu.ContextMenuBase.Hide() #### OnDestroy() ##### Declaration ```csharp public override void OnDestroy() ``` ##### Overrides FlaxEditor.GUI.ContextMenu.ContextMenuBase.OnDestroy() #### OnKeyDown(KeyboardKeys) ##### Declaration ```csharp public override bool OnKeyDown(KeyboardKeys key) ``` ##### Parameters - **key** (KeyboardKeys) - ##### Returns System.Boolean ##### Overrides FlaxEditor.GUI.ContextMenu.ContextMenuBase.OnKeyDown(FlaxEngine.KeyboardKeys) #### OnShow() ##### Declaration ```csharp protected override void OnShow() ``` ##### Overrides FlaxEditor.GUI.ContextMenu.ContextMenuBase.OnShow() ### Events #### ApplyAll The event called to apply all the changes. ##### Declaration ```csharp public event Action ApplyAll ``` ##### Event Type System.Action #### RevertAll The event called to revert all the changes applied. ##### Declaration ```csharp public event Action RevertAll ``` ##### Event Type System.Action ### Extension Methods - **ReflectiveCompare**(T, T) - **RawClone**(T) ### See Also - FlaxEditor.GUI.ContextMenu.ContextMenuBase ``` -------------------------------- ### Get Unique Device ID - C# Source: https://docs.flaxengine.com/api/FlaxEngine.Platform Retrieves a unique identifier for the current user's device using the UniqueDeviceId property. This returns a Guid. ```csharp System.Guid deviceId = FlaxEngine.UniqueDeviceId; // Example usage: Console.WriteLine($"Device ID: {deviceId}"); ``` -------------------------------- ### AudioClipWindow Class Overview Source: https://docs.flaxengine.com/api/FlaxEditor.Windows.Assets.AudioClipWindow This section provides a high-level overview of the AudioClipWindow class, its syntax, constructors, properties, and methods. ```APIDOC ## AudioClipWindow Class ### Description Represents an editor window for managing AudioClip assets within the Flax Engine. ### Namespace FlaxEditor.Windows.Assets ### Assembly FlaxEngine.CSharp.dll ### Syntax ``` public sealed class AudioClipWindow : AssetEditorWindowBase, IComparable, IDrawable, IEditable, IContentItemOwner ``` ### Constructors #### AudioClipWindow(Editor, AssetItem) ##### Description Initializes a new instance of the `AudioClipWindow` class. ##### Declaration ``` public AudioClipWindow(Editor editor, AssetItem item) ``` ##### Parameters - **editor** (Editor) - The editor instance. - **item** (AssetItem) - The asset item to be managed. ### Properties #### UseLayoutData Gets a value indicating whether the window uses custom layout data. ##### Declaration ``` public override bool UseLayoutData { get; } ``` ##### Property Value - **System.Boolean** - True if the window uses custom layout data; otherwise, false. ##### Overrides - `DockWindow.UseLayoutData` ### Methods #### OnAssetLinked() ##### Description Called when an asset gets linked, allowing the window to set up its UI. ##### Declaration ``` protected override void OnAssetLinked() ``` ##### Overrides - `FlaxEditor.Windows.Assets.AssetEditorWindowBase.OnAssetLinked()` #### OnClose() ##### Description Called when the window is closed. ##### Declaration ``` protected override void OnClose() ``` ##### Overrides - `AssetEditorWindow.OnClose()` #### OnDestroy() ##### Description Method called when the managed instance should be destroyed. ##### Declaration ``` public override void OnDestroy() ``` ##### Overrides - `AssetEditorWindow.OnDestroy()` #### OnItemReimported(ContentItem) ##### Description Called when the associated content item is reimported. ##### Declaration ``` public override void OnItemReimported(ContentItem item) ``` ##### Parameters - **item** (ContentItem) - The reimported content item. ##### Overrides - `FlaxEditor.Windows.Assets.AssetEditorWindowBase.OnItemReimported(FlaxEditor.Content.ContentItem)` #### OnKeyDown(KeyboardKeys) ##### Description Handles key down events. Returns true if the event has been handled. ##### Declaration ``` public override bool OnKeyDown(KeyboardKeys key) ``` ##### Parameters - **key** (KeyboardKeys) - The key value. ##### Returns - **System.Boolean** - True if the event has been handled; otherwise, false. ##### Overrides - `EditorWindow.OnKeyDown(KeyboardKeys)` #### OnLayoutDeserialize() ##### Description Called during window layout deserialization if the window has no layout data to load. Can be used to restore default UI layout. ##### Declaration ``` public void OnLayoutDeserialize() ``` ``` -------------------------------- ### Flax Engine NetworkManager StartServer Method Source: https://docs.flaxengine.com/api/FlaxEngine.Networking.NetworkManager Initializes and starts the network in server mode. Returns true if the operation fails, for example, due to an invalid configuration. ```csharp [Unmanaged] public static bool StartServer(); ``` -------------------------------- ### Flax Engine NetworkManager StartClient Method Source: https://docs.flaxengine.com/api/FlaxEngine.Networking.NetworkManager Initializes and starts the network in client mode. Returns true if the operation fails, for example, due to an invalid configuration. ```csharp [Unmanaged] public static bool StartClient(); ``` -------------------------------- ### Init Method Source: https://docs.flaxengine.com/api-cpp/QueryHeapDX12 Initializes this instance of QueryHeapDX12. ```APIDOC ## Init() ### Description Initializes this instance. ### Method `public bool Init()` ### Returns - **bool** - `true` if initialization failed, otherwise `false`. ``` -------------------------------- ### EditorWindow OnPlayBegin Method Source: https://docs.flaxengine.com/api/FlaxEditor.Windows.EditorWindow Callback method executed when the editor begins entering play mode. ```csharp public virtual void OnPlayBegin() ``` -------------------------------- ### Get Main Engine Directory - C# Source: https://docs.flaxengine.com/api/FlaxEngine.Platform Retrieves the full path to the main engine installation directory. Useful for accessing engine-related files or configuration. ```csharp string mainDir = Platform.MainDirectory; // mainDir contains the path to the Flax Engine installation ``` -------------------------------- ### Get Particle CPU Data C# Source: https://docs.flaxengine.com/api-cpp/ParticleBuffer Retrieves a pointer to the CPU data of a specific particle. Requires the index of the particle. Returns the starting address of the particle's data. ```csharp public byte* GetParticleCPU(int32 particleIndex) { // Implementation details for getting particle CPU data return null; // Placeholder for actual pointer } ``` -------------------------------- ### VideoWindow Constructor and Lifecycle Methods Source: https://docs.flaxengine.com/api/FlaxEditor.Windows.Assets.VideoWindow Documentation for the VideoWindow class, including its constructor which takes an Editor and VideoItem, and its override of the OnDestroy method for cleanup. ```csharp public sealed class VideoWindow : EditorWindow, IComparable, IDrawable, IContentItemOwner { public VideoWindow(Editor editor, VideoItem item); public override void OnDestroy(); } ``` -------------------------------- ### Get Frame and Update Counts - C# Source: https://docs.flaxengine.com/api/FlaxEngine.Engine Retrieves the current frame count and update count since the game started. These properties are useful for performance monitoring and debugging. ```csharp ulong frameCount = Engine.FrameCount; ulong updateCount = Engine.UpdateCount; ``` -------------------------------- ### MinDistance Property in C# Source: https://docs.flaxengine.com/api/FlaxEngine.AudioSource Gets or sets the minimum distance at which audio attenuation begins. Within this distance, audio is heard at full volume; beyond it, attenuation starts. ```csharp [EditorOrder(60)] [Limit(0F, 3.40282347E+38F, 0.1F)] [EditorDisplay("Audio Source", null)] [Unmanaged] public float MinDistance { get; set; } ``` -------------------------------- ### AudioSource Methods Source: https://docs.flaxengine.com/api-cpp/AudioSource Details methods available in the AudioSource class, such as BeginPlay for initialization and Deserialize for loading state. ```csharp protected virtual void BeginPlay(SceneBeginData* data) override public virtual void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override ``` -------------------------------- ### Handle Play Begin (C#) Source: https://docs.flaxengine.com/api/FlaxEditor.Windows.Assets.BehaviorTreeWindow Called when the Editor is entering play mode. Overrides the base class implementation. ```csharp public override void OnPlayBegin() { // Implementation details omitted } ``` -------------------------------- ### StartFrame Property - C# Source: https://docs.flaxengine.com/api/FlaxEditor.GUI.Timeline.Media.ProxyBase-2 Gets or sets the start frame of the media event in frames. This property is conditional, visible when 'UseFrames' is false, and is configured with editor attributes. ```csharp [EditorDisplay("General", null)] [EditorOrder(-10010)] [VisibleIf("UseFrames", false)] [Tooltip("Start frame of the media event (in frames).")] public int StartFrame { get; set; } ``` -------------------------------- ### MainMenu Constructors Source: https://docs.flaxengine.com/api/FlaxEditor.GUI.MainMenu Provides information on how to initialize a new instance of the MainMenu class. ```APIDOC ## MainMenu(RootControl) ### Description Initializes a new instance of the MainMenu class. ### Method Constructor ### Parameters - **mainWindow** (RootControl) - The main window. ### Request Example ```json { "mainWindow": "" } ``` ### Response Example ```json { "instance": "" } ``` ``` -------------------------------- ### Get Scene IDs Source: https://docs.flaxengine.com/api-cpp/Level Retrieves the unique identifiers (GUIDs) of all loaded scenes. This is useful for referencing scenes by their IDs, especially when performing operations like loading or saving. ```C++ public static void GetScenes(Array& scenes) ``` -------------------------------- ### GPUSwapChain Begin Method (C++) Source: https://docs.flaxengine.com/api-cpp/GPUSwapChain The Begin method initiates the rendering task for the swap chain. It takes a RenderTask pointer as input to manage the rendering process. ```cpp public virtual void Begin(RenderTask* task) ``` -------------------------------- ### SoftObjectReference ID Property (C#) Source: https://docs.flaxengine.com/api/FlaxEngine.SoftObjectReference Provides the declaration for the ID property of the SoftObjectReference class. This property allows getting and setting the unique identifier (Guid) of the referenced object. ```csharp public Guid ID { get; set; } ``` -------------------------------- ### Get Asset by ID in C# Source: https://docs.flaxengine.com/api/FlaxEngine.Content Retrieves an asset object using its unique GUID. This method checks all currently loaded assets. If the asset is not loaded, it will return null. ```csharp Guid assetID = new Guid("some-guid-string"); Asset foundAsset = Content.GetAsset(assetID); ``` -------------------------------- ### GPUTextureViewDX12 Init Method Source: https://docs.flaxengine.com/api-cpp/GPUTextureViewDX12 Initializes the GPUTextureViewDX12 with the necessary parameters, including the parent GPU resource, the DirectX 12 device, the resource owner, pixel format, multi-sample level, and an optional subresource index. This method prepares the view for use in rendering pipelines. ```cpp public void Init(GPUResource* parent, GPUDeviceDX12* device, ResourceOwnerDX12* owner, PixelFormat format, MSAALevel msaa, int32 subresourceIndex = -1) ``` -------------------------------- ### Get All Asset IDs in C# Source: https://docs.flaxengine.com/api/FlaxEngine.Content Retrieves an array of GUIDs for all assets known to the asset registry. This method is useful for iterating through all available assets or for operations that require asset identifiers. ```csharp Guid[] allAssetIDs = Content.GetAllAssets(); ``` -------------------------------- ### Looping and Playback Start Settings for Audio Clips Source: https://docs.flaxengine.com/api-cpp/AudioSource Configure whether an audio clip should loop indefinitely using SetIsLooping. SetPlayOnStart determines if the audio plays automatically when the game begins, and SetStartTime specifies the initial playback time. ```csharp public void SetIsLooping(bool value) public void SetPlayOnStart(bool value) public void SetStartTime(float value) ``` -------------------------------- ### Initialize Asset Source: https://docs.flaxengine.com/api-cpp/AudioClip Initializes the asset using provided initialization data. Returns true if initialization fails, false otherwise. ```cpp protected virtual bool init(AssetInitData& initData) override ``` -------------------------------- ### Camera Property - C# Source: https://docs.flaxengine.com/api/FlaxEngine.SceneRenderTask Gets or sets the camera used for scene rendering. This allows overriding rendering view properties based on the current camera setup. The type is Camera. ```csharp [Unmanaged] public Camera Camera { get; set; } ``` -------------------------------- ### PrefabTree Constructor (C#) Source: https://docs.flaxengine.com/api/FlaxEditor.Windows.Assets.PrefabWindow.PrefabTree Initializes a new instance of the PrefabWindow.PrefabTree class. This is the default constructor for the PrefabTree. ```csharp public PrefabTree() ``` -------------------------------- ### Change Current Language and Culture Source: https://docs.flaxengine.com/manual/editor/localization/index_tabs=code-csharp Provides examples of how to get the current language and culture settings, subscribe to localization change events, and set a new language and culture. This functionality is accessible in C#, C++, and Visual Script. ```csharp using System.Globalization; Debug.Log("Current language: " + Localization.CurrentLanguage); Debug.Log("Current culture: " + Localization.CurrentCulture); Localization.LocalizationChanged += () => { Debug.Log("Localization changed!"); }; Localization.SetCurrentLanguageCulture(new CultureInfo("en-US")); ``` ```cpp #include "Engine/Localization/Localization.h" void OnLocalizationChanged() { LOG(Info, "Localization changed!"); } LOG(Info, "Current language: {}", Localization::GetCurrentLanguage()); LOG(Info, "Current culture: {}", Localization::GetCurrentCulture()); Localization::LocalizationChanged.Bind(&::OnLocalizationChanged); Localization::SetCurrentLanguageCulture(CultureInfo("en-US")); ``` -------------------------------- ### Flax Engine NetworkManager StartHost Method Source: https://docs.flaxengine.com/api/FlaxEngine.Networking.NetworkManager Initializes and starts the network in host mode (acting as both server and client). Returns true if the operation fails, for example, due to an invalid configuration. ```csharp [Unmanaged] public static bool StartHost(); ``` -------------------------------- ### GPUTimerQueryDX12 Begin Method (C++) Source: https://docs.flaxengine.com/api-cpp/GPUTimerQueryDX12 Starts the GPU timer query. This method should be called before the GPU commands you intend to time. It overrides the base GPUTimerQuery::Begin() method. ```cpp public virtual void Begin() override ``` -------------------------------- ### Get Mouse Button Down State - C# Source: https://docs.flaxengine.com/api-cpp/Input Checks if a mouse button was pressed down during the current frame. It takes the mouse button identifier and returns true if the button press started this frame. ```csharp public static bool GetMouseButtonDown(MouseButton button) ``` -------------------------------- ### Start Listening for Connections (C++) Source: https://docs.flaxengine.com/api-cpp/NetworkLagDriver Starts the network driver to listen for incoming connections, effectively making the instance a server. This method is essential for establishing a server role in network communication. It returns true upon successful initiation. ```cpp public virtual bool Listen() override ``` -------------------------------- ### Get Keyboard Key Down State - C# Source: https://docs.flaxengine.com/api-cpp/Input Determines if a specific keyboard key was pressed down during the current frame. It takes the key identifier and returns true if the key press started this frame. ```csharp public static bool GetKeyDown(KeyboardKeys key) ``` -------------------------------- ### Initialize Asset with Storage and Header Source: https://docs.flaxengine.com/api-cpp/BinaryAsset Initializes an asset using the provided storage reference and asset header. Further initialization should be done with AssetInitData. This function is part of the core asset setup process. ```C++ public bool Init(const FlaxStorageReference& storage, AssetHeader& header) ``` -------------------------------- ### Get Leaderboard Entries (C#) Source: https://docs.flaxengine.com/api-cpp/IOnlinePlatform Fetches a range of entries from an online leaderboard. This method allows specifying the starting index and the count of entries to retrieve, useful for paginating leaderboard displays. ```C# public virtual bool GetLeaderboardEntries(const OnlineLeaderboard& leaderboard, Array& entries, int32 start = 0, int32 count = 10) ``` -------------------------------- ### Create GPUTexture Instance with FlaxEngine.Object.New Source: https://docs.flaxengine.com/manual/release-notes/0_6/index Demonstrates how to create a new instance of a GPUTexture using the FlaxEngine.Object.New generic method. This is a common pattern for instantiating engine objects. ```csharp FlaxEngine.Object.New(); ``` -------------------------------- ### Get Game Time Since Startup Source: https://docs.flaxengine.com/api/FlaxEngine.Time Retrieves the total time in seconds elapsed since the game started, without considering the TimeScale. This provides a consistent measure of game duration. ```csharp float timeSinceStartup = Time.TimeSinceStartup; ``` -------------------------------- ### MainRenderTask OnBegin Method Source: https://docs.flaxengine.com/api-cpp/MainRenderTask The OnBegin method is called when the task rendering begins. It allows for setup operations before the actual rendering process starts. This method overrides the base SceneRenderTask::OnBegin. ```cpp public virtual void OnBegin(GPUContext* context) override ``` -------------------------------- ### AmbientOcclusionPass setupResources Method (C++) Source: https://docs.flaxengine.com/api-cpp/AmbientOcclusionPass Protected virtual method to set up the necessary resources for Ambient Occlusion rendering. This method overrides the setupResources method from the base class. ```cpp protected virtual bool setupResources() override ``` -------------------------------- ### Get Scene Object ID in Flax Engine Source: https://docs.flaxengine.com/api-cpp/SceneObject Retrieves the unique identifier (Guid) of the object within the current scene. This method is virtual and must be implemented by derived classes. It is a const method. ```cpp public virtual Guid GetSceneObjectId() const = 0 ``` -------------------------------- ### OnPlayBegin and OnPlayBeginning Methods Source: https://docs.flaxengine.com/api/FlaxEditor.Windows.Assets.VisualScriptWindow Methods called when the editor is entering play mode. OnPlayBegin is called upon entering play mode, while OnPlayBeginning is called just before. Both override base class methods. ```csharp public override void OnPlayBegin() ``` ```csharp public override void OnPlayBeginning() ``` -------------------------------- ### Get Non-Empty Layer Names Count Source: https://docs.flaxengine.com/api-cpp/Level Calculates the number of layers that have assigned names, starting from the first layer and trimming any trailing empty layers. This provides a count of actively configured layers. ```csharp public static int32 GetNonEmptyLayerNamesCount() { // Implementation details } ```