Inherits from GSElement : NSObject

Overview

This class defines the component object. It is a subclass of GSElement

Properties

anchor

If more than one anchor/_anchor pair would match, this property can be used to set the anchor to use for automatic alignment

@property (copy, nonatomic) NSString *anchor

Discussion

This can be set from the anchor button in the component info box in the UI

component

The base glyph

@property (unsafe_unretained, readonly) GSGlyph *component

Discussion

This is readonly. To set the base glyph use componentName: newBaseGlyph.name.

componentName

components are referenced by the glyph name.

@property (strong, nonatomic) NSString *componentName

Discussion

If you set the componentName the component value is set and this is used during runtime. So you can change the glyph name of the base glyph during runtime.

pieceSettings

The instance settings do Smart Components.

@property (strong, nonatomic) GSNotifyingDictionary *pieceSettings

Discussion

It is a dictionary containing the parameter names as keys and the interpolation position as value.

{
    Height = 70;
    Width = 70;
}

See Also

transformStruct

The transformation of the component.

@property (assign, nonatomic) NSAffineTransformStruct transformStruct

Discussion

The values of the struct are: {m11, m12, m21, m22, tX, tY} this is equivalent to the glif attributes {xScale, xyScale, yxScale, yScale, xOffset, yOffset} in the same order. The initial value is {1,0,0,1,0,0}.

Instance Methods

bezierPath

The bezierPath of the component. It is already transformed.

- (NSBezierPath *)bezierPath

bounds

The bounds of the components

- (NSRect)bounds

Return Value

the bounds

componentLayer

The Layer that the component is linked to.

- (GSLayer *)componentLayer

Return Value

the Layer that represents the component.

Discussion

The is usually just the layer from the components glyph but might be the computed result of a smart component.

decompose

Decomposes the component to the containing Layer

- (void)decompose

Discussion

It need to parent property set correctly. It calls [_parent decomposeComponent:self].

getScaleX:scaleY:rotation:

Retunes on reference the scale and rotation of the component

- (void)getScaleX:(CGFloat *)sX scaleY:(CGFloat *)sY rotation:(CGFloat *)R

Parameters

sX

On return, the horizontal scale

sY

On return, the vertical scale

R

On return, the rotation

Discussion

This will take apart the transformStruct.

This might not work correctly if you have applied a skew transform.

intersects:

If the component overlaps with the OtherComponent

- (BOOL)intersects:(GSComponent *)OtherComponent

Parameters

OtherComponent

The OtherComponent to test overlap.

Return Value

Returns YES if both components do overlap, otherwise NO.

makeFirst

It makes the component the first in the containing Layer

- (void)makeFirst

Discussion

It need to parent property set correctly. It calls [_parent makeFirstComponent:self].

openBezierPath

The bezierPath of open paths of the component. It is already transformed.

- (NSBezierPath *)openBezierPath

setScaleX:scaleY:rotation:

Sets the transformation.

- (void)setScaleX:(CGFloat)sX scaleY:(CGFloat)sY rotation:(CGFloat)R

Parameters

sX

the horizontal scale

sY

the vertical scale

R

the rotation