ViewControl.new()

   
Type function
Library wattageTileEngine.ViewControl.*
Return value ViewControl
Keywords  
See also  

Overview

This function creates a new instance of ViewControl.

Syntax

ViewControl.new( params )
params (required)

Table. Contains all required inputs. See Required Properties below.

Required Properties

The params table contains the following properties:

parentGroup (required)

DisplayObject. The parent DisplayGroup for the view control.

centerX (required)

Number. The X position for the center of the view control.

centerY (required)

Number. The Y position for the center of the view control.

pixelWidth (required)

Number. The width of the control in pixels.

pixelHeight (required)

Number. The height of the control in pixels.

tileEngineInstance (required)

TileEngine. The instance of the tile engine that this view control will be displaying.

useContainer (optional)

Boolean. Setting this value to true will result in cropping out the portion of tiles that extend outside the pixel width/height. In a full screen application, this is not necessary. Thus the default value for this parameter is false. This can be set to true when the view control will not be the full screen. However, setting this to true does result in a performance hit.

Examples

local TileEngine = require "plugin.wattageTileEngine"

tileEngineViewControl = TileEngine.ViewControl.new({
    parentGroup = sceneGroup,
    centerX = display.contentCenterX,
    centerY = display.contentCenterY,
    pixelWidth = display.actualContentWidth,
    pixelHeight = display.actualContentHeight,
    tileEngineInstance = tileEngineInstance
})