C# Класс fliXNA_xbox.FlxG

Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
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

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

Метод Описание
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());

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

Метод Описание
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

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

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

public static addCamera ( FlxCamera NewCamera ) : FlxCamera
NewCamera FlxCamera
Результат FlxCamera

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

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
Результат System.Boolean

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

Log something to the debugger console in Visual Studio
public static log ( Object data ) : bool
data Object
Результат bool

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

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
Результат System.Boolean

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

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
Результат FlxSound

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

Call this to switch to a new state @use FlxG.switchState(new NewState());
public static switchState ( FlxState State ) : void
State FlxState
Результат void

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

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

Controls the background color of the Game
public static Color bgColor
Результат Color

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

Reference to the Game Camera
public static FlxCamera,fliXNA_xbox camera
Результат FlxCamera

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

Array of cameras, used for splitscreen
public static List cameras
Результат List

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

Unused Console reference Not yet implemented
public static FlxConsole,fliXNA_xbox console
Результат FlxConsole

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

Reference to the ContentManager, important for retrieving Content such as images and sound
public static ContentManager,Microsoft.Xna.Framework.Content content
Результат Microsoft.Xna.Framework.Content.ContentManager

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

The default font that you can use for text
public static SpriteFont,Microsoft.Xna.Framework.Graphics defaultFont
Результат Microsoft.Xna.Framework.Graphics.SpriteFont

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

A viewport that references the whole screen, used to render the HUD
public static Viewport,Microsoft.Xna.Framework.Graphics defaultWholeScreenViewport
Результат Microsoft.Xna.Framework.Graphics.Viewport

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

Time elapsed since last frame
public static float elapsed
Результат float

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

Internal random number helper
public static float globalSeed
Результат float

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

Reference to the GraphicsDeviceManager
public static GraphicsDeviceManager graphics
Результат GraphicsDeviceManager

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

Reference to the GraphicsDevice
public static GraphicsDevice graphicsDevice
Результат GraphicsDevice

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

Reference to the Height of the Viewport
public static float height
Результат float

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

Built-In FlxGroup to handle HUD elements since scrollFactor is not yet working
public static FlxGroup,fliXNA_xbox hud
Результат FlxGroup

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

Reference to Keyboard input
public static FlxKeyboard,fliXNA_xbox keys
Результат FlxKeyboard

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

Reference to Mouse input
public static FlxMouse mouse
Результат FlxMouse

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

Whether all the sounds are mute
public static bool mute
Результат bool

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

Reference to Gamepad input for Player One
public static FlxGamepad,fliXNA_xbox pad1
Результат FlxGamepad

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

Reference to Gamepad input for Player Two
public static FlxGamepad,fliXNA_xbox pad2
Результат FlxGamepad

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

Reference to Gamepad input for Player Three
public static FlxGamepad,fliXNA_xbox pad3
Результат FlxGamepad

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

Reference to Gamepad input for Player Four
public static FlxGamepad,fliXNA_xbox pad4
Результат FlxGamepad

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

Can be used to rotate the camera
public static float rotation
Результат float

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

Reference of the Safe Zone, useful for making sure your objects are visible across various televisions
public static FlxRect,fliXNA_xbox safeZone
Результат FlxRect

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

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

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

Reference to a storage device, perhaps the harddrive on the Xbox? Not yet implemented
public static StorageDevice,Microsoft.Xna.Framework.Storage storage
Результат Microsoft.Xna.Framework.Storage.StorageDevice

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

The current viewport
public static Viewport,Microsoft.Xna.Framework.Graphics viewport
Результат Microsoft.Xna.Framework.Graphics.Viewport

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

Array of viewports, could be used for splitscreen
public static List viewports
Результат List

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

Can be used to change volume of all sounds, default is 1.0f which equals 100%
public static float volume
Результат float

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

Reference to the Width of the Viewport
public static float width
Результат float

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

Can be used to zoom the camera
public static float zoom
Результат float