Package | sekati.ui |
Class | public class Viewport |
Inheritance | Viewport flash.events.EventDispatcher |
Canvas.stage
. A
ViewportEvent.RENDER
is dispatched when the Viewport is updated. This condenses StageDisplay
events and assists in liquid layouts which require a proportional relationship within a Viewport.
// Note: Document class extends sekati.display.Canvas // initialize the StageDisplay StageDisplay.$.init( ); // initialize a viewport with a 25 pixel minimum footer. Viewport.$.init( this, 25 ); Viewport.$.render( );
See also
Property | Defined by | ||
---|---|---|---|
$ : Viewport
[static][read-only]
Shorthand singleton accessor getter
| Viewport | ||
bottom : int [read-only]
Return bottom of the visible viewport.
| Viewport | ||
bottomBox : Shape [read-only]
Return the bottom letterbox shape.
| Viewport | ||
centerx : int [read-only]
Return viewport center x position.
| Viewport | ||
centery : int [read-only]
Return viewport center y position.
| Viewport | ||
height : int [read-only]
Return viewport height.
| Viewport | ||
proportionHeight : uint [read-only]
Return ratio proportional height.
| Viewport | ||
proportionWidth : uint [read-only]
Return ratio proportional width.
| Viewport | ||
ratio : Number [read-only]
Return viewport ratio.
| Viewport | ||
top : int [read-only]
Return top of the visible viewport.
| Viewport | ||
topBox : Shape [read-only]
Return the top letter box shape.
| Viewport | ||
viewport : Shape [read-only]
Return the viewport shape.
| Viewport | ||
width : int [read-only]
Return viewport width.
| Viewport | ||
x : int [read-only]
Return viewport x position.
| Viewport | ||
y : int [read-only]
Return viewport y position.
| Viewport |
Property | Defined by | ||
---|---|---|---|
_bb : Shape | Viewport | ||
BOTTOM_CONSTRAINT : uint | Viewport | ||
_instance : Viewport
[static]
| Viewport | ||
PROPORTION_HEIGHT : uint | Viewport | ||
PROPORTION_WIDTH : uint | Viewport | ||
RATIO : Number | Viewport | ||
_target : DisplayObjectContainer | Viewport | ||
_tb : Shape | Viewport | ||
_vp : Shape | Viewport |
Method | Defined by | ||
---|---|---|---|
Viewport($:SingletonEnforcer = null)
Viewport Singleton Constructor
| Viewport | ||
destroy():void
Destroy the Viewport
| Viewport | ||
[static]
Singleton Accessor
| Viewport | ||
init(target:DisplayObjectContainer, bottomConstraint:uint = 0, proportionWidth:uint = 16, proportionHeight:uint = 9, lbColor:int = 0x000000, vpColor:uint = 0xFFFFFF, lbVisible:Boolean = true, vpVisible:Boolean = false):void
Parameterized Viewport initialization.
| Viewport | ||
render(e:StageEvent = null):void
Update the Viewport confines and dispatch
ViewportEvent.RENDER . | Viewport |
$ | property |
$:Viewport
[read-only]Shorthand singleton accessor getter
Implementation public static function get $():Viewport
_bb | property |
protected var _bb:Shape
bottom | property |
bottom:int
[read-only]Return bottom of the visible viewport.
Implementation public function get bottom():int
bottomBox | property |
bottomBox:Shape
[read-only]Return the bottom letterbox shape.
Implementation public function get bottomBox():Shape
BOTTOM_CONSTRAINT | property |
protected var BOTTOM_CONSTRAINT:uint
centerx | property |
centerx:int
[read-only]Return viewport center x position.
Implementation public function get centerx():int
centery | property |
centery:int
[read-only]Return viewport center y position.
Implementation public function get centery():int
height | property |
height:int
[read-only]Return viewport height.
Implementation public function get height():int
_instance | property |
protected static var _instance:Viewport
proportionHeight | property |
proportionHeight:uint
[read-only]Return ratio proportional height.
Implementation public function get proportionHeight():uint
PROPORTION_HEIGHT | property |
protected var PROPORTION_HEIGHT:uint
proportionWidth | property |
proportionWidth:uint
[read-only]Return ratio proportional width.
Implementation public function get proportionWidth():uint
PROPORTION_WIDTH | property |
protected var PROPORTION_WIDTH:uint
ratio | property |
ratio:Number
[read-only]Return viewport ratio.
Implementation public function get ratio():Number
RATIO | property |
protected var RATIO:Number
_target | property |
protected var _target:DisplayObjectContainer
_tb | property |
protected var _tb:Shape
top | property |
top:int
[read-only]Return top of the visible viewport.
Implementation public function get top():int
topBox | property |
topBox:Shape
[read-only]Return the top letter box shape.
Implementation public function get topBox():Shape
viewport | property |
viewport:Shape
[read-only]Return the viewport shape.
Implementation public function get viewport():Shape
_vp | property |
protected var _vp:Shape
width | property |
width:int
[read-only]Return viewport width.
Implementation public function get width():int
x | property |
x:int
[read-only]Return viewport x position.
Implementation public function get x():int
y | property |
y:int
[read-only]Return viewport y position.
Implementation public function get y():int
Viewport | () | constructor |
public function Viewport($:SingletonEnforcer = null)
Viewport Singleton Constructor
Parameters$:SingletonEnforcer (default = null ) — SingletonEnforcer - internal to the AS file; the param prevents external instantiation without error.
|
destroy | () | method |
public function destroy():void
Destroy the Viewport
getInstance | () | method |
init | () | method |
public function init(target:DisplayObjectContainer, bottomConstraint:uint = 0, proportionWidth:uint = 16, proportionHeight:uint = 9, lbColor:int = 0x000000, vpColor:uint = 0xFFFFFF, lbVisible:Boolean = true, vpVisible:Boolean = false):void
Parameterized Viewport initialization.
Parameterstarget:DisplayObjectContainer — target viewport container object.
|
|
bottomConstraint:uint (default = 0 ) — defines the minimum bottom letter-box height.
|
|
proportionWidth:uint (default = 16 ) — proportional width of the viewport.
|
|
proportionHeight:uint (default = 9 ) — proportional height of the viewport.
|
|
lbColor:int (default = 0x000000 ) — letter-box color.
|
|
vpColor:uint (default = 0xFFFFFF ) — viewport color.
|
|
lbVisible:Boolean (default = true ) — display the letterbox DisplayObjects.
|
|
vpVisible:Boolean (default = false ) — display the viewport DisplayObject.
|
render | () | method |
public function render(e:StageEvent = null):void
Update the Viewport confines and dispatch ViewportEvent.RENDER
.
Note: This is not a true "render" but as it is generally related to liquid-layout scenarios in which the layout is "re-rendered" the name is semi-appropriate.
Parameterse:StageEvent (default = null )
|