2013-10-02 00:16:40 +00:00
<!DOCTYPE html>
< html lang = "en" >
< head >
< meta charset = "utf-8" >
< title > Phaser Class: Camera< / title >
<!-- [if lt IE 9]>
< script src = "//html5shiv.googlecode.com/svn/trunk/html5.js" > < / script >
<![endif]-->
< link type = "text/css" rel = "stylesheet" href = "styles/sunlight.default.css" >
< link type = "text/css" rel = "stylesheet" href = "styles/site.cerulean.css" >
< / head >
< body >
< div class = "container-fluid" >
< div class = "navbar navbar-fixed-top navbar-inverse" >
< div class = "navbar-inner" >
< a class = "brand" href = "index.html" > Phaser< / a >
< ul class = "nav" >
< li class = "dropdown" >
< a href = "modules.list.html" class = "dropdown-toggle" data-toggle = "dropdown" > Modules< b
class="caret">< / b > < / a >
< ul class = "dropdown-menu " >
< li >
< a href = "module-Phaser.html" > Phaser< / a >
< / li >
2013-10-02 11:11:22 +00:00
< li >
< a href = "PluginManager.html" > PluginManager< / a >
< / li >
2013-10-02 00:16:40 +00:00
< / ul >
< / li >
< li class = "dropdown" >
< a href = "classes.list.html" class = "dropdown-toggle" data-toggle = "dropdown" > Classes< b
class="caret">< / b > < / a >
< ul class = "dropdown-menu " >
< li >
< a href = "Phaser.Animation.html" > Animation< / a >
< / li >
< li >
< a href = "Phaser.Animation.Frame.html" > Frame< / a >
< / li >
< li >
< a href = "Phaser.Animation.FrameData.html" > FrameData< / a >
< / li >
< li >
< a href = "Phaser.Animation.Parser.html" > Parser< / a >
< / li >
< li >
< a href = "Phaser.AnimationManager.html" > AnimationManager< / a >
< / li >
< li >
< a href = "Phaser.Camera.html" > Camera< / a >
< / li >
2013-10-02 11:11:22 +00:00
< li >
< a href = "Phaser.Circle.html" > Circle< / a >
< / li >
2013-10-02 00:16:40 +00:00
< li >
< a href = "Phaser.Game.html" > Game< / a >
< / li >
< li >
< a href = "Phaser.Group.html" > Group< / a >
< / li >
2013-10-02 12:18:58 +00:00
< li >
< a href = "Phaser.Input.html" > Input< / a >
< / li >
2013-10-02 11:11:22 +00:00
< li >
< a href = "Phaser.LinkedList.html" > LinkedList< / a >
< / li >
< li >
< a href = "PluginManager-Phaser.PluginManager.html" > PluginManager< / a >
< / li >
< li >
< a href = "Phaser.Plugin.html" > Plugin< / a >
< / li >
< li >
< a href = "Phaser.Point.html" > Point< / a >
< / li >
< li >
< a href = "Phaser.Rectangle.html" > Rectangle< / a >
< / li >
< li >
< a href = "Phaser.Signal.html" > Signal< / a >
< / li >
< li >
< a href = "Phaser.Stage.html" > Stage< / a >
< / li >
< li >
< a href = "Phaser.State.html" > State< / a >
< / li >
< li >
< a href = "Phaser.StateManager.html" > StateManager< / a >
< / li >
< li >
< a href = "Phaser.World.html" > World< / a >
< / li >
< li >
< a href = "SignalBinding.html" > SignalBinding< / a >
< / li >
2013-10-02 00:16:40 +00:00
< / ul >
< / li >
< / ul >
< / div >
< / div >
< div class = "row-fluid" >
< div class = "span8" >
< div id = "main" >
< h1 class = "page-title" > Class: Camera< / h1 >
< section >
< header >
< h2 >
Camera
< / h2 >
< div class = "class-description" > < p > Phaser.Camera< / p > < / div >
< / header >
< article >
< div class = "container-overview" >
< dt >
< h4 class = "name" id = "Camera" > < span class = "type-signature" > < / span > new Camera< span class = "signature" > (game, id, x, y, width, height)< / span > < span class = "type-signature" > < / span > < / h4 >
< / dt >
< dd >
< div class = "description" >
< p > A Camera is your view into the game world. It has a position and size and renders only those objects within its field of view.
The game automatically creates a single Stage sized camera on boot. Move the camera around the world with Phaser.Camera.x/y< / p >
< / div >
< h5 > Parameters:< / h5 >
< table class = "params table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > game< / code > < / td >
< td class = "type" >
< span class = "param-type" > < a href = "Phaser.Game.html" > Phaser.Game< / a > < / span >
< / td >
< td class = "description last" > < p > Game reference to the currently running game.< / p > < / td >
< / tr >
< tr >
< td class = "name" > < code > id< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "description last" > < p > Not being used at the moment, will be when Phaser supports multiple camera< / p > < / td >
< / tr >
< tr >
< td class = "name" > < code > x< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "description last" > < p > Position of the camera on the X axis< / p > < / td >
< / tr >
< tr >
< td class = "name" > < code > y< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "description last" > < p > Position of the camera on the Y axis< / p > < / td >
< / tr >
< tr >
< td class = "name" > < code > width< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "description last" > < p > The width of the view rectangle< / p > < / td >
< / tr >
< tr >
< td class = "name" > < code > height< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "description last" > < p > The height of the view rectangle< / p > < / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "Camera.js.html" > core/Camera.js< / a > , < a href = "Camera.js.html#sunlight-1-line-22" > line 22< / a >
< / li > < / ul > < / dd >
< / dl >
< / dd >
< / div >
< h3 class = "subsection-title" > Members< / h3 >
< dl >
< dt >
< h4 class = "name" id = "FOLLOW_LOCKON" > < span class = "type-signature" > < static, constant> < / span > FOLLOW_LOCKON< span class = "type-signature" > :number< / span > < / h4 >
< / dt >
< dd >
< h5 > Type:< / h5 >
< ul >
< li >
< span class = "param-type" > number< / span >
< / li >
< / ul >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "Camera.js.html" > core/Camera.js< / a > , < a href = "Camera.js.html#sunlight-1-line-89" > line 89< / a >
< / li > < / ul > < / dd >
< / dl >
< / dd >
< dt >
< h4 class = "name" id = "FOLLOW_PLATFORMER" > < span class = "type-signature" > < static, constant> < / span > FOLLOW_PLATFORMER< span class = "type-signature" > :number< / span > < / h4 >
< / dt >
< dd >
< h5 > Type:< / h5 >
< ul >
< li >
< span class = "param-type" > number< / span >
< / li >
< / ul >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "Camera.js.html" > core/Camera.js< / a > , < a href = "Camera.js.html#sunlight-1-line-95" > line 95< / a >
< / li > < / ul > < / dd >
< / dl >
< / dd >
< dt >
< h4 class = "name" id = "FOLLOW_TOPDOWN" > < span class = "type-signature" > < static, constant> < / span > FOLLOW_TOPDOWN< span class = "type-signature" > :number< / span > < / h4 >
< / dt >
< dd >
< h5 > Type:< / h5 >
< ul >
< li >
< span class = "param-type" > number< / span >
< / li >
< / ul >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "Camera.js.html" > core/Camera.js< / a > , < a href = "Camera.js.html#sunlight-1-line-101" > line 101< / a >
< / li > < / ul > < / dd >
< / dl >
< / dd >
< dt >
< h4 class = "name" id = "FOLLOW_TOPDOWN_TIGHT" > < span class = "type-signature" > < static, constant> < / span > FOLLOW_TOPDOWN_TIGHT< span class = "type-signature" > :number< / span > < / h4 >
< / dt >
< dd >
< h5 > Type:< / h5 >
< ul >
< li >
< span class = "param-type" > number< / span >
< / li >
< / ul >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "Camera.js.html" > core/Camera.js< / a > , < a href = "Camera.js.html#sunlight-1-line-107" > line 107< / a >
< / li > < / ul > < / dd >
< / dl >
< / dd >
< dt >
< h4 class = "name" id = "atLimit" > < span class = "type-signature" > < / span > atLimit< span class = "type-signature" > < / span > < / h4 >
< / dt >
< dd >
< dl class = "details" >
< h5 class = "subsection-title" > Properties:< / h5 >
< dl >
< table class = "props table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > atLimit< / code > < / td >
< td class = "type" >
< span class = "param-type" > boolean< / span >
< / td >
< td class = "description last" > < p > Whether this camera is flush with the World Bounds or not.< / p > < / td >
< / tr >
< / tbody >
< / table >
< / dl >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "Camera.js.html" > core/Camera.js< / a > , < a href = "Camera.js.html#sunlight-1-line-68" > line 68< / a >
< / li > < / ul > < / dd >
< / dl >
< / dd >
< dt >
< h4 class = "name" id = "deadzone" > < span class = "type-signature" > < / span > deadzone< span class = "type-signature" > < / span > < / h4 >
< / dt >
< dd >
< dl class = "details" >
< h5 class = "subsection-title" > Properties:< / h5 >
< dl >
< table class = "props table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > deadzone< / code > < / td >
< td class = "type" >
2013-10-02 11:11:22 +00:00
< span class = "param-type" > < a href = "Phaser.Rectangle.html" > Phaser.Rectangle< / a > < / span >
2013-10-02 00:16:40 +00:00
< / td >
< td class = "description last" > < p > Moving inside this Rectangle will not cause camera moving.< / p > < / td >
< / tr >
< / tbody >
< / table >
< / dl >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "Camera.js.html" > core/Camera.js< / a > , < a href = "Camera.js.html#sunlight-1-line-57" > line 57< / a >
< / li > < / ul > < / dd >
< / dl >
< / dd >
< dt >
< h4 class = "name" id = "game" > < span class = "type-signature" > < / span > game< span class = "type-signature" > < / span > < / h4 >
< / dt >
< dd >
< dl class = "details" >
< h5 class = "subsection-title" > Properties:< / h5 >
< dl >
< table class = "props table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > game< / code > < / td >
< td class = "type" >
< span class = "param-type" > < a href = "Phaser.Game.html" > Phaser.Game< / a > < / span >
< / td >
< td class = "description last" > < p > A reference to the currently running Game.< / p > < / td >
< / tr >
< / tbody >
< / table >
< / dl >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "Camera.js.html" > core/Camera.js< / a > , < a href = "Camera.js.html#sunlight-1-line-27" > line 27< / a >
< / li > < / ul > < / dd >
< / dl >
< / dd >
< dt >
< h4 class = "name" id = "height" > < span class = "type-signature" > < / span > height< span class = "type-signature" > < / span > < / h4 >
< / dt >
< dd >
< div class = "description" >
< p > The Cameras height. By default this is the same as the Game size and should not be adjusted for now.< / p >
< / div >
< dl class = "details" >
< h5 class = "subsection-title" > Properties:< / h5 >
< dl >
< table class = "props table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > height< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "description last" > < p > Gets or sets the cameras height.< / p > < / td >
< / tr >
< / tbody >
< / table >
< / dl >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "Camera.js.html" > core/Camera.js< / a > , < a href = "Camera.js.html#sunlight-1-line-337" > line 337< / a >
< / li > < / ul > < / dd >
< / dl >
< / dd >
< dt >
< h4 class = "name" id = "id" > < span class = "type-signature" > < / span > id< span class = "type-signature" > < / span > < / h4 >
< / dt >
< dd >
< dl class = "details" >
< h5 class = "subsection-title" > Properties:< / h5 >
< dl >
< table class = "props table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > id< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "description last" > < p > Reserved for future multiple camera set-ups.< / p > < / td >
< / tr >
< / tbody >
< / table >
< / dl >
< dt class = "tag-default" > Default Value:< / dt >
< dd class = "tag-default" > < ul class = "dummy" > < li > 0< / li > < / ul > < / dd >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "Camera.js.html" > core/Camera.js< / a > , < a href = "Camera.js.html#sunlight-1-line-38" > line 38< / a >
< / li > < / ul > < / dd >
< / dl >
< / dd >
< dt >
< h4 class = "name" id = "screenView" > < span class = "type-signature" > < / span > screenView< span class = "type-signature" > < / span > < / h4 >
< / dt >
< dd >
< dl class = "details" >
< h5 class = "subsection-title" > Properties:< / h5 >
< dl >
< table class = "props table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > screenView< / code > < / td >
< td class = "type" >
2013-10-02 11:11:22 +00:00
< span class = "param-type" > < a href = "Phaser.Rectangle.html" > Phaser.Rectangle< / a > < / span >
2013-10-02 00:16:40 +00:00
< / td >
< td class = "description last" > < p > Used by Sprites to work out Camera culling.< / p > < / td >
< / tr >
< / tbody >
< / table >
< / dl >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "Camera.js.html" > core/Camera.js< / a > , < a href = "Camera.js.html#sunlight-1-line-52" > line 52< / a >
< / li > < / ul > < / dd >
< / dl >
< / dd >
< dt >
< h4 class = "name" id = "target" > < span class = "type-signature" > < / span > target< span class = "type-signature" > < / span > < / h4 >
< / dt >
< dd >
< dl class = "details" >
< h5 class = "subsection-title" > Properties:< / h5 >
< dl >
< table class = "props table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > target< / code > < / td >
< td class = "type" >
< span class = "param-type" > Phaser.Sprite< / span >
< / td >
< td class = "description last" > < p > If the camera is tracking a Sprite, this is a reference to it, otherwise null.< / p > < / td >
< / tr >
< / tbody >
< / table >
< / dl >
< dt class = "tag-default" > Default Value:< / dt >
< dd class = "tag-default" > < ul class = "dummy" > < li > null< / li > < / ul > < / dd >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "Camera.js.html" > core/Camera.js< / a > , < a href = "Camera.js.html#sunlight-1-line-74" > line 74< / a >
< / li > < / ul > < / dd >
< / dl >
< / dd >
< dt >
< h4 class = "name" id = "view" > < span class = "type-signature" > < / span > view< span class = "type-signature" > < / span > < / h4 >
< / dt >
< dd >
< div class = "description" >
< p > Camera view.
The view into the world we wish to render (by default the game dimensions).
The x/y values are in world coordinates, not screen coordinates, the width/height is how many pixels to render.
Objects outside of this view are not rendered (unless set to ignore the Camera, i.e. UI?).< / p >
< / div >
< dl class = "details" >
< h5 class = "subsection-title" > Properties:< / h5 >
< dl >
< table class = "props table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > view< / code > < / td >
< td class = "type" >
2013-10-02 11:11:22 +00:00
< span class = "param-type" > < a href = "Phaser.Rectangle.html" > Phaser.Rectangle< / a > < / span >
2013-10-02 00:16:40 +00:00
< / td >
< td class = "description last" > < / td >
< / tr >
< / tbody >
< / table >
< / dl >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "Camera.js.html" > core/Camera.js< / a > , < a href = "Camera.js.html#sunlight-1-line-47" > line 47< / a >
< / li > < / ul > < / dd >
< / dl >
< / dd >
< dt >
< h4 class = "name" id = "visible" > < span class = "type-signature" > < / span > visible< span class = "type-signature" > < / span > < / h4 >
< / dt >
< dd >
< dl class = "details" >
< h5 class = "subsection-title" > Properties:< / h5 >
< dl >
< table class = "props table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > visible< / code > < / td >
< td class = "type" >
< span class = "param-type" > boolean< / span >
< / td >
< td class = "description last" > < p > Whether this camera is visible or not.< / p > < / td >
< / tr >
< / tbody >
< / table >
< / dl >
< dt class = "tag-default" > Default Value:< / dt >
< dd class = "tag-default" > < ul class = "dummy" > < li > true< / li > < / ul > < / dd >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "Camera.js.html" > core/Camera.js< / a > , < a href = "Camera.js.html#sunlight-1-line-63" > line 63< / a >
< / li > < / ul > < / dd >
< / dl >
< / dd >
< dt >
< h4 class = "name" id = "width" > < span class = "type-signature" > < / span > width< span class = "type-signature" > < / span > < / h4 >
< / dt >
< dd >
< div class = "description" >
< p > The Cameras width. By default this is the same as the Game size and should not be adjusted for now.< / p >
< / div >
< dl class = "details" >
< h5 class = "subsection-title" > Properties:< / h5 >
< dl >
< table class = "props table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > width< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "description last" > < p > Gets or sets the cameras width.< / p > < / td >
< / tr >
< / tbody >
< / table >
< / dl >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "Camera.js.html" > core/Camera.js< / a > , < a href = "Camera.js.html#sunlight-1-line-320" > line 320< / a >
< / li > < / ul > < / dd >
< / dl >
< / dd >
< dt >
< h4 class = "name" id = "world" > < span class = "type-signature" > < / span > world< span class = "type-signature" > < / span > < / h4 >
< / dt >
< dd >
< dl class = "details" >
< h5 class = "subsection-title" > Properties:< / h5 >
< dl >
< table class = "props table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > world< / code > < / td >
< td class = "type" >
2013-10-02 11:11:22 +00:00
< span class = "param-type" > < a href = "Phaser.World.html" > Phaser.World< / a > < / span >
2013-10-02 00:16:40 +00:00
< / td >
< td class = "description last" > < p > A reference to the game world.< / p > < / td >
< / tr >
< / tbody >
< / table >
< / dl >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "Camera.js.html" > core/Camera.js< / a > , < a href = "Camera.js.html#sunlight-1-line-32" > line 32< / a >
< / li > < / ul > < / dd >
< / dl >
< / dd >
< dt >
< h4 class = "name" id = "x" > < span class = "type-signature" > < / span > x< span class = "type-signature" > < / span > < / h4 >
< / dt >
< dd >
< div class = "description" >
< p > The Cameras x coordinate. This value is automatically clamped if it falls outside of the World bounds.< / p >
< / div >
< dl class = "details" >
< h5 class = "subsection-title" > Properties:< / h5 >
< dl >
< table class = "props table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > x< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "description last" > < p > Gets or sets the cameras x position.< / p > < / td >
< / tr >
< / tbody >
< / table >
< / dl >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "Camera.js.html" > core/Camera.js< / a > , < a href = "Camera.js.html#sunlight-1-line-284" > line 284< / a >
< / li > < / ul > < / dd >
< / dl >
< / dd >
< dt >
< h4 class = "name" id = "y" > < span class = "type-signature" > < / span > y< span class = "type-signature" > < / span > < / h4 >
< / dt >
< dd >
< div class = "description" >
< p > The Cameras y coordinate. This value is automatically clamped if it falls outside of the World bounds.< / p >
< / div >
< dl class = "details" >
< h5 class = "subsection-title" > Properties:< / h5 >
< dl >
< table class = "props table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > y< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "description last" > < p > Gets or sets the cameras y position.< / p > < / td >
< / tr >
< / tbody >
< / table >
< / dl >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "Camera.js.html" > core/Camera.js< / a > , < a href = "Camera.js.html#sunlight-1-line-302" > line 302< / a >
< / li > < / ul > < / dd >
< / dl >
< / dd >
< / dl >
< h3 class = "subsection-title" > Methods< / h3 >
< dl >
< dt >
< h4 class = "name" id = "checkWorldBounds" > < span class = "type-signature" > < / span > checkWorldBounds< span class = "signature" > ()< / span > < span class = "type-signature" > < / span > < / h4 >
< / dt >
< dd >
< div class = "description" >
< p > Method called to ensure the camera doesn't venture outside of the game world.< / p >
< / div >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "Camera.js.html" > core/Camera.js< / a > , < a href = "Camera.js.html#sunlight-1-line-214" > line 214< / a >
< / li > < / ul > < / dd >
< / dl >
< / dd >
< dt >
< h4 class = "name" id = "focusOnXY" > < span class = "type-signature" > < / span > focusOnXY< span class = "signature" > (x, y)< / span > < span class = "type-signature" > < / span > < / h4 >
< / dt >
< dd >
< div class = "description" >
< p > Move the camera focus to a location instantly.< / p >
< / div >
< h5 > Parameters:< / h5 >
< table class = "params table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > x< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "description last" > < p > X position.< / p > < / td >
< / tr >
< tr >
< td class = "name" > < code > y< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "description last" > < p > Y position.< / p > < / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "Camera.js.html" > core/Camera.js< / a > , < a href = "Camera.js.html#sunlight-1-line-151" > line 151< / a >
< / li > < / ul > < / dd >
< / dl >
< / dd >
< dt >
< h4 class = "name" id = "follow" > < span class = "type-signature" > < / span > follow< span class = "signature" > (target, < span class = "optional" > style< / span > )< / span > < span class = "type-signature" > < / span > < / h4 >
< / dt >
< dd >
< div class = "description" >
< p > Tells this camera which sprite to follow.< / p >
< / div >
< h5 > Parameters:< / h5 >
< table class = "params table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th > Argument< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > target< / code > < / td >
< td class = "type" >
< span class = "param-type" > Phaser.Sprite< / span >
< / td >
< td class = "attributes" >
< / td >
< td class = "description last" > < p > The object you want the camera to track. Set to null to not follow anything.< / p > < / td >
< / tr >
< tr >
< td class = "name" > < code > style< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "attributes" >
< optional>< br >
< / td >
< td class = "description last" > < p > Leverage one of the existing " deadzone" presets. If you use a custom deadzone, ignore this parameter and manually specify the deadzone after calling follow().< / p > < / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "Camera.js.html" > core/Camera.js< / a > , < a href = "Camera.js.html#sunlight-1-line-111" > line 111< / a >
< / li > < / ul > < / dd >
< / dl >
< / dd >
< dt >
< h4 class = "name" id = "setPosition" > < span class = "type-signature" > < / span > setPosition< span class = "signature" > (x, y)< / span > < span class = "type-signature" > < / span > < / h4 >
< / dt >
< dd >
< div class = "description" >
< p > A helper function to set both the X and Y properties of the camera at once
without having to use game.camera.x and game.camera.y.< / p >
< / div >
< h5 > Parameters:< / h5 >
< table class = "params table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > x< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "description last" > < p > X position.< / p > < / td >
< / tr >
< tr >
< td class = "name" > < code > y< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "description last" > < p > Y position.< / p > < / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "Camera.js.html" > core/Camera.js< / a > , < a href = "Camera.js.html#sunlight-1-line-252" > line 252< / a >
< / li > < / ul > < / dd >
< / dl >
< / dd >
< dt >
< h4 class = "name" id = "setSize" > < span class = "type-signature" > < / span > setSize< span class = "signature" > (width, height)< / span > < span class = "type-signature" > < / span > < / h4 >
< / dt >
< dd >
< div class = "description" >
< p > Sets the size of the view rectangle given the width and height in parameters.< / p >
< / div >
< h5 > Parameters:< / h5 >
< table class = "params table table-striped" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > width< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "description last" > < p > The desired width.< / p > < / td >
< / tr >
< tr >
< td class = "name" > < code > height< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "description last" > < p > The desired height.< / p > < / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "Camera.js.html" > core/Camera.js< / a > , < a href = "Camera.js.html#sunlight-1-line-268" > line 268< / a >
< / li > < / ul > < / dd >
< / dl >
< / dd >
< dt >
< h4 class = "name" id = "update" > < span class = "type-signature" > < / span > update< span class = "signature" > ()< / span > < span class = "type-signature" > < / span > < / h4 >
< / dt >
< dd >
< div class = "description" >
< p > Update focusing and scrolling.< / p >
< / div >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "Camera.js.html" > core/Camera.js< / a > , < a href = "Camera.js.html#sunlight-1-line-164" > line 164< / a >
< / li > < / ul > < / dd >
< / dl >
< / dd >
< / dl >
< / article >
< / section >
< / div >
< div class = "clearfix" > < / div >
< footer >
< span class = "copyright" >
Phaser Copyright © 2012-2013 Photon Storm Ltd.
< / span >
< br / >
< span class = "jsdoc-message" >
Documentation generated by < a href = "https://github.com/jsdoc3/jsdoc" > JSDoc 3.2.0-dev< / a >
2013-10-02 12:18:58 +00:00
on Wed Oct 02 2013 12:28:25 GMT+0100 (BST) using the < a href = "https://github.com/terryweiss/docstrap" > DocStrap template< / a > .
2013-10-02 00:16:40 +00:00
< / span >
< / footer >
< / div >
< div class = "span3" >
< div id = "toc" > < / div >
< / div >
< br clear = "both" >
< / div >
< / div >
< script src = "scripts/sunlight.js" > < / script >
< script src = "scripts/sunlight.javascript.js" > < / script >
< script src = "scripts/sunlight-plugin.doclinks.js" > < / script >
< script src = "scripts/sunlight-plugin.linenumbers.js" > < / script >
< script src = "scripts/sunlight-plugin.menu.js" > < / script >
< script src = "scripts/jquery.min.js" > < / script >
< script src = "scripts/jquery.scrollTo.js" > < / script >
< script src = "scripts/jquery.localScroll.js" > < / script >
< script src = "scripts/bootstrap-dropdown.js" > < / script >
< script src = "scripts/toc.js" > < / script >
< script > Sunlight . highlightAll ( { lineNumbers : true , showMenu : true , enableDoclinks : true } ) ; < / script >
< script >
$( function () {
$( "#toc" ).toc( {
selectors : "h1,h2,h3,h4",
showAndHide : false,
scrollTo : 60
} );
$( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" );
$( "#main span[id^='toc']" ).addClass( "toc-shim" );
} );
< / script >
< / body >
< / html >