I have a property for an offset.
This property is accessible from the BP Editor
Apparently the only integer value writable within the BP Editor is int32 and uint8.
This value must be positive 0 to n.
Unfortunately, uint8 is too short. Therefore I set it as int32.
What I need to do is to check, within the BP Editor, that value still positive.
I cannot found a way to trap the event when the value change or a method to validate the input.
/**
<summary>The x position of debug info</summary>
*/
UPROPERTY(EditDefaultsOnly, meta = (EditCondition = "DisplayDebugInfo"), Category = Display)
int32 OffsetX;
/**
<summary>The y position of debug info</summary>
*/
UPROPERTY(EditDefaultsOnly, meta = (EditCondition = "DisplayDebugInfo"), Category = Display)
int32 OffsetY;
My question is :
how to check the value to remains positive even if the user type -300.
and also how to set back a 0 value when it goes below 0.
I can’t check the exact wording right now but there should be examples of the use of meta keywords in properties like clampmin and clampmax. These will allow you to specify limits that the editor will enforce.
///Specifies the lowest that the value slider should represent.
UIMin
///Specifies the highest that the value slider should represent.
UIMax
///Specifies the minimum value that may be entered for the property.
ClampMin
///Specifies the maximum value that may be entered for the property.
ClampMax