C# 클래스 Nez.FollowCamera

basic follow camera. LockOn mode uses no deadzone and just centers the camera on the target. CameraWindow mode wraps a deadzone around the target allowing it to move within the deadzone without moving the camera.
상속: Component, IUpdatable
파일 보기 프로젝트 열기: prime31/Nez

공개 프로퍼티들

프로퍼티 타입 설명
camera Camera
deadzone RectangleF
focusOffset Vector2
followLerp float
mapLockEnabled bool
mapSize Vector2

공개 메소드들

메소드 설명
FollowCamera ( System.Entity targetEntity ) : System
FollowCamera ( System.Entity targetEntity, Camera camera ) : System
IUpdatable ( ) : void
debugRender ( Graphics graphics ) : void
follow ( System.Entity targetEntity, CameraStyle cameraStyle = CameraStyle.CameraWindow ) : void
onAddedToEntity ( ) : void
onGraphicsDeviceReset ( ) : void
onRemovedFromEntity ( ) : void
setCenteredDeadzone ( int width, int height ) : void

sets up the deadzone centered in the current cameras bounds with the given size

updateFollow ( ) : void

비공개 메소드들

메소드 설명
clampToMapSize ( Vector2 position ) : Vector2

Clamps the camera so it never leaves the visible area of the map.

메소드 상세

FollowCamera() 공개 메소드

public FollowCamera ( System.Entity targetEntity ) : System
targetEntity System.Entity
리턴 System

FollowCamera() 공개 메소드

public FollowCamera ( System.Entity targetEntity, Camera camera ) : System
targetEntity System.Entity
camera Camera
리턴 System

IUpdatable() 공개 메소드

public IUpdatable ( ) : void
리턴 void

debugRender() 공개 메소드

public debugRender ( Graphics graphics ) : void
graphics Graphics
리턴 void

follow() 공개 메소드

public follow ( System.Entity targetEntity, CameraStyle cameraStyle = CameraStyle.CameraWindow ) : void
targetEntity System.Entity
cameraStyle CameraStyle
리턴 void

onAddedToEntity() 공개 메소드

public onAddedToEntity ( ) : void
리턴 void

onGraphicsDeviceReset() 공개 메소드

public onGraphicsDeviceReset ( ) : void
리턴 void

onRemovedFromEntity() 공개 메소드

public onRemovedFromEntity ( ) : void
리턴 void

setCenteredDeadzone() 공개 메소드

sets up the deadzone centered in the current cameras bounds with the given size
public setCenteredDeadzone ( int width, int height ) : void
width int Width.
height int Height.
리턴 void

updateFollow() 공개 메소드

public updateFollow ( ) : void
리턴 void

프로퍼티 상세

camera 공개적으로 프로퍼티

public Camera,Nez camera
리턴 Camera

deadzone 공개적으로 프로퍼티

when in CameraWindow mode the width/height is used as a bounding box to allow movement within it without moving the camera. when in LockOn mode only the deadzone x/y values are used. This is set to sensible defaults when you call follow but you are free to override it to get a custom deadzone directly or via the helper setCenteredDeadzone.
public RectangleF deadzone
리턴 RectangleF

focusOffset 공개적으로 프로퍼티

offset from the screen center that the camera will focus on
public Vector2 focusOffset
리턴 Vector2

followLerp 공개적으로 프로퍼티

how fast the camera closes the distance to the target position
public float followLerp
리턴 float

mapLockEnabled 공개적으로 프로퍼티

If true, the camera position will not got out of the map rectangle (0,0, mapwidth, mapheight)
public bool mapLockEnabled
리턴 bool

mapSize 공개적으로 프로퍼티

Contains the width and height of the current map.
public Vector2 mapSize
리턴 Vector2