Skip to content

Commit

Permalink
added viewPort property
Browse files Browse the repository at this point in the history
  • Loading branch information
racarone committed Nov 27, 2015
1 parent 621a99e commit d866848
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sparrow/src/Classes/SPViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ typedef void (^SPRootCreatedBlock)(SPSprite *root);
/// custom subclass to this property.
@property (nonatomic, strong) SPTouchProcessor *touchProcessor;

/// The viewport into which Sparrow contents will be rendered. This is anaglagous to the `frame`
/// property of the current view.
@property (nonatomic, assign) SPRectangle *viewPort;

/// The current content scale factor, i.e. the ratio between display resolution and stage size.
@property (nonatomic, readonly) float contentScaleFactor;

Expand Down
6 changes: 6 additions & 0 deletions sparrow/src/Classes/SPViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,12 @@ - (void)setRendering:(BOOL)rendering
}
}

- (void)setViewPort:(SPRectangle *)viewPort
{
_internalView.frame = viewPort.convertToCGRect;
[_viewPort copyFromRectangle:viewPort];
}

- (void)setMultitouchEnabled:(BOOL)multitouchEnabled
{
#if !TARGET_OS_TV
Expand Down

0 comments on commit d866848

Please sign in to comment.