engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 静态 Public 成员函数 | 所有成员列表
UCanvas类 参考

A drawing canvas. 更多...

#include <Canvas.h>

+ 类 UCanvas 继承关系图:

Public 成员函数

virtual void BeginDestroy () override
 Called before destroying the object. 更多...
 
FFontRenderInfo CreateFontRenderInfo (bool bClipText=false, bool bEnableShadow=false, FLinearColor GlowColor=FLinearColor(), FVector2D GlowOuterRadius=FVector2D(), FVector2D GlowInnerRadius=FVector2D())
 constructor for FontRenderInfo
 
void Deproject (FVector2D ScreenPos, FVector &WorldOrigin, FVector &WorldDirection) const
 Transforms 2D screen coordinates into a 3D world-space origin and direction. 更多...
 
virtual void DrawDebugGraph (const FString &Title, float ValueX, float ValueY, float UL_X, float UL_Y, float W, float H, FVector2D RangeX, FVector2D RangeY)
 Draws a graph comparing 2 variables. 更多...
 
void DrawIcon (FCanvasIcon Icon, float X, float Y, float Scale=0.f)
 Draw a CanvasIcon at the desired canvas position. 更多...
 
void DrawItem (FCanvasItem &Item)
 Draw a CanvasItem 更多...
 
void DrawItem (FCanvasItem &Item, const FVector2D &InPosition)
 Draw a CanvasItem at the given coordinates 更多...
 
void DrawItem (FCanvasItem &Item, float X, float Y)
 Draw a CanvasItem at the given coordinates 更多...
 
void DrawScaledIcon (FCanvasIcon Icon, float X, float Y, FVector Scale)
 Draw a scaled CanvasIcon at the desired canvas position.
 
float DrawText (const UFont *InFont, const FString &InText, float X, float Y, float XScale=1.f, float YScale=1.f, const FFontRenderInfo &RenderInfo=FFontRenderInfo())
 Draws a string of text to the screen. 更多...
 
void DrawTile (UTexture *Tex, float X, float Y, float XL, float YL, float U, float V, float UL, float VL, EBlendMode BlendMode=BLEND_Translucent)
 Draw arbitrary aligned rectangle. 更多...
 
void GetCenter (float &outX, float &outY) const
 Return X,Y for center of the draw region.
 
float GetDPIScale () const
 
TWeakObjectPtr< class UReporterGraph > GetReporterGraph ()
 Creates if necessary and returns ReporterGraph instance for 2d graph canvas drawing
 
void Init (int32 InSizeX, int32 InSizeY, FSceneView *InSceneView, FCanvas *InCanvas)
 Initializes the canvas.
 
void K2_Deproject (FVector2D ScreenPosition, FVector &WorldOrigin, FVector &WorldDirection)
 Performs a deprojection of a screen space coordinate using the projection matrix set up for the Canvas. 更多...
 
void K2_DrawBorder (UTexture *BorderTexture, UTexture *BackgroundTexture, UTexture *LeftBorderTexture, UTexture *RightBorderTexture, UTexture *TopBorderTexture, UTexture *BottomBorderTexture, FVector2D ScreenPosition, FVector2D ScreenSize, FVector2D CoordinatePosition, FVector2D CoordinateSize=FVector2D::UnitVector, FLinearColor RenderColor=FLinearColor::White, FVector2D BorderScale=FVector2D(0.1f, 0.1f), FVector2D BackgroundScale=FVector2D(0.1f, 0.1f), float Rotation=0.0f, FVector2D PivotPoint=FVector2D(0.5f, 0.5f), FVector2D CornerSize=FVector2D::ZeroVector)
 Draws a 3x3 grid border with tiled frame and tiled interior on the Canvas. 更多...
 
void K2_DrawBox (FVector2D ScreenPosition, FVector2D ScreenSize, float Thickness=1.0f, FLinearColor RenderColor=FLinearColor::White)
 Draws an unfilled box on the Canvas. 更多...
 
void K2_DrawLine (FVector2D ScreenPositionA=FVector2D::ZeroVector, FVector2D ScreenPositionB=FVector2D::ZeroVector, float Thickness=1.0f, FLinearColor RenderColor=FLinearColor::White)
 Draws a line on the Canvas. 更多...
 
void K2_DrawMaterial (UMaterialInterface *RenderMaterial, FVector2D ScreenPosition, FVector2D ScreenSize, FVector2D CoordinatePosition, FVector2D CoordinateSize=FVector2D::UnitVector, float Rotation=0.f, FVector2D PivotPoint=FVector2D(0.5f, 0.5f))
 Draws a material on the Canvas. 更多...
 
void K2_DrawMaterialTriangle (UMaterialInterface *RenderMaterial, TArray< FCanvasUVTri > Triangles)
 Draws a set of triangles on the Canvas. 更多...
 
void K2_DrawPolygon (UTexture *RenderTexture, FVector2D ScreenPosition, FVector2D Radius=FVector2D::UnitVector, int32 NumberOfSides=3, FLinearColor RenderColor=FLinearColor::White)
 Draws a polygon on the Canvas. 更多...
 
void K2_DrawText (UFont *RenderFont, const FString &RenderText, FVector2D ScreenPosition, FVector2D Scale=FVector2D(1.0f, 1.0f), FLinearColor RenderColor=FLinearColor::White, float Kerning=0.0f, FLinearColor ShadowColor=FLinearColor::Black, FVector2D ShadowOffset=FVector2D::UnitVector, bool bCentreX=false, bool bCentreY=false, bool bOutlined=false, FLinearColor OutlineColor=FLinearColor::Black)
 Draws text on the Canvas. 更多...
 
void K2_DrawTexture (UTexture *RenderTexture, FVector2D ScreenPosition, FVector2D ScreenSize, FVector2D CoordinatePosition, FVector2D CoordinateSize=FVector2D::UnitVector, FLinearColor RenderColor=FLinearColor::White, EBlendMode BlendMode=BLEND_Translucent, float Rotation=0.f, FVector2D PivotPoint=FVector2D(0.5f, 0.5f))
 Draws a texture on the Canvas. 更多...
 
void K2_DrawTriangle (UTexture *RenderTexture, TArray< FCanvasUVTri > Triangles)
 Draws a set of triangles on the Canvas. 更多...
 
FVector K2_Project (FVector WorldLocation)
 Performs a projection of a world space coordinates using the projection matrix set up for the Canvas. 更多...
 
FVector2D K2_StrLen (UFont *RenderFont, const FString &RenderText)
 Returns the wrapped text size in screen space coordinates. 更多...
 
FVector2D K2_TextSize (UFont *RenderFont, const FString &RenderText, FVector2D Scale=FVector2D::UnitVector)
 Returns the clipped text size in screen space coordinates. 更多...
 
FVector Project (FVector Location) const
 Transforms a 3D world-space vector into 2D screen coordinates. 更多...
 
virtual void Reset (bool bKeepOrigin=false)
 reset canvas parameters, optionally do not change the origin
 
void SetClip (float X, float Y)
 Sets the position of the lower-left corner of the clipping region of the Canvas
 
void SetDrawColor (FColor const &C)
 Set draw color. 更多...
 
void SetDrawColor (uint8 R, uint8 G, uint8 B, uint8 A=255)
 Set draw color. 更多...
 
void SetLinearDrawColor (FLinearColor InColor, float OpacityOverride=-1.f)
 Set DrawColor with a FLinearColor and optional opacity override
 
void SetView (FSceneView *InView)
 Changes the view for the canvas.
 
void StrLen (const UFont *InFont, const FString &InText, float &XL, float &YL, bool bDPIAware=false)
 Calculate the length of a string, taking text wrapping into account. 更多...
 
void TextSize (const UFont *InFont, const FString &InText, float &XL, float &YL, float ScaleX=1.f, float ScaleY=1.f)
 Calculates the horizontal and vertical size of a given string. 更多...
 
void Update ()
 Updates the canvas.
 
int32 WrappedPrint (bool Draw, float X, float Y, int32 &out_XL, int32 &out_YL, const UFont *Font, float ScaleX, float ScaleY, bool bCenterTextX, bool bCenterTextY, const TCHAR *Text, const FFontRenderInfo &RenderInfo)
 Compute size and optionally print text with word wrap.
 
void VARARGS WrappedStrLenf (const UFont *Font, float ScaleX, float ScaleY, int32 &XL, int32 &YL, const TCHAR *Fmt,...)
 Calculate the size of a string built from a font, word wrapped to a specified region.
 
- Public 成员函数 继承自 UObject
void AbortInsideMemberFunction () const
 Abort with a member function call at the top of the callstack, helping to ensure that most platforms will stuff this object's memory into the resulting minidump.
 
virtual bool AreNativePropertiesIdenticalTo (UObject *Other) const
 Returns whether native properties are identical to the one of the passed in component. 更多...
 
virtual void BeginDestroy ()
 Called before destroying the object. 更多...
 
virtual void BuildSubobjectMapping (UObject *OtherObject, TMap< UObject *, UObject * > &ObjectMapping) const
 Given OtherObject (which will be the same type as 'this'), recursively find any matching sub-objects from 'this' that also exist within OtherObject, and add the mappings to ObjectMapping. 更多...
 
void CallAddReferencedObjects (FReferenceCollector &Collector)
 Helper function to call AddReferencedObjects for this object's class. 更多...
 
void CallFunction (FFrame &Stack, RESULT_DECL, UFunction *Function)
 Internal VM method for executing a function
 
bool CallFunctionByNameWithArguments (const TCHAR *Cmd, FOutputDevice &Ar, UObject *Executor, bool bForceCallWithNonExec=false)
 Handle calling a function by name when executed from the console or a command line
 
virtual bool CallRemoteFunction (UFunction *Function, void *Parms, struct FOutParmRec *OutParms, FFrame *Stack)
 Call the actor's function remotely 更多...
 
bool CheckDefaultSubobjects (bool bForceCheck=false) const
 Checks default sub-object assumptions. 更多...
 
void CollectDefaultSubobjects (TArray< UObject * > &OutDefaultSubobjects, bool bIncludeNestedSubobjects=false) const
 Uses the TArchiveObjectReferenceCollector to build a list of all components referenced by this object which have this object as the outer 更多...
 
bool ConditionalBeginDestroy ()
 Called before destroying the object. 更多...
 
bool ConditionalFinishDestroy ()
 Called when an object is actually destroyed, memory should never be accessed again
 
void ConditionalPostLoad ()
 PostLoad if needed.
 
void ConditionalPostLoadSubobjects (struct FObjectInstancingGraph *OuterInstanceGraph=NULL)
 Instances subobjects and components for objects being loaded from disk, if necessary. 更多...
 
 DECLARE_FUNCTION (execBreakpoint)
 Breakpoint; only observed in the editor; executing it at any other time is a NOP
 
 DECLARE_FUNCTION (execInstrumentation)
 Instrumentation event for profiling; only observed in the builds with blueprint instrumentation
 
 DECLARE_FUNCTION (execPopExecutionFlow)
 Pops a code offset from the execution flow stack and starts execution there. 更多...
 
 DECLARE_FUNCTION (execPopExecutionFlowIfNot)
 Pops a code offset from the execution flow stack and starts execution there, if a condition is not true. 更多...
 
 DECLARE_FUNCTION (execPushExecutionFlow)
 Push a code offset onto the execution flow stack for future execution. 更多...
 
 DECLARE_FUNCTION (execReturnNothing)
 failsafe for functions that return a value - returns the zero value for a property and logs that control reached the end of a non-void function
 
 DECLARE_FUNCTION (execTracepoint)
 Tracepoint; only observed in the editor; executing it at any other time is a NOP
 
 DECLARE_FUNCTION (ProcessInternal)
 Internal function call processing. 更多...
 
void DestroyNonNativeProperties ()
 Destroy properties that won't be destroyed by the native destructor
 
void ExecuteUbergraph (int32 EntryPoint)
 Execute the ubergraph from a specific entry point
 
virtual void ExportCustomProperties (FOutputDevice &Out, uint32 Indent)
 Exports the property values for the specified object as text to the output device. 更多...
 
UFunction * FindFunction (FName InName) const
 Returns a UFunction with the specified name, wrapper for UClass::FindFunctionByName()
 
UFunction * FindFunctionChecked (FName InName) const
 Version of FindFunction() that will assert if the function was not found
 
virtual void FinishDestroy ()
 Called to finish destroying the object. 更多...
 
UObject * GetArchetype () const
 Return the template this object is based on. 更多...
 
void GetArchetypeInstances (TArray< UObject * > &Instances)
 Builds a list of objects which have this object in their archetype chain. 更多...
 
virtual void GetAssetRegistryTags (TArray< FAssetRegistryTag > &OutTags) const
 Gathers a list of asset registry searchable tags which are name/value pairs with some type information This only needs to be implemented for asset objects 更多...
 
virtual const TCHAR * GetConfigOverridePlatform () const
 Returns the override config hierarchy platform (if NDAd platforms need defaults to not be in Base*.ini but still want editor to load them)
 
FString GetDefaultConfigFilename () const
 Get the default config filename for the specified UObject
 
virtual FString GetDesc ()
 Return a one line description of an object for viewing in the thumbnail view of the generic browser
 
FString GetDetailedInfo () const
 This will return detail info about this specific object. 更多...
 
virtual FName GetExporterName (void)
 Returns the name of the exporter factory used to export this object Used when multiple factories have the same extension
 
virtual int32 GetFunctionCallspace (UFunction *Function, FFrame *Stack)
 Return the space this function should be called. 更多...
 
FString GetGlobalUserConfigFilename () const
 Get the global user override config filename for the specified UObject
 
virtual void GetLifetimeReplicatedProps (TArray< class FLifetimeProperty > &OutLifetimeProps) const
 Returns properties that are replicated for the lifetime of the actor channel
 
virtual bool GetNativePropertyValues (TMap< FString, FString > &out_PropertyValues, uint32 ExportFlags=0) const
 Callback for retrieving a textual representation of natively serialized properties. 更多...
 
virtual int32 GetNetPushIdDynamic () const
 Should only ever be used by internal systems.
 
virtual void GetPreloadDependencies (TArray< UObject * > &OutDeps)
 Called during cooking. 更多...
 
virtual void GetPrestreamPackages (TArray< UObject * > &OutPrestream)
 Called during cooking. 更多...
 
virtual FPrimaryAssetId GetPrimaryAssetId () const
 Returns an Type:Name pair representing the PrimaryAssetId for this object. 更多...
 
FString GetProjectUserConfigFilename () const
 Get the project user override config filename for the specified UObject
 
SIZE_T GetResourceSizeBytes (EResourceSizeMode::Type Mode)
 Get the size of the object/resource for use in memory tools or to display to artists/LDs in the Editor This is the simple version which just returns the total number of bytes used by this object. 更多...
 
virtual void GetResourceSizeEx (FResourceSizeEx &CumulativeResourceSize)
 Get the size of the object/resource for use in memory tools or to display to artists/LDs in the Editor This is the extended version which separates up the used memory into different memory regions (the actual definition of which may be platform specific). 更多...
 
virtual FRestoreForUObjectOverwrite * GetRestoreForUObjectOverwrite ()
 Save information for StaticAllocateObject in the case of overwriting an existing object. 更多...
 
virtual UScriptStruct * GetSparseClassDataStruct () const
 Return the UStruct corresponding to the sidecar data structure that stores data that is constant for all instances of this class.
 
virtual void GetSubobjectsWithStableNamesForNetworking (TArray< UObject * > &ObjList)
 Returns a list of sub-objects that have stable names for networking
 
template<class T >
FORCEINLINE bool Implements () const
 Returns true if this object implements the interface T, false otherwise.
 
template<class T >
bool Implements () const
 Returns true if this object implements the interface T, false otherwise.
 
virtual void ImportCustomProperties (const TCHAR *SourceText, FFeedbackContext *Warn)
 Exports the property values for the specified object as text to the output device. 更多...
 
void InstanceSubobjectTemplates (struct FObjectInstancingGraph *InstanceGraph=NULL)
 Wrapper for calling UClass::InstanceSubobjectTemplates() for this object.
 
virtual bool IsAsset () const
 Returns true if this object is considered an asset.
 
bool IsBasedOnArchetype (const UObject *const SomeObject) const
 Determine if this object has SomeObject in its archetype chain.
 
virtual bool IsDestructionThreadSafe () const
 Called during garbage collection to determine if an object can have its destructor called on a worker thread. 更多...
 
virtual bool IsEditorOnly () const
 Called during saving to determine if the object is forced to be editor only or not 更多...
 
virtual bool IsFullNameStableForNetworking () const
 IsFullNameStableForNetworking means an object can be referred to its full path name over the network
 
bool IsInBlueprint () const
 Returns whether this object is contained in or part of a blueprint object
 
virtual bool IsLocalizedResource () const
 Returns true if this object is considered a localized resource.
 
virtual bool IsNameStableForNetworking () const
 IsNameStableForNetworking means an object can be referred to its path name (relative to outer) over the network
 
virtual bool IsPostLoadThreadSafe () const
 Called during async load to determine if PostLoad can be called on the loading thread. 更多...
 
virtual bool IsReadyForAsyncPostLoad () const
 Called before calling PostLoad() in FAsyncPackage::PostLoadObjects(). 更多...
 
virtual bool IsReadyForFinishDestroy ()
 Called to check if the object is ready for FinishDestroy. 更多...
 
virtual bool IsSafeForRootSet () const
 Returns true if this object is safe to add to the root set.
 
bool IsSelected () const
 Test the selection state of a UObject 更多...
 
virtual bool IsSupportedForNetworking () const
 IsSupportedForNetworking means an object can be referenced over the network
 
void LoadConfig (UClass *ConfigClass=NULL, const TCHAR *Filename=NULL, uint32 PropagationFlags=UE4::LCPF_None, class FProperty *PropertyToLoad=NULL)
 Imports property values from an .ini file. 更多...
 
virtual void MarkAsEditorOnlySubobject ()
 Called during subobject creation to mark this component as editor only, which causes it to get stripped in packaged builds
 
FORCEINLINE bool Modify (bool bAlwaysMarkDirty=true)
 Note that the object will be modified. 更多...
 
virtual bool NeedsLoadForClient () const
 Called during saving to determine the load flags to save with the object. 更多...
 
virtual bool NeedsLoadForEditorGame () const
 Called during saving to include this object in client/servers running in editor builds, even if they wouldn't normally be. 更多...
 
virtual bool NeedsLoadForServer () const
 Called during saving to determine the load flags to save with the object. 更多...
 
virtual bool NeedsLoadForTargetPlatform (const class ITargetPlatform *TargetPlatform) const
 Called during saving to determine the load flags to save with the object. 更多...
 
void OutputReferencers (FOutputDevice &Ar, FReferencerInformationList *Referencers=NULL)
 Outputs a string to an arbitrary output device, describing the list of objects which are holding references to this one. 更多...
 
virtual void OverridePerObjectConfigSection (FString &SectionName)
 Allows PerObjectConfig classes, to override the ini section name used for the PerObjectConfig object. 更多...
 
void ParseParms (const TCHAR *Parms)
 Import an object from a file.
 
virtual void PostCDOContruct ()
 Called after the C++ constructor has run on the CDO for a class. 更多...
 
virtual void PostDuplicate (bool bDuplicateForPIE)
 Called after duplication & serialization and before PostLoad. 更多...
 
virtual void PostEditImport ()
 Called after importing property values for this object (paste, duplicate or .t3d import) Allow the object to perform any cleanup for properties which shouldn't be duplicated or are unsupported by the script serialization
 
virtual void PostInitProperties ()
 Called after the C++ constructor and after the properties have been initialized, including those loaded from config. 更多...
 
virtual void PostInterpChange (FProperty *PropertyThatChanged)
 This is called when property is modified by InterpPropertyTracks 更多...
 
virtual void PostLoad ()
 Do any object-specific cleanup required immediately after loading an object. 更多...
 
virtual void PostLoadSubobjects (FObjectInstancingGraph *OuterInstanceGraph)
 Instances components for objects being loaded from disk, if necessary. 更多...
 
virtual void PostNetReceive ()
 Called right after receiving a bunch
 
virtual void PostReloadConfig (class FProperty *PropertyThatWasLoaded)
 Called from ReloadConfig after the object has reloaded its configuration data.
 
virtual void PostRename (UObject *OldOuter, const FName OldName)
 Called at the end of Rename(), but only if the rename was actually carried out
 
virtual void PostRepNotifies ()
 Called right after calling all OnRep notifies (called even when there are no notifies)
 
virtual void PostSaveRoot (bool bCleanupIsRequired)
 Called from within SavePackage on the passed in base/root object. 更多...
 
virtual void PreDestroyFromReplication ()
 Called right before being marked for destruction due to network replication
 
virtual void PreDuplicate (FObjectDuplicationParameters &DupParams)
 Called before duplication. 更多...
 
virtual void PreNetReceive ()
 Called right before receiving a bunch
 
virtual void PreSave (const class ITargetPlatform *TargetPlatform)
 Presave function. 更多...
 
virtual bool PreSaveRoot (const TCHAR *Filename)
 Called from within SavePackage on the passed in base/root object. 更多...
 
virtual bool ProcessConsoleExec (const TCHAR *Cmd, FOutputDevice &Ar, UObject *Executor)
 This function handles a console exec sent to the object; it is virtual so 'nexus' objects like a player controller can reroute the command to several different objects.
 
virtual void ProcessEvent (UFunction *Function, void *Parms)
 Called by VM to execute a UFunction with a filled in UStruct of parameters
 
virtual UClass * RegenerateClass (UClass *ClassToRegenerate, UObject *PreviousCDO)
 Called on the target when a class is loaded with ClassGeneratedBy is loaded. 更多...
 
void ReinitializeProperties (UObject *SourceObject=NULL, struct FObjectInstancingGraph *InstanceGraph=NULL)
 Wrapper function for InitProperties() which handles safely tearing down this object before re-initializing it from the specified source object. 更多...
 
void ReloadConfig (UClass *ConfigClass=NULL, const TCHAR *Filename=NULL, uint32 PropagationFlags=UE4::LCPF_None, class FProperty *PropertyToLoad=NULL)
 Wrapper method for LoadConfig that is used when reloading the config data for objects at runtime which have already loaded their config data at least once. 更多...
 
virtual bool Rename (const TCHAR *NewName=nullptr, UObject *NewOuter=nullptr, ERenameFlags Flags=REN_None)
 Rename this object to a unique name, or change its outer. 更多...
 
void RetrieveReferencers (TArray< FReferencerInformation > *OutInternalReferencers, TArray< FReferencerInformation > *OutExternalReferencers)
 Called by OutputReferencers() to get the internal list of referencers to write
 
void SaveConfig (uint64 Flags=CPF_Config, const TCHAR *Filename=NULL, FConfigCacheIni *Config=GConfig, bool bAllowCopyToDefaultObject=true)
 Save configuration out to ini files 更多...
 
virtual void Serialize (FArchive &Ar)
 Handles reading, writing, and reference collecting using FArchive. 更多...
 
void SerializeScriptProperties (FArchive &Ar) const
 Serializes the script property data located at Data. 更多...
 
void SerializeScriptProperties (FStructuredArchive::FSlot Slot) const
 Serializes the script property data located at Data. 更多...
 
void SetLinker (FLinkerLoad *LinkerLoad, int32 LinkerIndex, bool bShouldDetachExisting=true)
 Changes the linker and linker index to the passed in one. 更多...
 
virtual void ShutdownAfterError ()
 After a critical error, perform any mission-critical cleanup, such as restoring the video mode orreleasing hardware resources.
 
void SkipFunction (FFrame &Stack, RESULT_DECL, UFunction *Function)
 advances Stack's code past the parameters to the given Function and if the function has a return value, copies the zero value for that property to the memory for the return value 更多...
 
virtual void TagSubobjects (EObjectFlags NewFlags)
 Tags objects that are part of the same asset with the specified object flag, used for GC checking 更多...
 
void UpdateDefaultConfigFile (const FString &SpecificFileLocation="")
 Saves just the section(s) for this class into the default ini file for the class (with just the changes from base)
 
void UpdateGlobalUserConfigFile ()
 Saves just the section(s) for this class into the global user ini file for the class (with just the changes from base)
 
void UpdateProjectUserConfigFile ()
 Saves just the section(s) for this class into the project user ini file for the class (with just the changes from base)
 
void UpdateSinglePropertyInConfigFile (const FProperty *InProperty, const FString &InConfigIniName)
 Saves just the property into the global user ini file for the class (with just the changes from base)
 
- Public 成员函数 继承自 UObjectBaseUtility
void AddToCluster (UObjectBaseUtility *ClusterRootOrObjectFromCluster, bool bAddAsMutableObject=false)
 Adds this objects to a GC cluster that already exists 更多...
 
FORCEINLINE void AddToRoot ()
 Add an object to the root set. 更多...
 
FORCEINLINE void AppendName (FString &ResultString) const
 Optimized version of GetName that appends to an existing string
 
FORCEINLINE bool AtomicallyClearInternalFlags (EInternalObjectFlags FlagsToClear) const
 Atomically clears passed in internal flags. 更多...
 
virtual bool CanBeClusterRoot () const
 Called after load to determine if the object can be a cluster root 更多...
 
virtual bool CanBeInCluster () const
 Called during cluster construction if the object can be added to a cluster 更多...
 
FORCEINLINE void ClearFlags (EObjectFlags NewFlags)
 Clears subset of flags for a specific object
 
FORCEINLINE void ClearInternalFlags (EInternalObjectFlags FlagsToClear) const
 Clears passed in internal flags. 更多...
 
FORCEINLINE void ClearPendingKill ()
 Unmarks this object as PendingKill.
 
virtual void CreateCluster ()
 Called after PostLoad to create UObject cluster
 
void DetachExternalPackage ()
 Utility function to temporarily detach the object external package, if any GetPackage will report the outer's package once detached
 
const UClass * FindNearestCommonBaseClass (const UClass *TestClass) const
 Finds the most-derived class which is a parent of both TestClass and this object's class. 更多...
 
FORCEINLINE EObjectMark GetAllMarks () const
 Returns all of the object marks on a specific object 更多...
 
FString GetFullGroupName (bool bStartWithOuter) const
 Walks up the chain of packages until it reaches the top level, which it ignores. 更多...
 
void GetFullName (const UObject *StopOuter, FString &ResultString, EObjectFullNameFlags Flags=EObjectFullNameFlags::None) const
 Version of GetFullName() that eliminates unnecessary copies.
 
FString GetFullName (const UObject *StopOuter=NULL, EObjectFullNameFlags Flags=EObjectFullNameFlags::None) const
 Returns the fully qualified pathname for this object as well as the name of the class, in the format: 'ClassName Outermost[.Outer].Name'. 更多...
 
void * GetInterfaceAddress (UClass *InterfaceClass)
 Returns a pointer to this object safely converted to a pointer of the specified interface class. 更多...
 
FORCEINLINE EInternalObjectFlags GetInternalFlags () const
 Gets internal flags. 更多...
 
class FLinkerLoad * GetLinker () const
 Returns the linker for this object. 更多...
 
int32 GetLinkerCustomVersion (FGuid CustomVersionKey) const
 Returns the custom version of the linker for this object corresponding to the given custom version key. 更多...
 
int32 GetLinkerIndex () const
 Returns this object's LinkerIndex. 更多...
 
int32 GetLinkerLicenseeUE4Version () const
 Returns the licensee version of the linker for this object. 更多...
 
int32 GetLinkerUE4Version () const
 Returns the UE4 version of the linker for this object. 更多...
 
FORCEINLINE EObjectFlags GetMaskedFlags (EObjectFlags Mask=RF_AllFlags) const
 Returns object flags that are both in the mask and set on the object. 更多...
 
FORCEINLINE FString GetName () const
 Returns the name of this object (with no path information) 更多...
 
FORCEINLINE void GetName (FString &ResultString) const
 Optimized version of GetName that overwrites an existing string
 
void * GetNativeInterfaceAddress (UClass *InterfaceClass)
 Returns a pointer to the I* native interface object that this object implements. 更多...
 
const void * GetNativeInterfaceAddress (UClass *InterfaceClass) const
 Returns a pointer to the const I* native interface object that this object implements. 更多...
 
UPackage * GetOutermost () const
 Legacy function, has the same behavior as GetPackage use GetPackage instead. 更多...
 
UObject * GetOutermostObject () const
 Walks up the list of outers until it finds the top-level one that isn't a package. 更多...
 
UPackage * GetPackage () const
 Walks up the list of outers until it finds a package directly associated with the object. 更多...
 
void GetPathName (const UObject *StopOuter, FString &ResultString) const
 Versions of GetPathName() that eliminates unnecessary copies and allocations.
 
FString GetPathName (const UObject *StopOuter=NULL) const
 Returns the fully qualified pathname for this object, in the format: 'Outermost[.Outer].Name' 更多...
 
FORCEINLINE TStatId GetStatID (bool bForDeferredUse=false) const
 Returns the stat ID of the object, used for profiling. 更多...
 
template<typename T >
T * GetTypedOuter () const
 Traverses the outer chain searching for the next object of a certain type. 更多...
 
UObject * GetTypedOuter (UClass *Target) const
 Traverses the outer chain searching for the next object of a certain type. 更多...
 
FORCEINLINE bool HasAllFlags (EObjectFlags FlagsToCheck) const
 Used to safely check whether all of the passed in flags are set. 更多...
 
FORCEINLINE bool HasAllMarks (EObjectMark Marks) const
 Tests an object for having ALL of a set of marks 更多...
 
FORCEINLINE bool HasAnyFlags (EObjectFlags FlagsToCheck) const
 Used to safely check whether any of the passed in flags are set. 更多...
 
FORCEINLINE bool HasAnyInternalFlags (EInternalObjectFlags FlagsToCheck) const
 Used to safely check whether any of the passed in internal flags are set. 更多...
 
FORCEINLINE bool HasAnyMarks (EObjectMark Marks) const
 Tests an object for having ANY of a set of marks 更多...
 
template<class T >
bool IsA () const
 Returns true if this object is of the template type.
 
template<typename OtherClassType >
FORCEINLINE bool IsA (OtherClassType SomeBase) const
 Returns true if this object is of the specified type.
 
bool IsDefaultSubobject () const
 Returns whether this component was instanced from a component/subobject template, or if it is a component/subobject template. 更多...
 
bool IsIn (const UObject *SomeOuter) const
 Return the dispatch to IsInOuter or IsInPackage depending on SomeOuter's class. 更多...
 
bool IsIn (const UPackage *SomePackage) const
 Overload to determine if an object is in the specified package which can now be different than its outer chain. 更多...
 
bool IsInA (const UClass *SomeBaseClass) const
 Find out if this object is inside (has an outer) that is of the specified class 更多...
 
bool IsInOuter (const UObject *SomeOuter) const
 Returns true if the object is contained in the specified outer.
 
bool IsInPackage (const UPackage *SomePackage) const
 Returns true if the object is contained in the specified package.
 
FORCEINLINE bool IsNative () const
 Checks if the object is native.
 
FORCEINLINE bool IsPendingKill () const
 Checks the PendingKill flag to see if it is dead but memory still valid
 
FORCEINLINE bool IsPendingKillOrUnreachable () const
 Checks if the object is pending kill or unreachable.
 
FORCEINLINE bool IsRooted () const
 Returns true if this object is explicitly rooted 更多...
 
bool IsTemplate (EObjectFlags TemplateTypes=RF_ArchetypeObject|RF_ClassDefaultObject) const
 Determines whether this object is a template object 更多...
 
FORCEINLINE bool IsUnreachable () const
 Checks if the object is unreachable.
 
FORCEINLINE void Mark (EObjectMark Marks) const
 Adds marks to an object 更多...
 
bool MarkPackageDirty () const
 Finds the outermost package and marks it dirty. 更多...
 
FORCEINLINE void MarkPendingKill ()
 Marks this object as RF_PendingKill.
 
virtual void OnClusterMarkedAsPendingKill ()
 Called during Garbage Collection to perform additional cleanup when the cluster is about to be destroyed due to PendingKill flag being set on it.
 
FORCEINLINE bool operator< (const UObjectBaseUtility &Other) const
 Overloaded < operator. 更多...
 
void ReattachExternalPackage ()
 Utility function to reattach the object external package, if any GetPackage will report the object external package if set after this call
 
FORCEINLINE void RemoveFromRoot ()
 Remove an object from the root set.
 
bool RootPackageHasAnyFlags (uint32 CheckFlagMask) const
 Checks whether this object's top-most package has any of the specified flags 更多...
 
FORCEINLINE void SetFlags (EObjectFlags NewFlags)
 Modifies object flags for a specific object
 
FORCEINLINE void SetInternalFlags (EInternalObjectFlags FlagsToSet) const
 Clears passed in internal flags. 更多...
 
FORCEINLINE bool ThisThreadAtomicallyClearedRFUnreachable ()
 Atomically clear the unreachable flag 更多...
 
FORCEINLINE void UnMark (EObjectMark Marks) const
 Removes marks from and object 更多...
 
- Public 成员函数 继承自 UObjectBase
FORCENOINLINE void AtomicallyClearFlags (EObjectFlags FlagsToClear)
 Atomically clears the specified flags. 更多...
 
FORCENOINLINE void AtomicallySetFlags (EObjectFlags FlagsToAdd)
 Atomically adds the specified flags. 更多...
 
FORCEINLINE UClass * GetClass () const
 Returns the UClass that defines the fields of this object
 
UPackage * GetExternalPackage () const
 Returns the external UPackage associated with this object, if any
 
UPackage * GetExternalPackageInternal () const
 Returns the external UPackage for this object, if any, NOT THREAD SAFE, used by internal gc reference collecting.
 
FORCEINLINE EObjectFlags GetFlags () const
 Retrieve the object flags directly 更多...
 
FORCEINLINE FName GetFName () const
 Returns the logical name of this object
 
FORCEINLINE UObject * GetOuter () const
 Returns the UObject this object resides in
 
FORCEINLINE uint32 GetUniqueID () const
 Returns the unique ID of the object...these are reused so it is only unique while the object is alive. 更多...
 
bool IsValidLowLevel () const
 Checks to see if the object appears to be valid 更多...
 
bool IsValidLowLevelFast (bool bRecursive=true) const
 Faster version of IsValidLowLevel. 更多...
 
void SetExternalPackage (UPackage *InPackage)
 Associate an external package directly to this object.
 
 UObjectBase (UClass *InClass, EObjectFlags InFlags, EInternalObjectFlags InInternalFlags, UObject *InOuter, FName InName)
 Constructor used by StaticAllocateObject 更多...
 
virtual ~UObjectBase ()
 Final destructor, removes the object from the object array, and indirectly, from any annotations
 

静态 Public 成员函数

static void CanvasStringSize (FTextSizingParameters &Parameters, const TCHAR *pText)
 Calculates the size of the specified string. 更多...
 
static void ClippedStrLen (const UFont *Font, float ScaleX, float ScaleY, int32 &XL, int32 &YL, const TCHAR *Text)
 Calculate the length of a string. 更多...
 
static FCanvasIcon MakeIcon (class UTexture *Texture, float U=0.f, float V=0.f, float UL=0.f, float VL=0.f)
 Fake CanvasIcon constructor. 更多...
 
static void MeasureStringInternal (FTextSizingParameters &Parameters, const TCHAR *const pText, const int32 TextLength, const int32 StopAfterHorizontalOffset, const ELastCharacterIndexFormat CharIndexFormat, int32 &OutLastCharacterIndex)
 Measures a string, optionally stopped after the specified horizontal offset in pixels is reached. 更多...
 
static void WrapString (FCanvasWordWrapper &Wrapper, FTextSizingParameters &Parameters, const float InCurX, const TCHAR *const pText, TArray< FWrappedStringElement > &out_Lines, FCanvasWordWrapper::FWrappedLineData *const OutWrappedLineData=nullptr)
 Parses a single string into an array of strings that will fit inside the specified bounding region. 更多...
 
- 静态 Public 成员函数 继承自 UObject
static void AddReferencedObjects (UObject *InThis, FReferenceCollector &Collector)
 Callback used to allow object register its direct object references that are not already covered by the token stream. 更多...
 
static bool CanCreateInCurrentContext (UObject *Template)
 Determines if you can create an object from the supplied template in the current context (editor, client only, dedicated server, game/listen) This calls NeedsLoadForClient & NeedsLoadForServer
 
static UObject * GetArchetypeFromRequiredInfo (const UClass *Class, const UObject *Outer, FName Name, EObjectFlags ObjectFlags)
 Return the template that an object with this class, outer and name would be 更多...
 
static const FName & SourceFileTagName ()
 Get the common tag name used for all asset source file import paths
 
static void UpdateClassesExcludedFromDedicatedClient (const TArray< FString > &InClassNames, const TArray< FString > &InModulesNames)
 Update the list of classes that we should exclude from dedicated client builds
 
static void UpdateClassesExcludedFromDedicatedServer (const TArray< FString > &InClassNames, const TArray< FString > &InModulesNames)
 Update the list of classes that we should exclude from dedicated server builds
 
- 静态 Public 成员函数 继承自 UObjectBase
static void EmitBaseReferences (UClass *RootClass)
 Emit GC tokens for UObjectBase, this might be UObject::StaticClass or Default__Class
 
static FString RemoveClassPrefix (const TCHAR *ClassName)
 Removes the class prefix from the given string
 

额外继承的成员函数

- Protected 成员函数 继承自 UObject
bool CanCheckDefaultSubObjects (bool bForceCheck, bool &bResult) const
 Checks it's ok to perform subobjects check at this time.
 
virtual bool CheckDefaultSubobjectsInternal () const
 Checks default sub-object assumptions. 更多...
 
virtual FString GetDetailedInfoInternal () const
 This function actually does the work for the GetDetailedInfo() and is virtual. 更多...
 
- Protected 成员函数 继承自 UObjectBase
virtual void DeferredRegister (UClass *UClassStaticClass, const TCHAR *PackageName, const TCHAR *Name)
 Convert a boot-strap registered class into a real one, add to uobject array, etc 更多...
 
void LowLevelRename (FName NewName, UObject *NewOuter=NULL)
 Just change the FName and Outer and rehash into name hash tables. 更多...
 
void Register (const TCHAR *PackageName, const TCHAR *Name)
 Enqueue the registration for this object.
 
virtual void RegisterDependencies ()
 Force any base classes to be registered first
 
FORCEINLINE void SetFlagsTo (EObjectFlags NewFlags)
 Set the object flags directly 更多...
 
 UObjectBase (EObjectFlags InFlags)
 Constructor used for bootstrapping 更多...
 
- 静态 Protected 成员函数 继承自 UObjectBaseUtility
static void CreateClusterFromObject (UObjectBaseUtility *ClusterRootObject, UObjectBaseUtility *ReferencingObject)
 Helper function to create a cluster from UObject
 

详细描述

A drawing canvas.

成员函数说明

◆ BeginDestroy()

virtual void UCanvas::BeginDestroy ( )
overridevirtual

Called before destroying the object.

This is called immediately upon deciding to destroy the object, to allow the object to begin an asynchronous cleanup process.

重载 UObject .

◆ CanvasStringSize()

static void UCanvas::CanvasStringSize ( FTextSizingParameters &  Parameters,
const TCHAR *  pText 
)
static

Calculates the size of the specified string.

参数
ParametersUsed for various purposes DrawXL: [out] will be set to the width of the string DrawYL: [out] will be set to the height of the string DrawFont: [in] specifies the font to use for retrieving the size of the characters in the string Scale: [in] specifies the amount of scaling to apply to the string
pTextthe string to calculate the size for

◆ ClippedStrLen()

static void UCanvas::ClippedStrLen ( const UFont *  Font,
float  ScaleX,
float  ScaleY,
int32 &  XL,
int32 &  YL,
const TCHAR *  Text 
)
static

Calculate the length of a string.

参数
FontThe font used.
ScaleXScale in X axis.
ScaleYScale in Y axis.
XLout Horizontal length of string.
YLout Vertical length of string.
TextString to calculate for.

◆ Deproject()

void UCanvas::Deproject ( FVector2D  ScreenPos,
FVector &  WorldOrigin,
FVector &  WorldDirection 
) const

Transforms 2D screen coordinates into a 3D world-space origin and direction.

参数
ScreenPosScreen coordinates in pixels.
WorldOrigin(out) World-space origin vector.
WorldDirection(out) World-space direction vector.

◆ DrawDebugGraph()

virtual void UCanvas::DrawDebugGraph ( const FString &  Title,
float  ValueX,
float  ValueY,
float  UL_X,
float  UL_Y,
float  W,
float  H,
FVector2D  RangeX,
FVector2D  RangeY 
)
virtual

Draws a graph comparing 2 variables.

Useful for visual debugging and tweaking.

参数
TitleLabel to draw on the graph, or "" for none
ValueXX-axis value of the point to plot
ValueYY-axis value of the point to plot
UL_XX screen coord of the upper-left corner of the graph
UL_YY screen coord of the upper-left corner of the graph
WWidth of the graph, in pixels
HHeight of the graph, in pixels
RangeXRange of values expressed by the X axis of the graph
RangeYRange of values expressed by the Y axis of the graph

◆ DrawIcon()

void UCanvas::DrawIcon ( FCanvasIcon  Icon,
float  X,
float  Y,
float  Scale = 0.f 
)

Draw a CanvasIcon at the desired canvas position.


◆ DrawItem() [1/3]

void UCanvas::DrawItem ( FCanvasItem &  Item)

Draw a CanvasItem

参数
ItemItem to draw

◆ DrawItem() [2/3]

void UCanvas::DrawItem ( FCanvasItem &  Item,
const FVector2D &  InPosition 
)

Draw a CanvasItem at the given coordinates

参数
ItemItem to draw
InPositionPosition to draw item

◆ DrawItem() [3/3]

void UCanvas::DrawItem ( FCanvasItem &  Item,
float  X,
float  Y 
)

Draw a CanvasItem at the given coordinates

参数
ItemItem to draw
XX Position to draw item
YY Position to draw item

◆ DrawText()

float UCanvas::DrawText ( const UFont *  InFont,
const FString &  InText,
float  X,
float  Y,
float  XScale = 1.f,
float  YScale = 1.f,
const FFontRenderInfo &  RenderInfo = FFontRenderInfo() 
)

Draws a string of text to the screen.

参数
InFontThe font to draw with.
InTextThe string to be drawn.
XPosition to draw X.
YPosition to draw Y.
XScaleOptional. The horizontal scaling to apply to the text.
YScaleOptional. The vertical scaling to apply to the text.
RenderInfoOptional. The FontRenderInfo to use when drawing the text.
返回
The Y extent of the rendered text.

◆ DrawTile()

void UCanvas::DrawTile ( UTexture *  Tex,
float  X,
float  Y,
float  XL,
float  YL,
float  U,
float  V,
float  UL,
float  VL,
EBlendMode  BlendMode = BLEND_Translucent 
)

Draw arbitrary aligned rectangle.

参数
TexTexture to draw.
XPosition to draw X.
YPosition to draw Y.
XLWidth of tile.
YLHeight of tile.
UHorizontal position of the upper left corner of the portion of the texture to be shown(texels).
VVertical position of the upper left corner of the portion of the texture to be shown(texels).
ULThe width of the portion of the texture to be drawn(texels).
VLThe height of the portion of the texture to be drawn(texels).
ClipTiletrue to clip tile.
BlendModeBlending mode of texture.

◆ GetDPIScale()

float UCanvas::GetDPIScale ( ) const
inline
返回
the current DPI scale being applied to all canvas draw elements

◆ K2_Deproject()

void UCanvas::K2_Deproject ( FVector2D  ScreenPosition,
FVector &  WorldOrigin,
FVector &  WorldDirection 
)

Performs a deprojection of a screen space coordinate using the projection matrix set up for the Canvas.

参数
ScreenPositionScreen space position to deproject to the World.
WorldOriginVector which is the world position of the screen space position.
WorldDirectionVector which can be used in a trace to determine what is "behind" the screen space position. Useful for object picking.

◆ K2_DrawBorder()

void UCanvas::K2_DrawBorder ( UTexture *  BorderTexture,
UTexture *  BackgroundTexture,
UTexture *  LeftBorderTexture,
UTexture *  RightBorderTexture,
UTexture *  TopBorderTexture,
UTexture *  BottomBorderTexture,
FVector2D  ScreenPosition,
FVector2D  ScreenSize,
FVector2D  CoordinatePosition,
FVector2D  CoordinateSize = FVector2D::UnitVector,
FLinearColor  RenderColor = FLinearColor::White,
FVector2D  BorderScale = FVector2D(0.1f, 0.1f),
FVector2D  BackgroundScale = FVector2D(0.1f, 0.1f),
float  Rotation = 0.0f,
FVector2D  PivotPoint = FVector2D(0.5f, 0.5f),
FVector2D  CornerSize = FVector2D::ZeroVector 
)

Draws a 3x3 grid border with tiled frame and tiled interior on the Canvas.

参数
BorderTextureTexture to use for border.
BackgroundTextureTexture to use for border background.
LeftBorderTextureTexture to use for the tiling left border.
RightBorderTextureTexture to use for the tiling right border.
TopBorderTextureTexture to use for the tiling top border.
BottomBorderTextureTexture to use for the tiling bottom border.
ScreenPositionScreen space position to render the texture.
ScreenSizeScreen space size to render the texture.
CoordinatePositionNormalized UV starting coordinate to use when rendering the border texture.
CoordinateSizeNormalized UV size coordinate to use when rendering the border texture.
RenderColorColor to tint the border.
BorderScaleScale of the border.
BackgroundScaleScale of the background.
RotationRotation, in degrees, to render the texture.
PivotPointNormalized pivot point to use when rotating the texture.
CornerSizeFrame corner size in percent of frame texture (should be < 0.5f).

◆ K2_DrawBox()

void UCanvas::K2_DrawBox ( FVector2D  ScreenPosition,
FVector2D  ScreenSize,
float  Thickness = 1.0f,
FLinearColor  RenderColor = FLinearColor::White 
)

Draws an unfilled box on the Canvas.

参数
ScreenPositionScreen space position to render the text.
ScreenSizeScreen space size to render the texture.
ThicknessHow many pixels thick the box lines should be.

◆ K2_DrawLine()

void UCanvas::K2_DrawLine ( FVector2D  ScreenPositionA = FVector2D::ZeroVector,
FVector2D  ScreenPositionB = FVector2D::ZeroVector,
float  Thickness = 1.0f,
FLinearColor  RenderColor = FLinearColor::White 
)

Draws a line on the Canvas.

参数
ScreenPositionAStarting position of the line in screen space.
ScreenPositionBEnding position of the line in screen space.
ThicknessHow many pixels thick this line should be.
RenderColorColor to render the line.

◆ K2_DrawMaterial()

void UCanvas::K2_DrawMaterial ( UMaterialInterface *  RenderMaterial,
FVector2D  ScreenPosition,
FVector2D  ScreenSize,
FVector2D  CoordinatePosition,
FVector2D  CoordinateSize = FVector2D::UnitVector,
float  Rotation = 0.f,
FVector2D  PivotPoint = FVector2D(0.5f, 0.5f) 
)

Draws a material on the Canvas.

参数
RenderMaterialMaterial to use when rendering. Remember that only the emissive channel is able to be rendered as no lighting is performed when rendering to the Canvas.
ScreenPositionScreen space position to render the texture.
ScreenSizeScreen space size to render the texture.
CoordinatePositionNormalized UV starting coordinate to use when rendering the texture.
CoordinateSizeNormalized UV size coordinate to use when rendering the texture.
RotationRotation, in degrees, to render the texture.
PivotPointNormalized pivot point to use when rotating the texture.

◆ K2_DrawMaterialTriangle()

void UCanvas::K2_DrawMaterialTriangle ( UMaterialInterface *  RenderMaterial,
TArray< FCanvasUVTri >  Triangles 
)

Draws a set of triangles on the Canvas.

参数
RenderMaterialMaterial to use when rendering. Remember that only the emissive channel is able to be rendered as no lighting is performed when rendering to the Canvas.
TrianglesTriangles to render.

◆ K2_DrawPolygon()

void UCanvas::K2_DrawPolygon ( UTexture *  RenderTexture,
FVector2D  ScreenPosition,
FVector2D  Radius = FVector2D::UnitVector,
int32  NumberOfSides = 3,
FLinearColor  RenderColor = FLinearColor::White 
)

Draws a polygon on the Canvas.

参数
RenderTextureTexture to use when rendering the triangles. If no texture is set, then the default white texture is used.
ScreenPositionScreen space position to render the text.
RadiusHow large in pixels this polygon should be.
NumberOfSidesHow many sides this polygon should have. This should be above or equal to three.
RenderColorColor to tint the polygon.

◆ K2_DrawText()

void UCanvas::K2_DrawText ( UFont *  RenderFont,
const FString &  RenderText,
FVector2D  ScreenPosition,
FVector2D  Scale = FVector2D(1.0f, 1.0f),
FLinearColor  RenderColor = FLinearColor::White,
float  Kerning = 0.0f,
FLinearColor  ShadowColor = FLinearColor::Black,
FVector2D  ShadowOffset = FVector2D::UnitVector,
bool  bCentreX = false,
bool  bCentreY = false,
bool  bOutlined = false,
FLinearColor  OutlineColor = FLinearColor::Black 
)

Draws text on the Canvas.

参数
RenderFontFont to use when rendering the text. If this is null, then a default engine font is used.
RenderTextText to render on the Canvas.
ScreenPositionScreen space position to render the text.
RenderColorColor to render the text.
KerningHorizontal spacing adjustment to modify the spacing between each letter.
ShadowColorColor to render the shadow of the text.
ShadowOffsetPixel offset relative to the screen space position to render the shadow of the text.
bCentreXIf true, then interpret the screen space position X coordinate as the center of the rendered text.
bCentreYIf true, then interpret the screen space position Y coordinate as the center of the rendered text.
bOutlinedIf true, then the text should be rendered with an outline.
OutlineColorColor to render the outline for the text.

◆ K2_DrawTexture()

void UCanvas::K2_DrawTexture ( UTexture *  RenderTexture,
FVector2D  ScreenPosition,
FVector2D  ScreenSize,
FVector2D  CoordinatePosition,
FVector2D  CoordinateSize = FVector2D::UnitVector,
FLinearColor  RenderColor = FLinearColor::White,
EBlendMode  BlendMode = BLEND_Translucent,
float  Rotation = 0.f,
FVector2D  PivotPoint = FVector2D(0.5f, 0.5f) 
)

Draws a texture on the Canvas.

参数
RenderTextureTexture to use when rendering. If no texture is set then this will use the default white texture.
ScreenPositionScreen space position to render the texture.
ScreenSizeScreen space size to render the texture.
CoordinatePositionNormalized UV starting coordinate to use when rendering the texture.
CoordinateSizeNormalized UV size coordinate to use when rendering the texture.
RenderColorColor to use when rendering the texture.
BlendModeBlending mode to use when rendering the texture.
RotationRotation, in degrees, to render the texture.
PivotPointNormalized pivot point to use when rotating the texture.

◆ K2_DrawTriangle()

void UCanvas::K2_DrawTriangle ( UTexture *  RenderTexture,
TArray< FCanvasUVTri >  Triangles 
)

Draws a set of triangles on the Canvas.

参数
RenderTextureTexture to use when rendering the triangles. If no texture is set, then the default white texture is used.
TrianglesTriangles to render.

◆ K2_Project()

FVector UCanvas::K2_Project ( FVector  WorldLocation)

Performs a projection of a world space coordinates using the projection matrix set up for the Canvas.

参数
WorldLocationWorld space location to project onto the Canvas rendering plane.
返回
Returns a vector where X, Y defines a screen space position representing the world space location.

◆ K2_StrLen()

FVector2D UCanvas::K2_StrLen ( UFont *  RenderFont,
const FString &  RenderText 
)

Returns the wrapped text size in screen space coordinates.

参数
RenderFontFont to use when determining the size of the text. If this is null, then a default engine font is used.
RenderTextText to determine the size of.
返回
Returns the screen space size of the text.

◆ K2_TextSize()

FVector2D UCanvas::K2_TextSize ( UFont *  RenderFont,
const FString &  RenderText,
FVector2D  Scale = FVector2D::UnitVector 
)

Returns the clipped text size in screen space coordinates.

参数
RenderFontFont to use when determining the size of the text. If this is null, then a default engine font is used.
RenderTextText to determine the size of.
ScaleScale of the font to use when determining the size of the text.
返回
Returns the screen space size of the text.

◆ MakeIcon()

static FCanvasIcon UCanvas::MakeIcon ( class UTexture *  Texture,
float  U = 0.f,
float  V = 0.f,
float  UL = 0.f,
float  VL = 0.f 
)
static

Fake CanvasIcon constructor.


◆ MeasureStringInternal()

static void UCanvas::MeasureStringInternal ( FTextSizingParameters &  Parameters,
const TCHAR *const  pText,
const int32  TextLength,
const int32  StopAfterHorizontalOffset,
const ELastCharacterIndexFormat  CharIndexFormat,
int32 &  OutLastCharacterIndex 
)
static

Measures a string, optionally stopped after the specified horizontal offset in pixels is reached.

参数
ParametersUsed for various purposes DrawXL: [out] will be set to the width of the string DrawYL: [out] will be set to the height of the string DrawFont: [in] specifies the font to use for retrieving the size of the characters in the string Scale: [in] specifies the amount of scaling to apply to the string
pTextthe string to calculate the size for
TextLengththe number of code units in pText
StopAfterHorizontalOffsetOffset horizontally into the string to stop measuring characters after, in pixels (or INDEX_NONE)
CharIndexFormatBehavior to use for StopAfterHorizontalOffset
OutCharacterIndexThe index of the last character processed (used with StopAfterHorizontalOffset)

◆ Project()

FVector UCanvas::Project ( FVector  Location) const

Transforms a 3D world-space vector into 2D screen coordinates.

参数
LocationThe vector to transform.
返回
The transformed vector.

◆ SetDrawColor() [1/2]

void UCanvas::SetDrawColor ( FColor const &  C)

Set draw color.

(FColor)

◆ SetDrawColor() [2/2]

void UCanvas::SetDrawColor ( uint8  R,
uint8  G,
uint8  B,
uint8  A = 255 
)

Set draw color.

(R,G,B,A)

◆ StrLen()

void UCanvas::StrLen ( const UFont *  InFont,
const FString &  InText,
float &  XL,
float &  YL,
bool  bDPIAware = false 
)

Calculate the length of a string, taking text wrapping into account.

参数
InFontThe Font use.
TextThe string to calculate for.
XLout Horizontal length of string.
YLout Vertical length of string.
bDPUAwareIf true measures text considering the current DPI scale factor of the canvas. Defaults to false for backwards compatibility

◆ TextSize()

void UCanvas::TextSize ( const UFont *  InFont,
const FString &  InText,
float &  XL,
float &  YL,
float  ScaleX = 1.f,
float  ScaleY = 1.f 
)

Calculates the horizontal and vertical size of a given string.

This is used for clipped text as it does not take wrapping into account.

参数
FontThe font to use.
TextString to calculate for.
XLout Horizontal length of string.
YLout Vertical length of string.
ScaleXScale that the string is expected to draw at horizontally.
ScaleYScale that the string is expected to draw at vertically.

◆ WrapString()

static void UCanvas::WrapString ( FCanvasWordWrapper &  Wrapper,
FTextSizingParameters &  Parameters,
const float  InCurX,
const TCHAR *const  pText,
TArray< FWrappedStringElement > &  out_Lines,
FCanvasWordWrapper::FWrappedLineData *const  OutWrappedLineData = nullptr 
)
static

Parses a single string into an array of strings that will fit inside the specified bounding region.

参数
ParametersUsed for various purposes: DrawX: [in] specifies the pixel location of the start of the horizontal bounding region that should be used for wrapping. DrawY: [in] specifies the Y origin of the bounding region. This should normally be set to 0, as this will be used as the base value for DrawYL. [out] Will be set to the Y position (+YL) of the last line, i.e. the total height of all wrapped lines relative to the start of the bounding region DrawXL: [in] specifies the pixel location of the end of the horizontal bounding region that should be used for wrapping DrawYL: [in] specifies the height of the bounding region, in pixels. A input value of 0 indicates that the bounding region height should not be considered. Once the total height of lines reaches this value, the function returns and no further processing occurs. DrawFont: [in] specifies the font to use for retrieving the size of the characters in the string Scale: [in] specifies the amount of scaling to apply to the string
CurXspecifies the pixel location to begin the wrapping; usually equal to the X pos of the bounding region, unless wrapping is initiated in the middle of the bounding region (i.e. indentation)
pTextthe text that should be wrapped
out_Lines[out] will contain an array of strings which fit inside the bounding region specified. Does not clear the array first.
OutWrappedLineDataAn optional array to fill with the indices from the source string marking the begin and end points of the wrapped lines

该类的文档由以下文件生成: