UILensDistortion
Post-processing lens distortion effect exposed by the Java runtime.
Create in the Editor
- Ensure there is a
UIControllerin the scene. - Create a GameObject and add
UIRect. - Add the
UILensDistortioncomponent.
How to Use
- Get the component with
myObject.findComponent(UILensDistortion.class). - Read or write the component properties to control behavior.
- Test input or layout in Play mode.
Java Example
SpatialObject myObject = /* your object */;
UILensDistortion comp = myObject.findComponent(UILensDistortion.class);
if (comp != null) {
// set the border value:
comp.border = 0.5f;
// read the border value:
float borderValue = comp.border;
// set the center value:
comp.center = new Vector2(0.5f, 0.5f);
// read the center value:
Vector2 centerValue = comp.center;
// set the intensity value:
comp.intensity = 1f;
// read the intensity value:
float intensityValue = comp.intensity;
// set the mode value:
comp.mode = UILensDistortion.Mode.Barrel;
// read the mode value:
UILensDistortion.Mode modeValue = comp.mode;
}