Package | stencyl.api.engine.scene |
Class | public class TerrainRegion |
Inheritance | TerrainRegion ![]() ![]() ![]() ![]() ![]() ![]() |
Property | Defined By | ||
---|---|---|---|
![]() | acceleration : FlxPoint
How fast the speed of this object is changing. | FlxObject | |
![]() | active : Boolean
If an object is not alive, the game loop will not automatically call update() on it. | FlxObject | |
![]() | alpha : Number
Set alpha to a number between 0 and 1 to change the opacity of the sprite. | FlxSprite | |
![]() | alwaysSimulate : Boolean | Actor | |
![]() | angle : Number
Set the angle of a sprite to rotate it. | FlxObject | |
![]() | angularAcceleration : Number
How fast the spin speed should change. | FlxObject | |
![]() | angularDrag : Number
Like drag but for spinning. | FlxObject | |
![]() | angularVelocity : Number
This is how fast you want this sprite to spin. | FlxObject | |
![]() | _animations : Array | FlxSprite | |
![]() | anims : Array | Actor | |
![]() | antialiasing : Boolean
Controls whether the object is smoothed when rotated, affects performance. | FlxSprite | |
![]() | blend : String
Blending modes, just like Photoshop!
E.g. | FlxSprite | |
![]() | body : b2Body | Actor | |
![]() | bodyDef : b2BodyDef | Actor | |
![]() | bottom : Number [read-only]
The Y coordinate of the bottom of the rectangle. | FlxRect | |
![]() | colHullX : FlxRect
These store a couple of useful numbers for speeding up collision resolution. | FlxObject | |
![]() | colHullY : FlxRect
These store a couple of useful numbers for speeding up collision resolution. | FlxObject | |
![]() | collideBottom : Boolean
Flag for direction collision resolution. | FlxObject | |
![]() | collideLeft : Boolean
Flag for direction collision resolution. | FlxObject | |
![]() | collideRight : Boolean
Flag for direction collision resolution. | FlxObject | |
![]() | collideTop : Boolean
Flag for direction collision resolution. | FlxObject | |
![]() | collisions : Dictionary | Actor | |
![]() | colOffsets : Array
An array of FlxPoint objects. | FlxObject | |
![]() | color : uint
Set color to a number in this format: 0xRRGGBB. | FlxSprite | |
![]() | colVector : FlxPoint
These store a couple of useful numbers for speeding up collision resolution. | FlxObject | |
![]() | contacts : Dictionary | Actor | |
![]() | currSprite : FlxSprite | Actor | |
![]() | dead : Boolean
Handy for tracking gameplay or animations. | FlxObject | |
![]() | defaultAnim : String | Actor | |
![]() | drag : FlxPoint
This isn't drag exactly, more like deceleration that is only applied
when acceleration is not affecting the sprite. | FlxObject | |
![]() | exists : Boolean
Kind of a global on/off switch for any objects descended from FlxObject. | FlxObject | |
![]() | facing : uint
Set facing using FlxSprite.LEFT,RIGHT,
UP, and DOWN to take advantage of
flipped sprites and/or just track player orientation more easily. | FlxSprite | |
![]() | filter : * | FlxSprite | |
![]() | finished : Boolean
Whether the current animation has finished its first (or only) loop. | FlxSprite | |
![]() | fixed : Boolean
If an object is 'fixed' in space, it will not budge when it collides with a not-fixed object. | FlxObject | |
![]() | frame : uint
Tell the sprite to change to a specific frame of animation. | FlxSprite | |
![]() | frameHeight : uint
The height of the actual graphic or image being displayed (not necessarily the game object/bounding box). | FlxSprite | |
![]() | _framePixels : BitmapData | FlxSprite | |
![]() | frameWidth : uint
The width of the actual graphic or image being displayed (not necessarily the game object/bounding box). | FlxSprite | |
![]() | _group : Boolean
Dedicated internal flag for whether or not this class is a FlxGroup. | FlxObject | |
![]() | handlesCollisions : Boolean | Actor | |
![]() | health : Number
Handy for storing health percentage or armor points or whatever. | FlxObject | |
![]() | height : Number | FlxRect | |
![]() | ID : uint | Actor | |
![]() | isCamera : Boolean | Actor | |
isCircle : Boolean | TerrainRegion | ||
![]() | isHUD : Boolean | Actor | |
![]() | killLeaveScreen : Boolean | Actor | |
![]() | lastCollided : Actor | Actor | |
![]() | layerID : int | Actor | |
![]() | left : Number [read-only]
The X coordinate of the left side of the rectangle. | FlxRect | |
![]() | maxAngular : Number
Use in conjunction with angularAcceleration for fluid spin speed control. | FlxObject | |
![]() | maxThrust : Number
Used to cap thrust, helpful and easy!
| FlxObject | |
![]() | maxVelocity : FlxPoint
If you are using acceleration, you can use maxVelocity with it
to cap the speed automatically (very useful!). | FlxObject | |
![]() | moves : Boolean
Set this to false if you want to skip the automatic motion/movement stuff (see updateMotion()). | FlxObject | |
![]() | name : String | Actor | |
![]() | offset : FlxPoint
If you changed the size of your sprite object to shrink the bounding box,
you might need to offset the new bounding box from the top-left corner of the sprite. | FlxSprite | |
![]() | onFloor : Boolean
Flag that indicates whether or not you just hit the floor. | FlxObject | |
![]() | origin : FlxPoint
WARNING: The origin of the sprite will default to its center. | FlxObject | |
![]() | pixels : BitmapData
Set pixels to any BitmapData object. | FlxSprite | |
![]() | realFrameCount : int | FlxSprite | |
![]() | recycled : Boolean | Actor | |
![]() | registry : Object | Actor | |
![]() | right : Number [read-only]
The X coordinate of the right side of the rectangle. | FlxRect | |
![]() | scale : FlxPoint
Change the size of your sprite's graphic. | FlxSprite | |
![]() | scrollFactor : FlxPoint
A point that can store numbers from 0 to 1 (for X and Y independently)
that governs how much this object is affected by the camera subsystem. | FlxObject | |
![]() | shapeMap : Array | Actor | |
![]() | solid : Boolean
If an object is dead, the functions that automate collisions will skip it (see FlxG.overlapArrays() and FlxG.collideArrays()). | FlxObject | |
![]() | sprite : Sprite | Actor | |
![]() | thrust : Number
If you want to do Asteroids style stuff, check out thrust,
instead of directly accessing the object's velocity or acceleration. | FlxObject | |
![]() | top : Number [read-only]
The Y coordinate of the top of the rectangle. | FlxRect | |
![]() | tweenAngle : AngleHolder | Actor | |
![]() | tweenLoc : Point | Actor | |
![]() | typeID : int | Actor | |
![]() | velocity : FlxPoint
The basic speed of this object. | FlxObject | |
![]() | visible : Boolean
If an object is not visible, the game loop will not automatically call render() on it. | FlxObject | |
![]() | width : Number | FlxRect | |
![]() | x : Number | FlxPoint | |
![]() | y : Number | FlxPoint |
Method | Defined By | ||
---|---|---|---|
TerrainRegion(game:GameState, x:Number, y:Number, shapes:Array, groupID:int) | TerrainRegion | ||
![]() | accelerate(angle:Number, speed:Number):void | Actor | |
![]() | accelerateX(dx:Number):void | Actor | |
![]() | accelerateY(dy:Number):void | Actor | |
![]() | addAnim(name:String, imgData:*, frameCount:Number = 1, frameWidth:Number = 0, frameHeight:Number = 0, durations:Array = null, looping:Boolean = true, shapes:Array = null):void | Actor | |
![]() | addAnimation(Name:String, Frames:Array, FrameRate:Number = 0, Looped:Boolean = true):void
Adds a new animation to the sprite. | FlxSprite | |
![]() | addAnimationCallback(AnimationCallback:Function):void
Pass in a function to be called whenever this sprite's animation changes. | FlxSprite | |
![]() | addBehavior(b:Behavior):void | Actor | |
![]() | addContact(point:b2Contact):void | Actor | |
![]() | alwaysSimulates():Boolean | Actor | |
![]() | anchorToScreen():void | Actor | |
![]() | applyFilter(filter:*):void | FlxSprite | |
![]() | applyImpulse(dirX:Number, dirY:Number, magnitude:Number):void | Actor | |
![]() | applyImpulseInDirection(angle:Number, speed:Number):void | Actor | |
![]() | applyTorque(torque:Number):void | Actor | |
![]() | bringForward():void | Actor | |
![]() | bringToFront():void | Actor | |
![]() | cancelTweens():void | Actor | |
![]() | changeAngularVelocity(omega:Number):void | Actor | |
![]() | FlxObject | ||
![]() | createBox(width:Number, height:Number):b2PolygonShape [static] | Actor | |
![]() | createGraphic(Width:uint, Height:uint, Color:uint = 0xffffffff, Unique:Boolean = false, Key:String = null):FlxSprite
This function creates a flat colored square image dynamically. | FlxSprite | |
![]() | destroy():void [override] | Actor | |
![]() | die():void | Actor | |
![]() | disableActorDrawing():void | Actor | |
![]() | disableBehavior(name:String):void | Actor | |
![]() | disableRotation():void | Actor | |
![]() |
This function draws or stamps one FlxSprite onto another. | FlxSprite | |
![]() | Actor | ||
![]() | drawsImage():Boolean | Actor | |
![]() | enableActorDrawing():void | Actor | |
![]() | enableBehavior(name:String):void | Actor | |
![]() | enableRotation():void | Actor | |
![]() | fadeTo(value:Number, duration:int = 1000, easing:String = linear, delay:int = 0):void | Actor | |
![]() | fill(Color:uint):void
Fills this sprite's graphic with a specific color. | FlxSprite | |
![]() | flicker(Duration:Number = 1):void
Tells this object to flicker, retro-style. | FlxObject | |
![]() | flickering():Boolean
Check to see if the object is still flickering. | FlxObject | |
[override] | TerrainRegion | ||
![]() | followWithOffset(a:Actor, ox:int, oy:int):void | Actor | |
![]() | getActorValue(name:String):* | Actor | |
![]() | getAngle():Number | Actor | |
![]() | getAngleInDegrees():Number | Actor | |
![]() | getAngularVelocity():Number | Actor | |
![]() | getAnimation():String | Actor | |
![]() | Actor | ||
![]() | getCurrentFrame():int | Actor | |
![]() | Actor | ||
![]() | getGroupID():int | Actor | |
getHeight():Number [override] | TerrainRegion | ||
![]() | getID():int | Actor | |
![]() | getImage():BitmapData | Actor | |
![]() | Actor | ||
![]() | getLayerID():int | Actor | |
![]() | getLayerOrder():int | Actor | |
![]() | getName():String | Actor | |
![]() | getNumFrames():int | Actor | |
![]() | getPhysicsHeight():Number | Actor | |
![]() | getPhysicsWidth():Number | Actor | |
![]() | getScreenX():Number | Actor | |
![]() | [override]
Call this function to figure out the on-screen position of the object. | FlxSprite | |
![]() | getScreenY():Number | Actor | |
![]() | Actor | ||
![]() | getValue(behaviorName:String, attributeName:String):Object | Actor | |
getWidth():Number [override] | TerrainRegion | ||
![]() | getX():Number | Actor | |
![]() | getXCenter():Number | Actor | |
![]() | getXVelocity():Number | Actor | |
![]() | getY():Number | Actor | |
![]() | getYCenter():Number | Actor | |
![]() | getYVelocity():Number | Actor | |
![]() | growTo(scaleX:Number = 1, scaleY:Number = 1, duration:int = 1000, easing:String = linear, delay:int = 0):void | Actor | |
![]() | handleCollision(event:Collision):void | Actor | |
![]() | hasActorValue(name:String):* | Actor | |
![]() | hasBehavior(name:String):Boolean | Actor | |
![]() |
Called when this object's bottom edge collides with the top of another FlxObject. | FlxObject | |
![]() |
Called when this object's left side collides with another FlxObject's right. | FlxObject | |
![]() |
Called when this object's right side collides with another FlxObject's left. | FlxObject | |
![]() |
Called when this object's top collides with the bottom of another FlxObject. | FlxObject | |
![]() | hurt(Damage:Number):void
Call this function to "damage" (or give health bonus) to this sprite. | FlxObject | |
![]() | ignoresGravity():Boolean | Actor | |
![]() | initScripts():void | Actor | |
![]() | innerUpdate(hudCheck:Boolean):void | Actor | |
![]() | internalUpdate(doAll:Boolean):void | Actor | |
![]() | isAlive():Boolean | Actor | |
![]() | isAnchoredToScreen():Boolean | Actor | |
![]() | isAnimationPlaying():Boolean | Actor | |
![]() | isBehaviorEnabled(name:String):Boolean | Actor | |
![]() | isDying():Boolean | Actor | |
![]() | isMouseDown():Boolean | Actor | |
![]() | isMouseHover():Boolean | Actor | |
![]() | isMouseOver():Boolean | Actor | |
![]() | isMousePressed():Boolean | Actor | |
![]() | isMouseReleased():Boolean | Actor | |
![]() | isOnScreen():Boolean | Actor | |
![]() | kill():void
Call this function to "kill" a sprite so that it no longer 'exists'. | FlxObject | |
![]() | killSelfAfterLeavingScreen():void | Actor | |
![]() | loadExtGraphic(Graphic:Bitmap, Animated:Boolean = false, Reverse:Boolean = false, Width:uint = 0, Height:uint = 0, Unique:Boolean = false, Key:String = null):FlxSprite | FlxSprite | |
![]() | loadGraphic(Graphic:Class, Animated:Boolean = false, Reverse:Boolean = false, Width:uint = 0, Height:uint = 0, Unique:Boolean = false):FlxSprite
Load an image from an embedded graphic file. | FlxSprite | |
![]() | loadRotatedGraphic(Graphic:Class, Rotations:uint = 16, Frame:int = -1, AntiAliasing:Boolean = false, AutoBuffer:Boolean = false):FlxSprite
Create a pre-rotated sprite sheet from a simple sprite. | FlxSprite | |
![]() | makeAlwaysSimulate():void | Actor | |
![]() | moveBy(x:Number, y:Number, duration:int = 1000, easing:String = linear, delay:int = 0):void | Actor | |
![]() | moveTo(x:Number, y:Number, duration:int = 1000, easing:String = linear, delay:int = 0):void | Actor | |
![]() | moveToLayerOrder(layerOrder:int):void | Actor | |
![]() | onEmit():void
Triggered whenever this sprite is launched by a FlxEmitter. | FlxSprite | |
![]() | onScreen():Boolean
Check and see if this object is currently on screen. | FlxObject | |
![]() |
Checks to see if some FlxObject object overlaps this FlxObject object. | FlxObject | |
![]() | overlapsPoint(X:Number, Y:Number, PerPixel:Boolean = false):Boolean [override]
Checks to see if a point in 2D space overlaps this FlxCore object. | FlxSprite | |
![]() | play(AnimName:String, Force:Boolean = false):void
Plays an existing animation (e.g. | FlxSprite | |
![]() | playFromFrame(StartFrame:int = 0):void
Plays the current Animation from a specific frame
| FlxSprite | |
![]() | preCollide(Object:FlxObject):void
FlxU.collide() (and thus FlxObject.collide()) call
this function each time two objects are compared to see if they collide. | FlxObject | |
![]() | push(dirX:Number, dirY:Number, magnitude:Number):void | Actor | |
![]() | pushInDirection(angle:Number, speed:Number):void | Actor | |
![]() | randomFrame():void
Tell the sprite to change to a random frame of animation
Useful for instantiating particles or other weird things. | FlxSprite | |
![]() | refreshHulls():void
Called by FlxObject.updateMotion() and some constructors to
rebuild the basic collision data for this object. | FlxObject | |
![]() | registerCollisionHandler(b:Behavior):void | Actor | |
![]() | removeContact(point:b2Contact):void | Actor | |
![]() | removeFilter(filter:*):void [override] | Actor | |
![]() | removeFirstFilter():void [override] | Actor | |
![]() | removeLastFilter():void [override] | Actor | |
![]() | render():void [override]
Called by game loop, updates then blits or renders current frame of animation to the screen
| FlxSprite | |
![]() | reset(X:Number, Y:Number):void
Handy function for reviving game objects. | FlxObject | |
resetSize():void | TerrainRegion | ||
![]() | rotate(angle:Number, inRadians:Boolean = true):void | Actor | |
![]() | say(behaviorName:String, msg:String, ... args):Object | Actor | |
![]() | sendBackward():void | Actor | |
![]() | sendToBack():void | Actor | |
![]() | setActorValue(name:String, value:*):void | Actor | |
![]() | setAngle(angle:Number, inRadians:Boolean = true):void | Actor | |
![]() | setAngularVelocity(omega:Number):void | Actor | |
![]() | setAnimation(name:String):void | Actor | |
![]() | setCurrentFrame(frame:int):void | Actor | |
![]() | setFilter(filter:*):void [override] | Actor | |
![]() | setIgnoreGravity(state:Boolean):void | Actor | |
setLocation(x:int, y:int):void [override] | TerrainRegion | ||
setTerrainRegionDiameter(diameter:int):void | TerrainRegion | ||
setTerrainRegionSize(width:int, height:int):void | TerrainRegion | ||
![]() | setValue(behaviorName:String, attributeName:String, value:Object):void | Actor | |
![]() | setVelocity(angle:Number, speed:Number):void | Actor | |
![]() | setX(x:Number, resetSpeed:Boolean = false):void | Actor | |
![]() | setXVelocity(dx:Number):void | Actor | |
![]() | setY(y:Number, resetSpeed:Boolean = false):void | Actor | |
![]() | setYVelocity(dy:Number):void | Actor | |
![]() | shout(msg:String, ... args):Object | Actor | |
![]() | spinBy(angle:Number, duration:int = 1000, easing:String = linear, delay:int = 0):void | Actor | |
![]() | spinTo(angle:Number, duration:int = 1000, easing:String = linear, delay:int = 0):void | Actor | |
![]() | switchAnimation(name:String):void | Actor | |
![]() | switchToDefaultAnimation():void | Actor | |
![]() | toString():String [override] | Actor | |
![]() | unanchorFromScreen():void | Actor | |
![]() | unsafeBind(Pixels:BitmapData):void
Internal function, currently only used to quickly update FlxState.screen for post-processing. | FlxSprite | |
![]() | update():void [override] | Actor | |
![]() | updateAnimation():void
Internal function for updating the sprite's animation. | FlxSprite |
isCircle | property |
public var isCircle:Boolean
TerrainRegion | () | Constructor |
public function TerrainRegion(game:GameState, x:Number, y:Number, shapes:Array, groupID:int)
game:GameState | |
x:Number | |
y:Number | |
shapes:Array | |
groupID:int |
follow | () | method |
getHeight | () | method |
override public function getHeight():Number
ReturnsNumber |
getWidth | () | method |
override public function getWidth():Number
ReturnsNumber |
resetSize | () | method |
public function resetSize():void
setLocation | () | method |
override public function setLocation(x:int, y:int):void
Parameters
x:int | |
y:int |
setTerrainRegionDiameter | () | method |
public function setTerrainRegionDiameter(diameter:int):void
Parameters
diameter:int |
setTerrainRegionSize | () | method |
public function setTerrainRegionSize(width:int, height:int):void
Parameters
width:int | |
height:int |