SDLRectangle Class Reference

Section Contents

Overview

A struct describing a rectangle

-initWithX:y:width:height:

Create a Rectangle

Objective-C

- (instancetype)initWithX:(float)x
                        y:(float)y
                    width:(float)width
                   height:(float)height;

Swift

init!(x: Float, y: Float, width: Float, height: Float)

Parameters

x

The top-left x value

y

The top-left y value

width

The width

height

The height

Return Value

An new SDLRectangle object

-initWithCGRect:

Create a Rectangle from a CGRect

Objective-C

- (instancetype)initWithCGRect:(CGRect)rect;

Swift

init!(cgRect rect: CGRect)

Parameters

rect

The rectangle to use

Return Value

An new SDLRectangle object

x

The X-coordinate of the user control

Required, Float

Objective-C

@property (nonatomic, strong) NSNumber<SDLFloat> *x;

Swift

var x: (NSNumber & SDLFloat)! { get set }

y

The Y-coordinate of the user control

Required, Float

Objective-C

@property (nonatomic, strong) NSNumber<SDLFloat> *y;

Swift

var y: (NSNumber & SDLFloat)! { get set }

width

The width of the user control’s bounding rectangle

Required, Float

Objective-C

@property (nonatomic, strong) NSNumber<SDLFloat> *width;

Swift

var width: (NSNumber & SDLFloat)! { get set }

height

The height of the user control’s bounding rectangle

Required, Float

Objective-C

@property (nonatomic, strong) NSNumber<SDLFloat> *height;

Swift

var height: (NSNumber & SDLFloat)! { get set }