C# Class fliXNA_xbox.FlxG

Afficher le fichier Open project: bpercevic/flixel-XNA Class Usage Examples

Méthodes publiques

Свойство Type Description
bgColor Color
camera FlxCamera
cameras List
console FlxConsole
content Microsoft.Xna.Framework.Content.ContentManager
defaultFont Microsoft.Xna.Framework.Graphics.SpriteFont
defaultWholeScreenViewport Microsoft.Xna.Framework.Graphics.Viewport
elapsed float
globalSeed float
graphics GraphicsDeviceManager
graphicsDevice GraphicsDevice
height float
hud FlxGroup
keys FlxKeyboard
mouse FlxMouse
mute bool
pad1 FlxGamepad
pad2 FlxGamepad
pad3 FlxGamepad
pad4 FlxGamepad
rotation float
safeZone FlxRect
sounds FlxGroup
storage Microsoft.Xna.Framework.Storage.StorageDevice
viewport Microsoft.Xna.Framework.Graphics.Viewport
viewports List
volume float
width float
zoom float

Méthodes publiques

Méthode Description
addCamera ( FlxCamera NewCamera ) : FlxCamera
collide ( FlxObject ObjectOrGroup1 = null, FlxObject ObjectOrGroup2 = null, Func NotifyCallback = null ) : System.Boolean

Returns true if the two FlxObjects collide. Optional callback function of return type bool with two FlxObject parameters will be called if true.

log ( Object data ) : bool

Log something to the debugger console in Visual Studio

overlap ( FlxObject ObjectOrGroup1 = null, FlxObject ObjectOrGroup2 = null, Func NotifyCallback = null, Func ProcessCallback = null ) : System.Boolean

Returns true if the two FlxObjects overlap. Optional Callback function of return type bool with two FlxObject parameters will be called if true.

play ( SoundEffect EmbeddedSound, float Volume = 1.0f, bool Looped = false ) : FlxSound

Play a sound, not with FlxSound but with SoundEffect from the XNA framework because the sound is disposed of properly by the xbox itself. CURRENTLY NOT WORKING The sound starts but cuts off in about half of a second.

switchState ( FlxState State ) : void

Call this to switch to a new state @use FlxG.switchState(new NewState());

Private Methods

Méthode Description
gametime ( GameTime dt ) : void
init ( ) : void

Initiate all the things needed by the engine

loadSound ( SoundEffect EmbeddedSound, float Volume, bool Looped, bool AutoDestroy, bool AutoPlay ) : FlxSound
random ( ) : float

Internal random float from 0 to 1

shake ( float Intensity = 0.025f, float Duration = 0.5f, System.Action OnComplete = null, bool Force = true, uint Direction ) : void

Shake the screen

snap ( float XorY, float Grid ) : float
update ( GameTime dt ) : void

Internal function for updating Camera, State, Console, and Elapsed Time

updateCameras ( ) : void
updateInputs ( ) : void

Internal function for keeping input states current

Method Details

addCamera() public static méthode

public static addCamera ( FlxCamera NewCamera ) : FlxCamera
NewCamera FlxCamera
Résultat FlxCamera

collide() public static méthode

Returns true if the two FlxObjects collide. Optional callback function of return type bool with two FlxObject parameters will be called if true.
public static collide ( FlxObject ObjectOrGroup1 = null, FlxObject ObjectOrGroup2 = null, Func NotifyCallback = null ) : System.Boolean
ObjectOrGroup1 FlxObject
ObjectOrGroup2 FlxObject
NotifyCallback Func
Résultat System.Boolean

log() public static méthode

Log something to the debugger console in Visual Studio
public static log ( Object data ) : bool
data Object
Résultat bool

overlap() public static méthode

Returns true if the two FlxObjects overlap. Optional Callback function of return type bool with two FlxObject parameters will be called if true.
public static overlap ( FlxObject ObjectOrGroup1 = null, FlxObject ObjectOrGroup2 = null, Func NotifyCallback = null, Func ProcessCallback = null ) : System.Boolean
ObjectOrGroup1 FlxObject
ObjectOrGroup2 FlxObject
NotifyCallback Func
ProcessCallback Func
Résultat System.Boolean

play() public static méthode

Play a sound, not with FlxSound but with SoundEffect from the XNA framework because the sound is disposed of properly by the xbox itself. CURRENTLY NOT WORKING The sound starts but cuts off in about half of a second.
public static play ( SoundEffect EmbeddedSound, float Volume = 1.0f, bool Looped = false ) : FlxSound
EmbeddedSound Microsoft.Xna.Framework.Audio.SoundEffect
Volume float
Looped bool
Résultat FlxSound

switchState() public static méthode

Call this to switch to a new state @use FlxG.switchState(new NewState());
public static switchState ( FlxState State ) : void
State FlxState
Résultat void

Property Details

bgColor public_oe static_oe property

Controls the background color of the Game
public static Color bgColor
Résultat Color

camera public_oe static_oe property

Reference to the Game Camera
public static FlxCamera,fliXNA_xbox camera
Résultat FlxCamera

cameras public_oe static_oe property

Array of cameras, used for splitscreen
public static List cameras
Résultat List

console public_oe static_oe property

Unused Console reference Not yet implemented
public static FlxConsole,fliXNA_xbox console
Résultat FlxConsole

content public_oe static_oe property

Reference to the ContentManager, important for retrieving Content such as images and sound
public static ContentManager,Microsoft.Xna.Framework.Content content
Résultat Microsoft.Xna.Framework.Content.ContentManager

defaultFont public_oe static_oe property

The default font that you can use for text
public static SpriteFont,Microsoft.Xna.Framework.Graphics defaultFont
Résultat Microsoft.Xna.Framework.Graphics.SpriteFont

defaultWholeScreenViewport public_oe static_oe property

A viewport that references the whole screen, used to render the HUD
public static Viewport,Microsoft.Xna.Framework.Graphics defaultWholeScreenViewport
Résultat Microsoft.Xna.Framework.Graphics.Viewport

elapsed public_oe static_oe property

Time elapsed since last frame
public static float elapsed
Résultat float

globalSeed public_oe static_oe property

Internal random number helper
public static float globalSeed
Résultat float

graphics public_oe static_oe property

Reference to the GraphicsDeviceManager
public static GraphicsDeviceManager graphics
Résultat GraphicsDeviceManager

graphicsDevice public_oe static_oe property

Reference to the GraphicsDevice
public static GraphicsDevice graphicsDevice
Résultat GraphicsDevice

height public_oe static_oe property

Reference to the Height of the Viewport
public static float height
Résultat float

hud public_oe static_oe property

Built-In FlxGroup to handle HUD elements since scrollFactor is not yet working
public static FlxGroup,fliXNA_xbox hud
Résultat FlxGroup

keys public_oe static_oe property

Reference to Keyboard input
public static FlxKeyboard,fliXNA_xbox keys
Résultat FlxKeyboard

mouse public_oe static_oe property

Reference to Mouse input
public static FlxMouse mouse
Résultat FlxMouse

mute public_oe static_oe property

Whether all the sounds are mute
public static bool mute
Résultat bool

pad1 public_oe static_oe property

Reference to Gamepad input for Player One
public static FlxGamepad,fliXNA_xbox pad1
Résultat FlxGamepad

pad2 public_oe static_oe property

Reference to Gamepad input for Player Two
public static FlxGamepad,fliXNA_xbox pad2
Résultat FlxGamepad

pad3 public_oe static_oe property

Reference to Gamepad input for Player Three
public static FlxGamepad,fliXNA_xbox pad3
Résultat FlxGamepad

pad4 public_oe static_oe property

Reference to Gamepad input for Player Four
public static FlxGamepad,fliXNA_xbox pad4
Résultat FlxGamepad

rotation public_oe static_oe property

Can be used to rotate the camera
public static float rotation
Résultat float

safeZone public_oe static_oe property

Reference of the Safe Zone, useful for making sure your objects are visible across various televisions
public static FlxRect,fliXNA_xbox safeZone
Résultat FlxRect

sounds public_oe static_oe property

A list of all the sounds being played in the game
public static FlxGroup,fliXNA_xbox sounds
Résultat FlxGroup

storage public_oe static_oe property

Reference to a storage device, perhaps the harddrive on the Xbox? Not yet implemented
public static StorageDevice,Microsoft.Xna.Framework.Storage storage
Résultat Microsoft.Xna.Framework.Storage.StorageDevice

viewport public_oe static_oe property

The current viewport
public static Viewport,Microsoft.Xna.Framework.Graphics viewport
Résultat Microsoft.Xna.Framework.Graphics.Viewport

viewports public_oe static_oe property

Array of viewports, could be used for splitscreen
public static List viewports
Résultat List

volume public_oe static_oe property

Can be used to change volume of all sounds, default is 1.0f which equals 100%
public static float volume
Résultat float

width public_oe static_oe property

Reference to the Width of the Viewport
public static float width
Résultat float

zoom public_oe static_oe property

Can be used to zoom the camera
public static float zoom
Résultat float