SKShapeNode(TKRendererCompatibility) Category Reference

Declared in TKRendererCompatibility.h

Overview

SKShapeNode category.

@note: SKShapeNode is a debugging tool. It should not be used for drawing regular game graphics as it is rather inefficient.

– tk_drawRect:fillColor:borderColor:

Creates a CGPath from the given rect and assigns it to the shape node.

- (void)tk_drawRect:(CGRect)rect fillColor:(nonnull TKColor *)fillColor borderColor:(nonnull TKColor *)borderColor

Parameters

rect

The rectangle to draw.

fillColor

The interior fill color of the rectangle.

borderColor

The line color of the rectangle.

Declared In

TKRendererCompatibility.h

– tk_drawLineFrom:to:color:

Creates a CGPath that forms a line segment between two points and assigns it to the shape node.

- (void)tk_drawLineFrom:(CGPoint)start to:(CGPoint)end color:(nonnull TKColor *)color

Parameters

start

One point of the line segment.

end

The other point of the line segment.

color

The line color.

Declared In

TKRendererCompatibility.h

– tk_drawClosedPolygonWithPoints:count:fillColor:borderColor:

Creates a CGPath that forms a closed polygon and assigns it to the shape node.

- (void)tk_drawClosedPolygonWithPoints:(nonnull CGPoint *)points count:(NSUInteger)pointCount fillColor:(nonnull TKColor *)fillColor borderColor:(nonnull TKColor *)borderColor

Parameters

points

A C memory buffer or C array containing at least 3 or more points that form the polygon.

pointCount

The number of points in the points buffer/array.

fillColor

The polygon’s interior fill color.

borderColor

The polygon’s outline color.

Declared In

TKRendererCompatibility.h