ISRenderer Protocol Reference

Conforms to NSObject
Declared in ISRenderer.h

Overview

Protocol used to represent a map Renderer.

group General

  rtoClass required method

The Renderer key (depending of the RTO classe).

@property (nonatomic, readonly) NSString *rtoClass

Declared In

ISRenderer.h

  priority required method

The current renderer priority (vertexZ equivalent in Cocos2d).

@property (nonatomic, readwrite) int priority

Declared In

ISRenderer.h

  currentMap required method

Current map setter.

@property (nonatomic, retain) ISMap *currentMap

Declared In

ISRenderer.h

RTO Management

– addRTO: required method

Method called to add an RTO.

- (Boolean)addRTO:(id<ISRTO>)rto

Parameters

rto

RTO to add.

Return Value

A boolean if the RTO was successfully added.

Declared In

ISRenderer.h

– addRTO:inZone: required method

Method called to add a RTO to a specific Zone.

- (Boolean)addRTO:(id<ISRTO>)rto inZone:(int)zoneId

Parameters

rto

RTO to add.

zoneId

Zone identifier to clear.

Return Value

A boolean if the RTO was successfully added.

Declared In

ISRenderer.h

– removeRTO: required method

Method called to remove an RTO.

- (void)removeRTO:(id<ISRTO>)rto

Parameters

rto

RTO to remove.

Declared In

ISRenderer.h

– removeRTO:fromZone: required method

Method called to remove a RTO from a specific Zone.

- (void)removeRTO:(id<ISRTO>)rto fromZone:(int)zoneId

Parameters

rto

RTO to remove.

zoneId

Zone identifier to clear.

Declared In

ISRenderer.h

– clear required method

Method called to clear the Renderer.

- (void)clear

Declared In

ISRenderer.h

– clearZone: required method

Method called to clear all the RTO of a specific Zone.

- (void)clearZone:(int)zoneId

Parameters

zoneId

Zone identifier to clear.

Declared In

ISRenderer.h

Rendering

– render2DWithLayer:andRatio:andOffset:andAngle: required method

Method called to draw the Renderer content (ie: ISRTO for more information). To obtain object position on screen, do (object_position_in_meter.x * aRatio + aOffset.x AND aOffset.y - object_position_in_meter.x * aRatio).

- (void)render2DWithLayer:(CCLayer *)layer andRatio:(double)ratio andOffset:(CGPoint)offset andAngle:(float)angle

Parameters

layer

The destination Cocos2d layer where this object should be added to.

ratio

The real/screen coord ratio, this is used to transform the object’s real coords into screen coords.

offset

In pixels, the offset from the (0, 0) of the drawing Cocos2d layer that should be added to this object coords.

angle

The offset angle in case a rotation should be done. The rotation is relative to the screen center (clockwise).

Discussion

Warning: Cocos2d coordinates system is reversed.

Declared In

ISRenderer.h

  displayEnabled required method

Boolean used to know if the Renderer rendering is activated.

@property (nonatomic, readwrite) Boolean displayEnabled

Declared In

ISRenderer.h

Touch

  touchEnabled required method

Boolean used to know if the Renderer touch is activated.

@property (nonatomic, readwrite) Boolean touchEnabled

Declared In

ISRenderer.h

  rtoDelegate required method

Related renderer touch delegate.

@property (weak) id<ISRTODelegate> rtoDelegate

Declared In

ISRenderer.h

– onTouchDown: required method

Method called when a touch down event occured.

- (Boolean)onTouchDown:(ISTouch *)touch

Parameters

touch

Object that contains iOS touch information.

Return Value

YES if it consume the event, else NO.

Discussion

Warning: Cocos2d coordinates system is reversed.

Declared In

ISRenderer.h

– onTouchMove: required method

Method called when a move event occured.

- (Boolean)onTouchMove:(ISTouch *)touch

Parameters

touch

Object that contains iOS touch information.

Return Value

YES if it consume the event, else NO.

Discussion

Warning: Cocos2d coordinates system is reversed.

Declared In

ISRenderer.h

– onTouchUp: required method

Method called when a touch up event occured.

- (Boolean)onTouchUp:(ISTouch *)touch

Parameters

touch

Object that contains iOS touch information.

Return Value

YES if it consume the event, else NO.

Discussion

Warning: Cocos2d coordinates system is reversed.

Declared In

ISRenderer.h

  renderMode

Current map render mode (2D or 3D).

@property (nonatomic, readwrite) ISERenderMode renderMode

Declared In

ISRenderer.h

– render3DWithScene:andRatio:andAngle:

Method called to handle 3D rendering stuff.

- (void)render3DWithScene:(CC3Scene *)scene andRatio:(float)ratio andAngle:(float)angle

Parameters

scene

Current 3D scene.

ratio

Current ratio (depending on the current zoom level).

angle

Current angle.

Declared In

ISRenderer.h

– getRTOsWithZoneId:

Method used to get all RTO from a given zone identifier.

- (NSArray *)getRTOsWithZoneId:(int)zoneId

Parameters

zoneId

Corresponding zone identifier.

Return Value

An array of all linked RTO (could be nil).

Declared In

ISRenderer.h