Wikitude ARchitect v2.0 API Documentation

Wikitude ARchitect > AR > radar
Filters

static Class radar

radar represents a seperate section on the screen which provides a 2-dimensional radar indicating where GeoObjects are located around the user.

The Singleton instance of the class will automatically be created on World startup and can be accessed via AR.radar.

The meaning of the various properties are described below, refer to the figure below for illustration.



Properties

background - ImageResource

Specifies the background of the radar.

centerX - float

Specifies the horizontal position of the center of the actual radar area. The value must be between 0 and 1 and specifies the center of the radar area with regards to the width of the background image. A value of 0.5 places the center of the radar area horizontally in the middle of the radar background image.

centerY - float

Specifies the vertical position of the center of the actual radar area. The value must be between 0 and 1 and specifies the center of the radar area with regards to the height of the background image. A value of 0.5 places the center of the radar area vertically in the middle of the radar background image.

enabled - boolean

enabled set to true enables the radar in the view, setting it to false disables it entirely.

Remark: The radar can only be displayed if all properties (the only exception being the northIndicator) is set to a valid value.

maxDistance - float

Specifies the maximum distance in meters that is covered in the radar. When set to x meters, only GeoObjects with a distance less or equal to x will be drawn in the radar. If the distance to a certain drawable is x, the drawable will be drawn on the boundary of the radar.

The value must either be positive, or undefined. In this case, maxDistance will automatically be calculated as the maximum distance of the GeoObjects in the scene, causing all GeoObjects to be visible in the radar.

northIndicator.image - ImageResource

Specifies the ImageResource used to indicate true north in the radar. The north indicator will be scaled with the same ratio as the radar background image is scaled, refer radar.width for details.

northIndicator.radius - float

Specifies the radius of the north indicator. As the north indicator moves as soon as the user starts turning around, northIndicator.radius indicates the distance of the north indicator image to the center of the radar area. The value must be between 0 and 1 and specifies the radius with regards to the width of the radar background image. A value of 0.45 scales the radius of the actual radar area to 45% of the entire width of the radar background image.

It is good practice to set the radius of the north indicator to a slightly higher value that the radar's radius. This allows the north indicator to not overlap with the radar area.

positionX - float

Specifies the position of the left edge of the radar background image. The value must be between 0 and 1. A value of 0 places the left edge of the radar background image on the left edge of the screen, 0.5 places the left edge horizontally in the middle of the screen.

positionY - float

Specifies the position of the top edge of the radar background image. The value must be between 0 and 1. A value of 0 places the top edge of the radar background image on the top edge of the screen, 0.5 places the top edge vertically in the middle of the screen.

radius - float

Specifies the radius of the actual radar area. The radar drawables will not be visible beyond that radius. The value must be between 0 and 1 and specifies the radius with regards to the width of the background image. A value of 0.4 scales the radius of the actual radar area to 40% of the entire width of the radar background image.

width - float

Specifies the width of the radar background image, in percent of the portrait screen width. The value must be between 0 and 1. A value of 0.1 sizes the radar background image in a way that the width of the image makes up 10% of the entire screen width.
The aspect ratio of the radar background image will not be changed, the height of the radar will thus be automatically calculated.

Methods

onClick

void onClick ( )
The trigger fires when the radar (the area taken up by the background image) has been clicked.

The trigger is null by default, and will thus result in no action executed when the trigger fires. A developer can add custom functionality by assigning a custom function to onClick.
Returns: void


Copyright © 2013 Wikitude GmbH. All rights reserved.