Livecode Wiki
Advertisement

Specifies the starting angle of an arc or the rotation angle of a regular polygon or image.

Properties of Objects[]

Syntax:

set the angle of {<graphic> | <image>} to <angleInDegrees>

Examples:

set the angle of graphic "Triangle" to 180
set the angle of image ID 45902 to it
set the angle of graphic myGraphic to the angle of myGraphic + 5

Use the angle property to create an arc shape, or to turn a regular polygon or image object.

If you specify an angle in Degrees greater than 360, the angle is set to the number you specify mod 360.

A regular polygon can be rotated between zero and 360. Increasing the angle rotates the polygon clockwise. You can specify the angle of a graphic that is not a regular polygon, but it has no effect on the graphic's appearance.

An image can be rotated between zero and 360. Increasing the angle rotates the image counterclockwise. Unlike the rotate command, the angle property affects only the screen display of the image, not the actual picture data in it. Changing an image's angle does not change the imageData of the image. Repeated changes to the angle property, unlike repeated uses of the rotate command, do not degrade the image's quality. The rotate command cannot be used on a referenced image, but the angle of a referenced image can be set.

By default, oval graphics display their entire arc from zero to 360, forming a complete oval. You can use the angle and arcAngle properties to specify a portion of the oval to be displayed. The angle property determines the starting point of the arc. Zero is at the right edge, 3 o'clock. Increasing the angle moves the starting point counter-clockwise around the arc. (The direction of rotation for an arc is opposite the direction of rotation for a polygon.) For example, if the angle is 90, the arc starts at the top edge of the graphic's rectangle, 12 o'clock.

For an oval, the angle is the same as the startAngle. Changing one changes the other.

Changes: The ability to set the angle of an image was introduced in version 2.0. In previous versions, the angle property applied only to graphics.

See also: image, graphic, imageData, properties, arcAngle & startAngle.

Advertisement