UCohtmlWidget
#include <CohtmlWidget.h>
Inherits from UWidget
Public Types
Section titled “Public Types”| Name | |
|---|---|
| typedef TArray< TWeakObjectPtr< UObject > > | WeakCohUIHoldersArray |
Public Functions
Section titled “Public Functions”| Name | |
|---|---|
| virtual | ~UCohtmlWidget() |
| virtual void | ReleaseSlateResources(bool bReleaseChildren) override |
| virtual TSharedRef< SWidget > | RebuildWidget() override |
| virtual void | SynchronizeProperties() override |
| virtual TSharedPtr< SCohtmlWidget > | CreateSCohtmlWidget() |
| void | Tick(float DeltaTime) |
| TSharedPtr< SCohtmlWidget > | GetCoherentWidget() |
| FORCEINLINE bool | NeedToPaint() const |
| cohtml::IInputProxy * | GetFocusedInput() |
| void | SetSoundAttenuation(const FSoundAttenuationSettings & Settings) |
| void | SetInputPropagationBehaviour(ECohtmlInputPropagationBehaviour::Type Propagation) |
| ECohtmlInputPropagationBehaviour::Type | GetInputPropagationBehaviour() const |
| bool | IsReadyToCreateView() const |
| bool | IsReadyForBindings() const |
| bool | HasRequestedView() const |
| void | ShowPaintRects(bool bShow) |
| void | Load(const FString & Path) |
| void | Reload() |
| void | DebugSaveNextFrame() |
| void | BeginDebugFrameSave() |
| void | EndDebugFrameSave() |
| UTextureRenderTarget2D * | GetRenderTexture() const |
| UCohtmlJSEvent * | CreateJSEvent() |
| void | TriggerJSEvent(const FString & name, UCohtmlJSEvent * eventData) const |
| void | RegisterForEvent(UPARAM(DisplayName=“UI Event Name”) FString UIEventName, UPARAM(DisplayName=“Event”) FCohtmlJSEventBPCallback Delegate) |
| void | RegisterForCustomEvent(UPARAM(DisplayName=“UI Event Name”) const FString & UIEventName, UPARAM(DisplayName=“Custom Event node Owner”) UObject * CustomEventOwner, UPARAM(DisplayName=“Custom Event node Name”) const FString & CustomEventNodeName) |
| void | CreateDataModelFromObject(const FString & Name, UObject * Model) |
| void | RemoveDataModelFromObject(UObject * Model) |
| void | CreateDataModelFromStruct(const FString & Name, const TFieldPath< FStructProperty > Struct) |
| void | UpdateWholeDataModelFromStruct(const TFieldPath< FStructProperty > Struct) const |
| void | RemoveDataModelFromStruct(const TFieldPath< FStructProperty > Struct) const |
| void | UpdateWholeDataModelFromObject(UObject * Model) const |
| void | SynchronizeModels() const |
| void | PreloadTextureSync(const FString & AssetPath) |
| void | PreloadTextureAsync(const FString & AssetPath) |
| void | AddPreloadedTexture(UTexture2D * Texture) |
| bool | RemovePreloadedTextureFromPath(const FString & AssetPath) |
| bool | RemovePreloadedTexture(UTexture2D * Texture) |
| void | RemoveAllPreloadedTextures() |
| DECLARE_FUNCTION(execCreateDataModelFromStruct ) | |
| DECLARE_FUNCTION(execUpdateWholeDataModelFromStruct ) | |
| DECLARE_FUNCTION(execRemoveDataModelFromStruct ) | |
| cohtml::View * | GetView() const |
| virtual void | BeginDestroy() override |
| virtual bool | IsReadyForFinishDestroy() override |
| virtual void | FinishDestroy() override |
| uint32 | GetUserIndex() |
| uint32 | GetOwningPlayerID() |
| void | SetInputFocusToUI() |
| void | RestoreInputFocusFromUI(bool bForceFocusToGame =false) |
| void | UpdateLastSavedViewSettings(cohtml::ViewSettings & NewSettings) |
| FCohtmlCaretRect | GetCaretRect() const |
| void | SetCaretRect(int x, int y, unsigned width, unsigned height) |
| cohtml::ECohtmlPageLoadState | GetCurrentPageState() const |
| TSharedPtr< TCohtmlViewListener< UCohtmlWidget > > | GetViewListener() |
| WeakCohUIHoldersArray::TIterator | GetCohUIHoldersIterator(UWorld * World) |
Public Attributes
Section titled “Public Attributes”| Name | |
|---|---|
| bool | bResetSWidget |
| TObjectPtr< AActor > | Owner |
| FCohtmlWidgetTickFunction | WidgetTick |
| FCohtmlReadyForBindings | ReadyForBindings |
| FCohtmlScriptingReady | ScriptingReady |
| FCohtmlBindingsReleased | BindingsReleased |
| FCohtmlScriptContextCreated | ScriptContextCreated |
| FCohtmlDOMBuilt | DOMBuilt |
| FCohtmlFinishLoad | FinishLoad |
| FCohtmlLoadFailed | LoadFailed |
| FCohtmlOnNavigateTo | OnNavigateTo |
| bool | bEnableComplexCSSSupport |
| TEnumAsByte< enum TextureFilter > | Filter |
| bool | bReceiveInput |
| TEnumAsByte< ECohtmlInputPropagationBehaviour::Type > | InputPropagationBehaviour |
| ECohtmlMultiTouchEventsHandling | MultiTouchEventsHandling |
| bool | bExecuteCommandProcessingWithLayout |
| bool | bUseSurfacePartitioning |
| bool | bRunAdvanceConcurrently |
| TEnumAsByte< ECohtmlTickGroup > | TickGroup |
| TArray< TObjectPtr< UTexture2D > > | PreloadedTextures |
| TArray< CohtmlDelegateFunctorWrapper > | JSEventCallbackWrappers |
| FString | URL |
Protected Attributes
Section titled “Protected Attributes”| Name | |
|---|---|
| TSharedPtr< SCohtmlWidget > | CoherentWidget |
Friends
Section titled “Friends”| Name | |
|---|---|
| class | TCohtmlViewListener< UCohtmlWidget > |
Detailed Description
Section titled “Detailed Description”class UCohtmlWidget;A HTML5 control powered by Gameface.
Public Types Documentation
Section titled “Public Types Documentation”typedef WeakCohUIHoldersArray
Section titled “typedef WeakCohUIHoldersArray”typedef TArray<TWeakObjectPtr<UObject> > UCohtmlWidget::WeakCohUIHoldersArray;Public Functions Documentation
Section titled “Public Functions Documentation”function ~UCohtmlWidget
Section titled “function ~UCohtmlWidget”virtual ~UCohtmlWidget()function ReleaseSlateResources
Section titled “function ReleaseSlateResources”virtual void ReleaseSlateResources( bool bReleaseChildren) overridefunction RebuildWidget
Section titled “function RebuildWidget”virtual TSharedRef< SWidget > RebuildWidget() overridefunction SynchronizeProperties
Section titled “function SynchronizeProperties”virtual void SynchronizeProperties() overridefunction CreateSCohtmlWidget
Section titled “function CreateSCohtmlWidget”virtual TSharedPtr< SCohtmlWidget > CreateSCohtmlWidget()function Tick
Section titled “function Tick”void Tick( float DeltaTime)function GetCoherentWidget
Section titled “function GetCoherentWidget”TSharedPtr< SCohtmlWidget > GetCoherentWidget()function NeedToPaint
Section titled “function NeedToPaint”inline FORCEINLINE bool NeedToPaint() constfunction GetFocusedInput
Section titled “function GetFocusedInput”cohtml::IInputProxy * GetFocusedInput()function SetSoundAttenuation
Section titled “function SetSoundAttenuation”void SetSoundAttenuation( const FSoundAttenuationSettings & Settings)Sets the AttenuationSettings for the Sound Components Note: Sound is 2D by default. It can be changed to 3D if appropriate AttenuationSettings is set. For more details look at Unreal’s documentation for AttenuationSettings.
function SetInputPropagationBehaviour
Section titled “function SetInputPropagationBehaviour”void SetInputPropagationBehaviour( ECohtmlInputPropagationBehaviour::Type Propagation)Sets the type of input that the widget will propagate to the game
function GetInputPropagationBehaviour
Section titled “function GetInputPropagationBehaviour”ECohtmlInputPropagationBehaviour::Type GetInputPropagationBehaviour() constGets the type of input that the widget will propagate to the game
function IsReadyToCreateView
Section titled “function IsReadyToCreateView”bool IsReadyToCreateView() constTells if the View is ready to be created
function IsReadyForBindings
Section titled “function IsReadyForBindings”bool IsReadyForBindings() constTells if the View is ready for binding operations
function HasRequestedView
Section titled “function HasRequestedView”bool HasRequestedView() constTells if a View has been scheduled for creation
function ShowPaintRects
Section titled “function ShowPaintRects”void ShowPaintRects( bool bShow)Tells the view to show/hide debug paint rectangles
function Load
Section titled “function Load”void Load( const FString & Path)Requests a new URL to be loaded in the View
function Reload
Section titled “function Reload”void Reload()Requests the View to reload the current URL
function DebugSaveNextFrame
Section titled “function DebugSaveNextFrame”void DebugSaveNextFrame()Saves next render frame to disk
function BeginDebugFrameSave
Section titled “function BeginDebugFrameSave”void BeginDebugFrameSave()Starts saving render frames to disk
function EndDebugFrameSave
Section titled “function EndDebugFrameSave”void EndDebugFrameSave()Stops saving render frames to disk
function GetRenderTexture
Section titled “function GetRenderTexture”UTextureRenderTarget2D * GetRenderTexture() constGives access to the UI Texture
function CreateJSEvent
Section titled “function CreateJSEvent”UCohtmlJSEvent * CreateJSEvent()Creates a UI event data that can be used when triggering event in scripting
function TriggerJSEvent
Section titled “function TriggerJSEvent”void TriggerJSEvent( const FString & name, UCohtmlJSEvent * eventData) constfunction RegisterForEvent
Section titled “function RegisterForEvent”void RegisterForEvent( UPARAM(DisplayName="UI Event Name") FString UIEventName, UPARAM(DisplayName="Event") FCohtmlJSEventBPCallback Delegate)You can use this to bind a Blueprint event to an arbitrary scripting event. The Blueprint event must have no parameters. DEPRECATED: This will be removed in future releases in favor of the new RegisterForEvent which works with any Custom Event nodes.
function RegisterForCustomEvent
Section titled “function RegisterForCustomEvent”void RegisterForCustomEvent( UPARAM(DisplayName="UI Event Name") const FString & UIEventName, UPARAM(DisplayName="Custom Event node Owner") UObject * CustomEventOwner, UPARAM(DisplayName="Custom Event node Name") const FString & CustomEventNodeName)You can use this to tie a Blueprint Custom Event node to an arbitrary View scripting event.
- Your Blueprint Custom Event node can have any number of parameters as long as they are primitive types, FString, FText, or FName.
- You don’t have to connect the Blueprint Custom Event node itself to anything, the View itself will execute it.
function CreateDataModelFromObject
Section titled “function CreateDataModelFromObject”void CreateDataModelFromObject( const FString & Name, UObject * Model)Creates a global variable (data model) in scripting from an UObject
function RemoveDataModelFromObject
Section titled “function RemoveDataModelFromObject”void RemoveDataModelFromObject( UObject * Model)Removes a global variable (data model) in scripting from a UObject
function CreateDataModelFromStruct
Section titled “function CreateDataModelFromStruct”void CreateDataModelFromStruct( const FString & Name, const TFieldPath< FStructProperty > Struct)Creates a global variable (data model) in scripting from a UStruct
function UpdateWholeDataModelFromStruct
Section titled “function UpdateWholeDataModelFromStruct”void UpdateWholeDataModelFromStruct( const TFieldPath< FStructProperty > Struct) constMarks a Struct model for update. The UI using this data model will be updated during the next call to SynchronizeModels. For optimum performance, call SynchronizeModels as rarely as possible (e.g. once per frame).
function RemoveDataModelFromStruct
Section titled “function RemoveDataModelFromStruct”void RemoveDataModelFromStruct( const TFieldPath< FStructProperty > Struct) constRemoves a global variable (data model) in scripting from a UStruct
function UpdateWholeDataModelFromObject
Section titled “function UpdateWholeDataModelFromObject”void UpdateWholeDataModelFromObject( UObject * Model) constMarks an Object model for update. The UI using this data model will be updated during the next call to SynchronizeModels. For optimum performance, call SynchronizeModels as rarely as possible (e.g. once per frame).
function SynchronizeModels
Section titled “function SynchronizeModels”void SynchronizeModels() constSynchronize all models marked for update.
function PreloadTextureSync
Section titled “function PreloadTextureSync”void PreloadTextureSync( const FString & AssetPath)Loads a Texture Synchronously (BLOCKING the main thread) from asset Path. Once loaded, the Texture will be added to the PreloadedTextures collection. This is useful for ensuring that the requests for UE4 textures will be working over already loaded assets, leading to fast response times.
function PreloadTextureAsync
Section titled “function PreloadTextureAsync”void PreloadTextureAsync( const FString & AssetPath)Loads a Texture Asynchronously from asset Path. Once loaded, the Texture will be added to the PreloadedTextures collection. This is useful for ensuring that the requests for UE4 textures will be working over already loaded assets, leading to fast response times.
function AddPreloadedTexture
Section titled “function AddPreloadedTexture”void AddPreloadedTexture( UTexture2D * Texture)Adds an already loaded Texture to the PreloadedTextures collection. This is useful for ensuring that the requests for UE4 textures will be working over already loaded assets, leading to fast response times.
function RemovePreloadedTextureFromPath
Section titled “function RemovePreloadedTextureFromPath”bool RemovePreloadedTextureFromPath( const FString & AssetPath)Removes a Texture from the PreloadedTextures collection. This can be used when you no longer need a specific texture inside the collection to be kept loaded, for example after changing URL and View is fully loaded. Note: The removal of elements is an operation with linear complexity, consider using RemoveAllPreloadedTextures instead. Note: Upon destruction of the CohtmlWidget, PreloadedTextures collection will be cleared automatically, so calling this method isn’t mandatory.
function RemovePreloadedTexture
Section titled “function RemovePreloadedTexture”bool RemovePreloadedTexture( UTexture2D * Texture)Removes all Textures from the PreloadedTextures collection. This can be used when you no longer need any of the textures inside the collection to be kept loaded, for example after changing URL and View is fully loaded. Note: The removal of elements is an operation with linear complexity, consider using RemoveAllPreloadedTextures instead. Note: Upon destruction of the CohtmlWidget, PreloadedTextures collection will be cleared automatically, so calling this method isn’t mandatory.
function RemoveAllPreloadedTextures
Section titled “function RemoveAllPreloadedTextures”void RemoveAllPreloadedTextures()Removes all Textures from the PreloadedTextures collection. This can be used when you no longer need any of the textures inside the collection to be kept loaded, for example after changing URL and View is fully loaded. Note: Upon destruction of the CohtmlWidget, PreloadedTextures collection will be cleared automatically, so calling this method isn’t mandatory.
function DECLARE_FUNCTION
Section titled “function DECLARE_FUNCTION”DECLARE_FUNCTION( execCreateDataModelFromStruct)function DECLARE_FUNCTION
Section titled “function DECLARE_FUNCTION”DECLARE_FUNCTION( execUpdateWholeDataModelFromStruct)function DECLARE_FUNCTION
Section titled “function DECLARE_FUNCTION”DECLARE_FUNCTION( execRemoveDataModelFromStruct)function GetView
Section titled “function GetView”cohtml::View * GetView() constfunction BeginDestroy
Section titled “function BeginDestroy”virtual void BeginDestroy() overridefunction IsReadyForFinishDestroy
Section titled “function IsReadyForFinishDestroy”virtual bool IsReadyForFinishDestroy() overridefunction FinishDestroy
Section titled “function FinishDestroy”virtual void FinishDestroy() overridefunction GetUserIndex
Section titled “function GetUserIndex”uint32 GetUserIndex()function GetOwningPlayerID
Section titled “function GetOwningPlayerID”uint32 GetOwningPlayerID()function SetInputFocusToUI
Section titled “function SetInputFocusToUI”void SetInputFocusToUI()function RestoreInputFocusFromUI
Section titled “function RestoreInputFocusFromUI”void RestoreInputFocusFromUI( bool bForceFocusToGame =false)function UpdateLastSavedViewSettings
Section titled “function UpdateLastSavedViewSettings”void UpdateLastSavedViewSettings( cohtml::ViewSettings & NewSettings)function GetCaretRect
Section titled “function GetCaretRect”FCohtmlCaretRect GetCaretRect() constfunction SetCaretRect
Section titled “function SetCaretRect”void SetCaretRect( int x, int y, unsigned width, unsigned height)function GetCurrentPageState
Section titled “function GetCurrentPageState”cohtml::ECohtmlPageLoadState GetCurrentPageState() constfunction GetViewListener
Section titled “function GetViewListener”inline TSharedPtr< TCohtmlViewListener< UCohtmlWidget > > GetViewListener()function GetCohUIHoldersIterator
Section titled “function GetCohUIHoldersIterator”static WeakCohUIHoldersArray::TIterator GetCohUIHoldersIterator( UWorld * World)Public Attributes Documentation
Section titled “Public Attributes Documentation”variable bResetSWidget
Section titled “variable bResetSWidget”bool bResetSWidget;If you intend to keep the UWidget alive between level transitions and you want to keep the View alive you should set this to false.
variable Owner
Section titled “variable Owner”TObjectPtr< AActor > Owner;Gets or sets the Actor containing any LiveViewComponents.
variable WidgetTick
Section titled “variable WidgetTick”FCohtmlWidgetTickFunction WidgetTick;Main tick function for the Widget
variable ReadyForBindings
Section titled “variable ReadyForBindings”FCohtmlReadyForBindings ReadyForBindings;Fired when the View is ready for binding events. Any event bound prior to this will be ignored
variable ScriptingReady
Section titled “variable ScriptingReady”FCohtmlScriptingReady ScriptingReady;Fired when the View’s document is fully loaded and the “ready for bindings” event has completed
variable BindingsReleased
Section titled “variable BindingsReleased”FCohtmlBindingsReleased BindingsReleased;Fired when the View has released its bindings
variable ScriptContextCreated
Section titled “variable ScriptContextCreated”FCohtmlScriptContextCreated ScriptContextCreated;Called immediately after the View’s script context has been created for the page. This happens before starting to build the DOM.
variable DOMBuilt
Section titled “variable DOMBuilt”FCohtmlDOMBuilt DOMBuilt;Called when the View’s DOM for the pages is fully constructed, but the referenced resources may not finish loading.
variable FinishLoad
Section titled “variable FinishLoad”FCohtmlFinishLoad FinishLoad;Called when a View’s navigation change request failed.
variable LoadFailed
Section titled “variable LoadFailed”FCohtmlLoadFailed LoadFailed;Called when the View’s page, including the resources it refers to, is completely loaded and initialized.
variable OnNavigateTo
Section titled “variable OnNavigateTo”FCohtmlOnNavigateTo OnNavigateTo;Called whenever the View is about to navigate to a different URL. You can return false to stop the navigation to the URL.
variable bEnableComplexCSSSupport
Section titled “variable bEnableComplexCSSSupport”bool bEnableComplexCSSSupport;Whether to enable support for complex CSS selectors (e.g. div > p, div ~ p)
variable Filter
Section titled “variable Filter”TEnumAsByte< enum TextureFilter > Filter;variable bReceiveInput
Section titled “variable bReceiveInput”bool bReceiveInput;Indicates whether input is forwarded to this view
variable InputPropagationBehaviour
Section titled “variable InputPropagationBehaviour”TEnumAsByte< ECohtmlInputPropagationBehaviour::Type > InputPropagationBehaviour;Indicates the type of input this view forwards to the game
variable MultiTouchEventsHandling
Section titled “variable MultiTouchEventsHandling”ECohtmlMultiTouchEventsHandling MultiTouchEventsHandling;Indicates whether Touch events (Touch Down, Touch Move and Touch Up) should be gathered and handled by the UI together at the end of the Input frame or separately - one by one. Please note that Multi Touch events handling will have a side effect on the input propagation as we can no longer check whether the UI handles every single touch or not, because events are processed later in bulk.
variable bExecuteCommandProcessingWithLayout
Section titled “variable bExecuteCommandProcessingWithLayout”bool bExecuteCommandProcessingWithLayout;Tells the View to process all collected front-end commands right after the layout execution on the same thread. Note: This option is mandatory when using the Custom Effects and/or the Compositor API features. Note: When this setting is enabled, the rendering library will be used on two different threads: the Game Thread and the Render Thread. Normally the library will detect that but if you have a use case where Game Thread and Rendering tasks are to be executed on the same thread, you’ll have to enable the multithreaded awareness manually by setting LibraryParams::AllowMultithreadedCommandProcessing in the Coherent Rendering plugin to true.
variable bUseSurfacePartitioning
Section titled “variable bUseSurfacePartitioning”bool bUseSurfacePartitioning;Enables the Surface Partitioning mode, which does not create a texture for your view, but instead draws separate parts of the HTML in separate small textures. Useful when you have a view with a high resolution that is mostly empty, apart from some content in the corners of the screen that you can draw separately, omitting the big screen texture that you would have otherwise.
variable bRunAdvanceConcurrently
Section titled “variable bRunAdvanceConcurrently”bool bRunAdvanceConcurrently;When enabled, forces cohtml::View::Advance to be scheduled on background tasks, reducing the load on the game thread. This imposes restrictions on what View operations can be performed on the Game Thread. Please see the documentation for more details.
variable TickGroup
Section titled “variable TickGroup”TEnumAsByte< ECohtmlTickGroup > TickGroup;Sets the tick group in which this component will be ticked and Advance the View. If set to “No tick”, this component will not tick on its own. You are expected to call its Tick function manually from your own code. Useful if you want to control the exact time at which to Advance the View.
variable PreloadedTextures
Section titled “variable PreloadedTextures”TArray< TObjectPtr< UTexture2D > > PreloadedTextures;PreloadedTextures collection, keeping the Textures loaded and ready for use. Ideally, the Textures are to be loaded ahead of time and kept in this collection for ensuring that the requests for UE4 textures will be working over already loaded assets, leading to fast response times.
variable JSEventCallbackWrappers
Section titled “variable JSEventCallbackWrappers”TArray< CohtmlDelegateFunctorWrapper > JSEventCallbackWrappers;variable URL
Section titled “variable URL”FString URL;The URL to load when the View is created
Protected Attributes Documentation
Section titled “Protected Attributes Documentation”variable CoherentWidget
Section titled “variable CoherentWidget”TSharedPtr< SCohtmlWidget > CoherentWidget;Friends
Section titled “Friends”friend TCohtmlViewListener< UCohtmlWidget >
Section titled “friend TCohtmlViewListener< UCohtmlWidget >”friend class TCohtmlViewListener< UCohtmlWidget >;© 2026 Coherent Labs. All rights reserved.