C# 클래스 flxSharp.flxSharp.FlxCamera

The camera class is used to display the game's visuals in the Flash player. By default one camera is created automatically, that is the same size as the Flash player. You can add more cameras or even replace the main camera using utilities in FlxG.
상속: FlxBasic
파일 보기 프로젝트 열기: jlorek/flxSharp 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
BgColor Color
Bounds FlxRect
Buffer Microsoft.Xna.Framework.Graphics.RenderTarget2D
Deadzone FlxRect
DefaultZoom float
FlashOffsetX float
FlashOffsetY float
FlashSprite FlxObject
Scroll FlxPoint
Target FlxObject
screen FlxSprite
transform Matrix

보호된 프로퍼티들

프로퍼티 타입 설명
_color Color
_point FlxPoint
_zoom float
fxFadeAlpha float
fxFadeColor Color
fxFadeComplete System.Action
fxFadeDuration float
fxFlashAlpha float
fxFlashColor Color
fxFlashComplete System.Action
fxFlashDuration float
fxShakeComplete System.Action
fxShakeDirection uint
fxShakeDuration float
fxShakeIntensity float
fxShakeOffset FlxPoint

Private Properties

프로퍼티 타입 설명
UpdateHelpers void
drawFX void

공개 메소드들

메소드 설명
Fade ( Color color, float duration = 1, System.Action onComplete = null, bool force = false ) : void

The screen is gradually filled with this color.

Fill ( Color color, bool blendAlpha = true ) : void

Fill the camera with the specified color.

Flash ( Color color, float duration = 1, System.Action onComplete = null, bool force = false ) : void

The screen is filled with this color and gradually returns to normal.

FlxCamera ( float x, float y, int width, int height, float zoom ) : System

Instantiates a new camera at the specified location, with the specified size and zoom level.

copyFrom ( FlxCamera camera ) : FlxCamera

Copy the bounds, focus object, and deadzone info from an existing camera.

destroy ( ) : void

Clean up memory.

focusOn ( FlxPoint point ) : void

Move the camera focus to this location instantly.

follow ( FlxObject target, uint style = StyleLockon ) : void

Tells this camera object what FlxObject to track.

getContainerSprite ( ) : object

Fetches a reference to the Flash Sprite object that contains the camera display in the Flash display list. Uses include 3D projection, advanced display list modification, and more. NOTE: We don't recommend modifying this directly unless you are fairly experienced. For simple changes to the camera display, like scaling, rotation, and color tinting, we recommend using the existing FlxCamera variables.

setBounds ( float x, float y, float width, float height, System.Boolean updateWorld = false ) : void

Specify the boundaries of the level or where the camera is allowed to move.

shake ( float intensity = 0.05f, float duration = 0.5f, System.Action onComplete = null, bool force = true, uint direction = ShakeBothAxes ) : void

A simple screen-shake effect.

stopFX ( ) : void

Just turns off all the camera effects instantly.

update ( ) : void

Updates the camera scroll as well as special effects like screen-shake or fades.

비공개 메소드들

메소드 설명
UpdateHelpers ( ) : void
drawFX ( ) : void

Internal helper function, handles the actual drawing of all the special effects.

메소드 상세

Fade() 공개 메소드

The screen is gradually filled with this color.
public Fade ( Color color, float duration = 1, System.Action onComplete = null, bool force = false ) : void
color Color The color you want to use.
duration float How long it takes for the fade to finish.
onComplete System.Action A function you want to run when the fade finishes.
force bool Force the effect to reset.
리턴 void

Fill() 공개 메소드

Fill the camera with the specified color.
public Fill ( Color color, bool blendAlpha = true ) : void
color Color The color to fill with in 0xAARRGGBB hex format.
blendAlpha bool Whether to blend the alpha value or just wipe the previous contents. Default is true.
리턴 void

Flash() 공개 메소드

The screen is filled with this color and gradually returns to normal.
public Flash ( Color color, float duration = 1, System.Action onComplete = null, bool force = false ) : void
color Color The color you want to use.
duration float How long it takes for the flash to fade.
onComplete System.Action A function you want to run when the flash finishes.
force bool Force the effect to reset.
리턴 void

FlxCamera() 공개 메소드

Instantiates a new camera at the specified location, with the specified size and zoom level.
public FlxCamera ( float x, float y, int width, int height, float zoom ) : System
x float X location of the camera's display in pixels. Uses native, 1:1 resolution, ignores zoom.
y float Y location of the camera's display in pixels. Uses native, 1:1 resolution, ignores zoom.
width int The width of the camera display in pixels.
height int The height of the camera display in pixels.
zoom float The initial zoom level of the camera. A zoom level of 2 will make all pixels display at 2x resolution.
리턴 System

copyFrom() 공개 메소드

Copy the bounds, focus object, and deadzone info from an existing camera.
public copyFrom ( FlxCamera camera ) : FlxCamera
camera FlxCamera The camera you want to copy from.
리턴 FlxCamera

destroy() 공개 메소드

Clean up memory.
public destroy ( ) : void
리턴 void

focusOn() 공개 메소드

Move the camera focus to this location instantly.
public focusOn ( FlxPoint point ) : void
point FlxPoint Where you want the camera to focus.
리턴 void

follow() 공개 메소드

Tells this camera object what FlxObject to track.
public follow ( FlxObject target, uint style = StyleLockon ) : void
target FlxObject The object you want the camera to track. Set to null to not follow anything.
style uint Leverage one of the existing "deadzone" presets. If you use a custom deadzone, ignore this parameter and manually specify the deadzone after calling follow().
리턴 void

getContainerSprite() 공개 메소드

Fetches a reference to the Flash Sprite object that contains the camera display in the Flash display list. Uses include 3D projection, advanced display list modification, and more. NOTE: We don't recommend modifying this directly unless you are fairly experienced. For simple changes to the camera display, like scaling, rotation, and color tinting, we recommend using the existing FlxCamera variables.
public getContainerSprite ( ) : object
리턴 object

setBounds() 공개 메소드

Specify the boundaries of the level or where the camera is allowed to move.
public setBounds ( float x, float y, float width, float height, System.Boolean updateWorld = false ) : void
x float The smallest X value of your level (usually 0).
y float The smallest Y value of your level (usually 0).
width float The largest X value of your level (usually the level width).
height float The largest Y value of your level (usually the level height).
updateWorld System.Boolean Whether the global quad-tree's dimensions should be updated to match (default: false).
리턴 void

shake() 공개 메소드

A simple screen-shake effect.
public shake ( float intensity = 0.05f, float duration = 0.5f, System.Action onComplete = null, bool force = true, uint direction = ShakeBothAxes ) : void
intensity float Percentage of screen size representing the maximum distance that the screen can move while shaking.
duration float The length in seconds that the shaking effect should last.
onComplete System.Action A function you want to run when the shake effect finishes.
force bool Force the effect to reset (default = true, unlike flash() and fade()!).
direction uint Whether to shake on both axes, just up and down, or just side to side (use class constants SHAKE_BOTH_AXES, SHAKE_VERTICAL_ONLY, or SHAKE_HORIZONTAL_ONLY).
리턴 void

stopFX() 공개 메소드

Just turns off all the camera effects instantly.
public stopFX ( ) : void
리턴 void

update() 공개 메소드

Updates the camera scroll as well as special effects like screen-shake or fades.
public update ( ) : void
리턴 void

프로퍼티 상세

BgColor 공개적으로 프로퍼티

The natural background color of the camera. Defaults to FlxG.bgColor. NOTE: can be transparent for crazy FX!
public Color BgColor
리턴 Color

Bounds 공개적으로 프로퍼티

The edges of the camera's range, i.e. where to stop scrolling. Measured in game pixels and world coordinates.
public FlxRect,flxSharp.flxSharp Bounds
리턴 FlxRect

Buffer 공개적으로 프로퍼티

The actual bitmap data of the camera display itself.
public RenderTarget2D,Microsoft.Xna.Framework.Graphics Buffer
리턴 Microsoft.Xna.Framework.Graphics.RenderTarget2D

Deadzone 공개적으로 프로퍼티

You can assign a "dead zone" to the camera in order to better control its movement. The camera will always keep the focus object inside the dead zone, unless it is bumping up against the bounds rectangle's edges. The deadzone's coordinates are measured from the camera's upper left corner in game pixels. For rapid prototyping, you can use the preset deadzones (e.g. STYLE_PLATFORMER) with follow().
public FlxRect,flxSharp.flxSharp Deadzone
리턴 FlxRect

DefaultZoom 공개적으로 정적으로 프로퍼티

While you can alter the zoom of each camera after the fact, this variable determines what value the camera will start at when created.
public static float DefaultZoom
리턴 float

FlashOffsetX 공개적으로 프로퍼티

public float FlashOffsetX
리턴 float

FlashOffsetY 공개적으로 프로퍼티

public float FlashOffsetY
리턴 float

FlashSprite 공개적으로 프로퍼티

public FlxObject,flxSharp.flxSharp FlashSprite
리턴 FlxObject

Scroll 공개적으로 프로퍼티

Stores the basic parallax scrolling values.
public FlxPoint,flxSharp.flxSharp Scroll
리턴 FlxPoint

Target 공개적으로 프로퍼티

Tells the camera to follow this FlxObject object around.
public FlxObject,flxSharp.flxSharp Target
리턴 FlxObject

_color 보호되어 있는 프로퍼티

Internal, help with color transforming the flash bitmap.
protected Color _color
리턴 Color

_point 보호되어 있는 프로퍼티

Internal, to help avoid costly allocations.
protected FlxPoint,flxSharp.flxSharp _point
리턴 FlxPoint

_zoom 보호되어 있는 프로퍼티

Indicates how far the camera is zoomed in.
protected float _zoom
리턴 float

fxFadeAlpha 보호되어 있는 프로퍼티

Internal, used to control the "fade" special effect.
protected float fxFadeAlpha
리턴 float

fxFadeColor 보호되어 있는 프로퍼티

Internal, used to control the "fade" special effect.
protected Color fxFadeColor
리턴 Color

fxFadeComplete 보호되어 있는 프로퍼티

Internal, used to control the "fade" special effect.
protected Action,System fxFadeComplete
리턴 System.Action

fxFadeDuration 보호되어 있는 프로퍼티

Internal, used to control the "fade" special effect.
protected float fxFadeDuration
리턴 float

fxFlashAlpha 보호되어 있는 프로퍼티

Internal, used to control the "flash" special effect.
protected float fxFlashAlpha
리턴 float

fxFlashColor 보호되어 있는 프로퍼티

Internal, used to control the "flash" special effect.
protected Color fxFlashColor
리턴 Color

fxFlashComplete 보호되어 있는 프로퍼티

Internal, used to control the "flash" special effect.
protected Action,System fxFlashComplete
리턴 System.Action

fxFlashDuration 보호되어 있는 프로퍼티

Internal, used to control the "flash" special effect.
protected float fxFlashDuration
리턴 float

fxShakeComplete 보호되어 있는 프로퍼티

Internal, used to control the "shake" special effect.
protected Action,System fxShakeComplete
리턴 System.Action

fxShakeDirection 보호되어 있는 프로퍼티

Internal, used to control the "shake" special effect.
protected uint fxShakeDirection
리턴 uint

fxShakeDuration 보호되어 있는 프로퍼티

Internal, used to control the "shake" special effect.
protected float fxShakeDuration
리턴 float

fxShakeIntensity 보호되어 있는 프로퍼티

Internal, used to control the "shake" special effect.
protected float fxShakeIntensity
리턴 float

fxShakeOffset 보호되어 있는 프로퍼티

Internal, used to control the "shake" special effect.
protected FlxPoint,flxSharp.flxSharp fxShakeOffset
리턴 FlxPoint

screen 공개적으로 프로퍼티

Sometimes it's easier to just work with a FlxSprite than it is to work directly with the BitmapData buffer. This sprite reference will allow you to do exactly that.
public FlxSprite,flxSharp.flxSharp screen
리턴 FlxSprite

transform 공개적으로 프로퍼티

public Matrix transform
리턴 Matrix