Skip to content
SiteEmail

UCohtmlBaseComponent

Inherits from UActorComponent

Inherited by UCohtmlComponent, UCohtmlHUD

Name
typedef TArray< TWeakObjectPtr< UObject > >WeakCohUIHoldersArray
Name
voidSetSoundAttenuation(const FSoundAttenuationSettings & Settings)
virtual voidResize(int32 Width, int32 Height)
virtual voidResizeRenderTarget(int32 Width, int32 Height)
boolIsReadyToCreateView() const
boolIsReadyForBindings() const
boolHasRequestedView() const
voidShowPaintRects(bool bShow)
voidLoad(const FString & Path)
voidReload()
voidDebugSaveNextFrame()
voidBeginDebugFrameSave()
voidEndDebugFrameSave()
voidEnableDelayedUpdate(bool bEnabled)
voidEnableRendering(bool bEnabled)
UCohtmlJSEvent *CreateJSEvent()
voidTriggerJSEvent(const FString & name, UCohtmlJSEvent * eventData) const
voidRegisterForEvent(UPARAM(DisplayName=“UI Event Name”) FString UIEventName, UPARAM(DisplayName=“Event”) FCohtmlJSEventBPCallback Delegate)
voidRegisterForCustomEvent(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)
voidCreateDataModelFromObject(const FString & Name, UObject * Model)
voidRemoveDataModelFromObject(UObject * Model)
voidCreateDataModelFromStruct(const FString & Name, const TFieldPath< FStructProperty > Struct)
voidUpdateWholeDataModelFromStruct(const TFieldPath< FStructProperty > Struct) const
voidRemoveDataModelFromStruct(const TFieldPath< FStructProperty > Struct) const
voidUpdateWholeDataModelFromObject(UObject * Model) const
voidSynchronizeModels() const
voidPreloadTextureSync(const FString & AssetPath)
voidPreloadTextureAsync(const FString & AssetPath)
voidAddPreloadedTexture(UTexture2D * Texture)
boolRemovePreloadedTextureFromPath(const FString & AssetPath)
boolRemovePreloadedTexture(UTexture2D * Texture)
voidRemoveAllPreloadedTextures()
virtual boolEnsureMeshData(ECohtmlComponentMeshInit MeshInitialization =ECohtmlComponentMeshInit::LazyInit)
voidSetCohtmlTickGroup(ECohtmlTickGroup InTickGroup)
virtual~UCohtmlBaseComponent()
virtual voidInitializeComponent() override
virtual voidUninitializeComponent() override
virtual voidBeginDestroy() override
virtual boolIsReadyForFinishDestroy() override
virtual voidFinishDestroy() override
virtual boolGetMeshes(TArray< TWeakObjectPtr< UStaticMeshComponent >> & WeakMeshes) const
virtual voidTickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction * ThisTickFunction) override
cohtml::View *GetView() const
cohtml::ViewRenderer *GetViewRenderer() const
FCohtmlGesturePolicy *GetGesturePolicy()
FCohtmlViewWrapper *GetViewWrapper() const
const FCohtmlCaretRect &GetCaretRect() const
voidSetCaretRect(int x, int y, unsigned width, unsigned height)
virtual uint32GetUserIndex()
virtual uint32GetOwningPlayerID()
voidSetInputFocusToUI()
voidRestoreInputFocusFromUI(bool bForceFocusToGame =false)
cohtml::ECohtmlPageLoadStateGetCurrentPageState() const
voidSetUEViewSettings(const FCohtmlUEViewSettings & InViewSettings)
cohtml::IInputProxy *GetFocusedInput()
DECLARE_FUNCTION(execCreateDataModelFromStruct )
DECLARE_FUNCTION(execUpdateWholeDataModelFromStruct )
DECLARE_FUNCTION(execRemoveDataModelFromStruct )
WeakCohUIHoldersArray::TIteratorGetCohUIHoldersIterator(UWorld * World)
Name
voidCreateView(const cohtml::ViewSettings & Info, const FString & URL)
virtual voidSendRenderDynamicData_Concurrent() override
virtual boolRequiresGameThreadEndOfFrameUpdates() const override
Name
FCohtmlReadyForBindingsReadyForBindings
FCohtmlScriptingReadyScriptingReady
FCohtmlBindingsReleasedBindingsReleased
FCohtmlScriptContextCreatedScriptContextCreated
FCohtmlDOMBuiltDOMBuilt
FCohtmlFinishLoadFinishLoad
FCohtmlLoadFailedLoadFailed
FCohtmlOnNavigateToOnNavigateTo
TArray< TObjectPtr< UTexture2D > >PreloadedTextures
boolbEnableComplexCSSSupport
TObjectPtr< UTextureRenderTarget2D >Texture
TEnumAsByte< enum TextureFilter >Filter
boolbReceiveInput
boolbDelayedUpdate
boolbExecuteCommandProcessingWithLayout
boolbUseSurfacePartitioning
boolbRunAdvanceConcurrently
TEnumAsByte< ECohtmlTickGroup >TickGroup
TArray< FCohtmlMeshData >MeshData
TArray< CohtmlDelegateFunctorWrapper >JSEventCallbackWrappers
EMouseCursor::TypeCurrentMouseCursor
Name
FCohtmlUEViewSettingsUEViewSettings
Name
classTCohtmlViewListener< UCohtmlBaseComponent >
typedef TArray<TWeakObjectPtr<UObject> > UCohtmlBaseComponent::WeakCohUIHoldersArray;
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.

virtual void Resize(
int32 Width,
int32 Height
)

Reimplemented by: UCohtmlComponent::Resize, UCohtmlHUD::Resize

Resizes the View

virtual void ResizeRenderTarget(
int32 Width,
int32 Height
)

Resizes the texture where the View is drawn

bool IsReadyToCreateView() const

Tells if the View is ready to be created

bool IsReadyForBindings() const

Tells if the View is ready for binding operations

bool HasRequestedView() const

Tells if a View has been scheduled for creation

void ShowPaintRects(
bool bShow
)

Tells the view to show/hide debug paint rectangles

void Load(
const FString & Path
)

Requests a new URL to be loaded in the View

void Reload()

Requests the View to reload the current URL

void DebugSaveNextFrame()

Saves next render frame to disk

void BeginDebugFrameSave()

Starts saving render frames to disk

void EndDebugFrameSave()

Stops saving render frames to disk

void EnableDelayedUpdate(
bool bEnabled
)

Delays UI updates until after cameras are updated. Read the section in the FAQ page of the documentation before using

void EnableRendering(
bool bEnabled
)

DEPRECATED: This is now controlled internally and will be removed in a few releases. Used to enable or disable the recording of rendering commands for the view.

UCohtmlJSEvent * CreateJSEvent()

Creates a UI event data that can be used when triggering event in scripting

void TriggerJSEvent(
const FString & name,
UCohtmlJSEvent * eventData
) const

Trigger a Gameface UI Event

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.

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.
void CreateDataModelFromObject(
const FString & Name,
UObject * Model
)

Creates a global variable (data model) in scripting from an UObject

void RemoveDataModelFromObject(
UObject * Model
)

Removes a global variable (data model) in scripting from a UObject

void CreateDataModelFromStruct(
const FString & Name,
const TFieldPath< FStructProperty > Struct
)

Creates a global variable (data model) in scripting from a UStruct

void UpdateWholeDataModelFromStruct(
const TFieldPath< FStructProperty > Struct
) const

Marks 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).

void RemoveDataModelFromStruct(
const TFieldPath< FStructProperty > Struct
) const

Removes a global variable (data model) in scripting from a UStruct

void UpdateWholeDataModelFromObject(
UObject * Model
) const

Marks 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).

void SynchronizeModels() const

Synchronize all models marked for update.

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.

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.

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.

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 CohtmlBaseComponent, PreloadedTextures collection will be cleared automatically, so calling this method isn’t mandatory.

bool RemovePreloadedTexture(
UTexture2D * Texture
)

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 CohtmlBaseComponent, PreloadedTextures collection will be cleared automatically, so calling this method isn’t mandatory.

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 CohtmlBaseComponent, PreloadedTextures collection will be cleared automatically, so calling this method isn’t mandatory.

virtual bool EnsureMeshData(
ECohtmlComponentMeshInit MeshInitialization =ECohtmlComponentMeshInit::LazyInit
)

Used for specifying when the mesh needs to be ready to receive input. If left unspecified, the mesh will be loaded lazily, which means it will take between 2-4 frames for the render thread to have it available. If set to “Immediate”, the render state will be flagged as dirty and the mesh will be loaded either on the same frame or at most the next. Note: Call manually right after a component’s creation to guarantee that all input will be handled in the first frames.

void SetCohtmlTickGroup(
ECohtmlTickGroup InTickGroup
)

Use this over the native UActorComponent::SetTickGroup during runtime to change the TickGroup. This method will essentially do the same, but also perform extra plugin-related checks, updates, etc.

virtual ~UCohtmlBaseComponent()
virtual void InitializeComponent() override

Reimplemented by: UCohtmlComponent::InitializeComponent, UCohtmlHUD::InitializeComponent

virtual void UninitializeComponent() override
virtual void BeginDestroy() override
virtual bool IsReadyForFinishDestroy() override
virtual void FinishDestroy() override
virtual bool GetMeshes(
TArray< TWeakObjectPtr< UStaticMeshComponent >> & WeakMeshes
) const

Reimplemented by: UCohtmlComponent::GetMeshes

virtual void TickComponent(
float DeltaTime,
enum ELevelTick TickType,
FActorComponentTickFunction * ThisTickFunction
) override

Reimplemented by: UCohtmlComponent::TickComponent, UCohtmlHUD::TickComponent

cohtml::View * GetView() const
cohtml::ViewRenderer * GetViewRenderer() const
FCohtmlGesturePolicy * GetGesturePolicy()
inline FCohtmlViewWrapper * GetViewWrapper() const
const FCohtmlCaretRect & GetCaretRect() const
void SetCaretRect(
int x,
int y,
unsigned width,
unsigned height
)
inline virtual uint32 GetUserIndex()

Reimplemented by: UCohtmlComponent::GetUserIndex, UCohtmlHUD::GetUserIndex

inline virtual uint32 GetOwningPlayerID()

Reimplemented by: UCohtmlHUD::GetOwningPlayerID

void SetInputFocusToUI()
void RestoreInputFocusFromUI(
bool bForceFocusToGame =false
)
cohtml::ECohtmlPageLoadState GetCurrentPageState() const
void SetUEViewSettings(
const FCohtmlUEViewSettings & InViewSettings
)
cohtml::IInputProxy * GetFocusedInput()
DECLARE_FUNCTION(
execCreateDataModelFromStruct
)
DECLARE_FUNCTION(
execUpdateWholeDataModelFromStruct
)
DECLARE_FUNCTION(
execRemoveDataModelFromStruct
)
static WeakCohUIHoldersArray::TIterator GetCohUIHoldersIterator(
UWorld * World
)
void CreateView(
const cohtml::ViewSettings & Info,
const FString & URL
)
virtual void SendRenderDynamicData_Concurrent() override

function RequiresGameThreadEndOfFrameUpdates

Section titled “function RequiresGameThreadEndOfFrameUpdates”
inline virtual bool RequiresGameThreadEndOfFrameUpdates() const override
FCohtmlReadyForBindings ReadyForBindings;

Fired when the View is ready for binding events. Any event bound prior to this will be ignored

FCohtmlScriptingReady ScriptingReady;

Fired when the View’s document is fully loaded and the “ready for bindings” event has completed

FCohtmlBindingsReleased BindingsReleased;

Fired when the View has released its bindings.

FCohtmlScriptContextCreated ScriptContextCreated;

Called immediately after the View’s script context has been created for the page. This happens before starting to build the DOM. You can execute any scripts that will influence DOM creation here.

FCohtmlDOMBuilt DOMBuilt;

Called when the View’s DOM for the pages is fully constructed, but the referenced resources may not finish loading.

FCohtmlFinishLoad FinishLoad;

Called when a View’s navigation change request failed.

FCohtmlLoadFailed LoadFailed;

Called when the View’s page, including the resources it refers to, is completely loaded and initialized.

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.

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.

bool bEnableComplexCSSSupport;

Whether to enable support for complex CSS selectors (e.g. div > p, div ~ p)

TObjectPtr< UTextureRenderTarget2D > Texture;

Gives access to the UI Texture

TEnumAsByte< enum TextureFilter > Filter;
bool bReceiveInput;

Indicates whether input is forwarded to this view

bool bDelayedUpdate;

Changes this component’s tick group to TG_PostUpdateWork and sends bindings before drawing. For more information refer to the FAQ section of the documentation.

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.

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.

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.

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.

TArray< FCohtmlMeshData > MeshData;
TArray< CohtmlDelegateFunctorWrapper > JSEventCallbackWrappers;
EMouseCursor::Type CurrentMouseCursor;
FCohtmlUEViewSettings UEViewSettings;

friend TCohtmlViewListener< UCohtmlBaseComponent >

Section titled “friend TCohtmlViewListener< UCohtmlBaseComponent >”
friend class TCohtmlViewListener< UCohtmlBaseComponent >;