次の方法で共有


HardwareBufferRenderer.SetLightSourceGeometry Method

Definition

Sets the center of the light source.

[Android.Runtime.Register("setLightSourceGeometry", "(FFFF)V", "GetSetLightSourceGeometry_FFFFHandler", ApiSince=34)]
public virtual void SetLightSourceGeometry (float lightX, float lightY, float lightZ, float lightRadius);
[<Android.Runtime.Register("setLightSourceGeometry", "(FFFF)V", "GetSetLightSourceGeometry_FFFFHandler", ApiSince=34)>]
abstract member SetLightSourceGeometry : single * single * single * single -> unit
override this.SetLightSourceGeometry : single * single * single * single -> unit

Parameters

lightX
Single

The X position of the light source. If unsure, a reasonable default is 'displayWidth / 2f - windowLeft'.

lightY
Single

The Y position of the light source. If unsure, a reasonable default is '0 - windowTop'

lightZ
Single

The Z position of the light source. Must be >= 0. If unsure, a reasonable default is 600dp.

lightRadius
Single

The radius of the light source. Smaller radius will have sharper edges, larger radius will have softer shadows. If unsure, a reasonable default is 800 dp.

Attributes

Remarks

Sets the center of the light source. The light source point controls the directionality and shape of shadows rendered by RenderNode Z & elevation.

The light source should be setup both as part of initial configuration, and whenever the window moves to ensure the light source stays anchored in display space instead of in window space.

This must be set at least once along with #setLightSourceAlpha(float, float) before shadows will work.

Java documentation for android.graphics.HardwareBufferRenderer.setLightSourceGeometry(float, float, float, float).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to