C# Класс XnaFlixel.FlxG

This is a global helper class full of useful functions for audio, input, basic info, and the camera system among other things.
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
Game Microsoft.Xna.Framework.Game
GameTime Microsoft.Xna.Framework.GameTime
LIBRARY_MAJOR_VERSION uint
LIBRARY_MINOR_VERSION uint
LIBRARY_NAME string
autoHandlePause bool
backColor Microsoft.Xna.Framework.Color
debug bool
elapsed float
fade FlxFade
flash FlxFlash
followLead Microsoft.Xna.Framework.Vector2
followLerp float
followMax Microsoft.Xna.Framework.Point
followMin Microsoft.Xna.Framework.Point
followTarget FlxObject
gamepads XnaFlixel.data.FlxGamepad
getTimer uint
height int
keys FlxKeyboard
level int
levels List
maxElapsed float
mobile bool
mouse FlxMouse
music FlxSound
quake XnaFlixel.data.FlxQuake
save int
saves List
score int
scores List
scroll Microsoft.Xna.Framework.Vector2
showBounds bool
sounds List
timeScale float
width int

Защищенные свойства (Protected)

Свойство Тип Описание
_flxGame FlxGame
_mute bool
_pause bool
_scrollTarget Microsoft.Xna.Framework.Vector2
_volume float

Открытые методы

Метод Описание
LoadContent ( GraphicsDevice gd ) : void
follow ( FlxObject Target, float Lerp ) : void
followAdjust ( float LeadX, float LeadY ) : void
followBounds ( int MinX, int MinY, int MaxX, int MaxY ) : void

Specify the boundaries of the level or where the camera is allowed to move. @param MinX The smallest X value of your level (usually 0). @param MinY The smallest Y value of your level (usually 0). @param MaxX The largest X value of your level (usually the level width). @param MaxY The largest Y value of your level (usually the level height). @param UpdateWorldBounds Whether the quad tree's dimensions should be updated to match.

followBounds ( int MinX, int MinY, int MaxX, int MaxY, bool UpdateWorldBounds ) : void
getMuteValue ( ) : int

Get a number that represents the mute state that we can multiply into a sound transform. @return An unsigned integer - 0 if muted, 1 if not muted.

log ( string Data ) : void

Log data to the developer console. @param Data Anything you want to log to the console.

play ( string EmbeddedSound ) : FlxSound

Creates a new sound object from an embedded Class object. @param EmbeddedSound The sound you want to play. @param Volume How loud to play it (0 to 1). @param Looped Whether or not to loop this sound. @return A FlxSound object.

play ( string EmbeddedSound, float Volume ) : FlxSound
play ( string EmbeddedSound, float Volume, bool Looped ) : FlxSound
playMusic ( string Music ) : void

Set up and play a looping background soundtrack. @param Music The sound file you want to loop in the background. @param Volume How loud the sound should be, from 0 to 1.

playMusic ( string Music, float Volume ) : void
resetInput ( ) : void

Reset the input helper objects (useful when changing screens or states)

Защищенные методы

Метод Описание
changeSounds ( ) : void

An internal function that adjust the volume levels and the music channel after a change.

pauseSounds ( ) : void

Internal helper, pauses all game sounds.

playSounds ( ) : void

Internal helper, pauses all game sounds.

Приватные методы

Метод Описание
destroySounds ( bool ForceDestroy ) : void

Called by FlxGame on state changes to stop and destroy sounds. @param ForceDestroy Kill sounds even if they're flagged survive.

doFollow ( ) : void

Internal function that updates the camera and parallax scrolling.

setGameData ( FlxGame flxGame, int Width, int Height ) : void

Called by FlxGame to set up FlxG during FlxGame's constructor.

unfollow ( ) : void

Stops and resets the camera.

updateSounds ( ) : void

Called by the game loop to make sure the sounds get updated each frame.

Описание методов

LoadContent() публичный статический Метод

public static LoadContent ( GraphicsDevice gd ) : void
gd GraphicsDevice
Результат void

changeSounds() защищенный статический Метод

An internal function that adjust the volume levels and the music channel after a change.
protected static changeSounds ( ) : void
Результат void

follow() публичный статический Метод

public static follow ( FlxObject Target, float Lerp ) : void
Target FlxObject
Lerp float
Результат void

followAdjust() публичный статический Метод

public static followAdjust ( float LeadX, float LeadY ) : void
LeadX float
LeadY float
Результат void

followBounds() публичный статический Метод

Specify the boundaries of the level or where the camera is allowed to move. @param MinX The smallest X value of your level (usually 0). @param MinY The smallest Y value of your level (usually 0). @param MaxX The largest X value of your level (usually the level width). @param MaxY The largest Y value of your level (usually the level height). @param UpdateWorldBounds Whether the quad tree's dimensions should be updated to match.
public static followBounds ( int MinX, int MinY, int MaxX, int MaxY ) : void
MinX int
MinY int
MaxX int
MaxY int
Результат void

followBounds() публичный статический Метод

public static followBounds ( int MinX, int MinY, int MaxX, int MaxY, bool UpdateWorldBounds ) : void
MinX int
MinY int
MaxX int
MaxY int
UpdateWorldBounds bool
Результат void

getMuteValue() публичный статический Метод

Get a number that represents the mute state that we can multiply into a sound transform. @return An unsigned integer - 0 if muted, 1 if not muted.
public static getMuteValue ( ) : int
Результат int

log() публичный статический Метод

Log data to the developer console. @param Data Anything you want to log to the console.
public static log ( string Data ) : void
Data string
Результат void

pauseSounds() защищенный статический Метод

Internal helper, pauses all game sounds.
protected static pauseSounds ( ) : void
Результат void

play() публичный статический Метод

Creates a new sound object from an embedded Class object. @param EmbeddedSound The sound you want to play. @param Volume How loud to play it (0 to 1). @param Looped Whether or not to loop this sound. @return A FlxSound object.
public static play ( string EmbeddedSound ) : FlxSound
EmbeddedSound string
Результат FlxSound

play() публичный статический Метод

public static play ( string EmbeddedSound, float Volume ) : FlxSound
EmbeddedSound string
Volume float
Результат FlxSound

play() публичный статический Метод

public static play ( string EmbeddedSound, float Volume, bool Looped ) : FlxSound
EmbeddedSound string
Volume float
Looped bool
Результат FlxSound

playMusic() публичный статический Метод

Set up and play a looping background soundtrack. @param Music The sound file you want to loop in the background. @param Volume How loud the sound should be, from 0 to 1.
public static playMusic ( string Music ) : void
Music string
Результат void

playMusic() публичный статический Метод

public static playMusic ( string Music, float Volume ) : void
Music string
Volume float
Результат void

playSounds() защищенный статический Метод

Internal helper, pauses all game sounds.
protected static playSounds ( ) : void
Результат void

resetInput() публичный статический Метод

Reset the input helper objects (useful when changing screens or states)
public static resetInput ( ) : void
Результат void

Описание свойств

Game публичное статическое свойство

public static Game,Microsoft.Xna.Framework Game
Результат Microsoft.Xna.Framework.Game

GameTime публичное статическое свойство

public static GameTime,Microsoft.Xna.Framework GameTime
Результат Microsoft.Xna.Framework.GameTime

LIBRARY_MAJOR_VERSION публичное статическое свойство

Assign a major version to your library. Appears before the decimal in the console.
public static uint LIBRARY_MAJOR_VERSION
Результат uint

LIBRARY_MINOR_VERSION публичное статическое свойство

Assign a minor version to your library. Appears after the decimal in the console.
public static uint LIBRARY_MINOR_VERSION
Результат uint

LIBRARY_NAME публичное статическое свойство

If you build and maintain your own version of flixel, you can give it your own name here. Appears in the console.
public static string LIBRARY_NAME
Результат string

_flxGame защищенное статическое свойство

Internal tracker for game object (so we can pause & unpause)
protected static FlxGame,XnaFlixel _flxGame
Результат FlxGame

_mute защищенное статическое свойство

Internal flag for whether or not the game is muted.
protected static bool _mute
Результат bool

_pause защищенное статическое свойство

Internal tracker for game pause state.
protected static bool _pause
Результат bool

_scrollTarget защищенное статическое свойство

Internal, used to assist camera and scrolling.
protected static Vector2,Microsoft.Xna.Framework _scrollTarget
Результат Microsoft.Xna.Framework.Vector2

_volume защищенное статическое свойство

Internal volume level, used for global sound control.
protected static float _volume
Результат float

autoHandlePause публичное статическое свойство

public static bool autoHandlePause
Результат bool

backColor публичное статическое свойство

public static Color,Microsoft.Xna.Framework backColor
Результат Microsoft.Xna.Framework.Color

debug публичное статическое свойство

Whether you are running in Debug or Release mode. Set automatically by FlxFactory during startup.
public static bool debug
Результат bool

elapsed публичное статическое свойство

Represents the amount of time in seconds that passed since last frame.
public static float elapsed
Результат float

fade публичное статическое свойство

A special effect that fades a color onto the screen. Usage: FlxG.fade.start();
public static FlxFade fade
Результат FlxFade

flash публичное статическое свойство

A special effect that flashes a color on the screen. Usage: FlxG.flash.start();
public static FlxFlash flash
Результат FlxFlash

followLead публичное статическое свойство

Used to force the camera to look ahead of the followTarget.
public static Vector2,Microsoft.Xna.Framework followLead
Результат Microsoft.Xna.Framework.Vector2

followLerp публичное статическое свойство

Used to smoothly track the camera as it follows.
public static float followLerp
Результат float

followMax публичное статическое свойство

Stores the bottom and right edges of the camera area.
public static Point,Microsoft.Xna.Framework followMax
Результат Microsoft.Xna.Framework.Point

followMin публичное статическое свойство

Stores the top and left edges of the camera area.
public static Point,Microsoft.Xna.Framework followMin
Результат Microsoft.Xna.Framework.Point

followTarget публичное статическое свойство

Tells the camera to follow this FlxCore object around.
public static FlxObject followTarget
Результат FlxObject

gamepads публичное статическое свойство

An array of FlxGamepad objects. Important for input!
public static FlxGamepad,XnaFlixel.data gamepads
Результат XnaFlixel.data.FlxGamepad

getTimer публичное статическое свойство

public static uint getTimer
Результат uint

height публичное статическое свойство

The height of the screen in game pixels.
public static int height
Результат int

keys публичное статическое свойство

A reference to a FlxKeyboard object. Important for input!
public static FlxKeyboard keys
Результат FlxKeyboard

level публичное статическое свойство

public static int level
Результат int

levels публичное статическое свойство

FlxG.levels and FlxG.scores are generic global variables that can be used for various cross-state stuff.
public static List levels
Результат List

maxElapsed публичное статическое свойство

Essentially locks the framerate to a minimum value - any slower and you'll get slowdown instead of frameskip; default is 1/30th of a second.
public static float maxElapsed
Результат float

mobile публичное статическое свойство

Setting this to true will disable/skip stuff that isn't necessary for mobile platforms like Android (or Windows Phone 7). [BETA]
public static bool mobile
Результат bool

mouse публичное статическое свойство

A reference to a FlxMouse object. Important for input!
public static FlxMouse mouse
Результат FlxMouse

music публичное статическое свойство

A handy container for a background music object.
public static FlxSound music
Результат FlxSound

quake публичное статическое свойство

Reference to the active graphics buffer. Can also be referenced via FlxState.screen. Internal storage system to prevent graphics from being used repeatedly in memory. Access to the Kongregate high scores and achievements API. The support panel (twitter, reddit, stumbleupon, paypal, etc) visor thing A special effect that shakes the screen. Usage: FlxG.quake.start();
public static FlxQuake,XnaFlixel.data quake
Результат XnaFlixel.data.FlxQuake

save публичное статическое свойство

public static int save
Результат int

saves публичное статическое свойство

FlxG.saves is a generic bucket for storing FlxSaves so you can access them whenever you want.
public static List saves
Результат List

score публичное статическое свойство

public static int score
Результат int

scores публичное статическое свойство

public static List scores
Результат List

scroll публичное статическое свойство

Stores the basic parallax scrolling values.
public static Vector2,Microsoft.Xna.Framework scroll
Результат Microsoft.Xna.Framework.Vector2

showBounds публичное статическое свойство

Set showBounds to true to display the bounding boxes of the in-game objects.
public static bool showBounds
Результат bool

sounds публичное статическое свойство

A list of all the sounds being played in the game.
public static List sounds
Результат List

timeScale публичное статическое свойство

How fast or slow time should pass in the game; default is 1.0.
public static float timeScale
Результат float

width публичное статическое свойство

The width of the screen in game pixels.
public static int width
Результат int