Transformation properties of View

These properties are used to transform (skew, scale, etc.) the content of the View.

"perspective" property

The "perspective" SizeUnit property (Perspective constant) defines the distance between the z = 0 plane andthe user in order to give the 3D positioned element a perspective effect. Each transformed element withz > 0 will become larger, with z < 0, respectively, less.

Elements of the part that are behind the user, i.e. the z-coordinate of these elements is greater than the value of the perspective property, and are not rendered.

The vanishing point is by default located in the center of the element, but it can be moved using the "perspective-origin-x" and "perspective-origin-y" properties.

You can get the value of this property using the function

func GetPerspective(view View, subviewID ...string) SizeUnit

"perspective-origin-x" and "perspective-origin-y" properties

The "Perspective-origin-x" and "perspective-origin-y" SizeUnit properties (PerspectiveOriginX and PerspectiveOriginY constants)determine the position from which the viewer is looking. It is used by the perspective property as a vanishing point.

By default, the "perspective-origin-x" and "perspective-origin-y" properties are set to 50%. point to the center of the View.

You can get the value of these properties using the function

func GetPerspectiveOrigin(view View, subviewID ...string) (SizeUnit, SizeUnit)

"backface-visibility" property

The "backface-visibility" bool property (BackfaceVisible constant) determines whetherthe back face of an element is visible when it is facing the user.

The back surface of an element is a mirror image of its front surface. However, invisible in 2D,the back face can be visible when the transformation causes the element to rotate in 3D space.(This property has no effect on 2D transforms that have no perspective.)

You can get the value of this property using the function

func GetBackfaceVisible(view View, subviewID ...string) bool

"origin-x", "origin-y", and "origin-z" properties

The "origin-x", "origin-y", and "origin-z" SizeUnit properties (OriginX, OriginY, and OriginZ constants) set the origin for element transformations.

The origin of the transformation is the point around which the transformation takes place. For example, rotation.

The "origin-z" property is ignored if the perspective property is not set.

You can get the value of these properties using the function

func GetOrigin(view View, subviewID ...string) (SizeUnit, SizeUnit, SizeUnit)

"translate-x", "translate-y", and "translate-z" properties

The "translate-x", "translate-y" and "translate-z" SizeUnit properties (TranslateX, TranslateY, and TranslateZ constants)set the offset of the content of the View.

The translate-z property is ignored if the perspective property is not set.

You can get the value of these properties using the function

func GetTranslate(view View, subviewID ...string) (SizeUnit, SizeUnit, SizeUnit)

"scale-x", "scale-y" and "scale-z" properties

The "scale-x", "scale-y" and "scale-z" float64 properties (ScaleX, ScaleY and ScaleZ constants) setthe scaling factor along the x, y and z axes, respectively.The original scale is 1. A value between 0 and 1 is used to zoom out. More than 1 - to increase.Values less than or equal to 0 are invalid (the Set function will return false)

The "scale-z" property is ignored if the "perspective" property is not set.

You can get the value of these properties using the function

func GetScale(view View, subviewID ...string) (float64, float64, float64)

"rotate" property

The "rotate" AngleUnit property (Rotate constant) sets the angle of rotation of the contentaround the vector specified by the "rotate-x", "rotate-y" and "rotate-z" properties.

"rotate-x", "rotate-y", and "rotate-z" properties

The "rotate-x", "rotate-y" and "rotate-z" float64 properties (constant RotateX, RotateY and RotateZ) setthe vector around which the rotation is performed by the angle specified by the "rotate" property.This vector passes through the point specified by the "origin-x", "origin-y" and "origin-z" properties.

The "rotate-z" property is ignored if the "perspective" property is not set.

You can get the value of these properties, as well as the "rotate" property, using the function

func GetRotate(view View, subviewID ...string) (float64, float64, float64, AngleUnit)

"skew-x" and "skew-y" properties

The "skew-x" and "skew-y" AngleUnit properties (SkewX and SkewY constants) set the skew (skew) of the content,thus turning it from a rectangle into a parallelogram. The bevel is carried out around the pointspecified by the transform-origin-x and transform-origin-y properties.

You can get the value of these properties using the function

func GetSkew(view View, subviewID ...string) (AngleUnit, AngleUnit)