This abstract provides consistent cross-target unicode support for characters of any width.
Due to differing internal representations of strings across targets, only the basic
multilingual plane (BMP) is supported consistently by String
class.
This abstract provides API to consistently handle all characters even beyond BMP.
See also:
Static variables
Static methods
staticcharCodeAt(this:String, index:Int):Null<Int>
Returns the character code at position index
of this
String.
This abstract provides API to consistently handle all characters even beyond BMP.
See also:
Static variables
Static methods
staticcharAt(this:String, index:Int):String
Returns the character at position index
of this
String.
If index
is negative or exceeds this.length
, the empty String ""
+is returned.
staticcharCodeAt(this:String, index:Int):Null<Int>
Returns the character code at position index
of this
String.
If index
is negative or exceeds this.length
, null
is returned.
staticsubstr(this:String, pos:Int, ?len:Int):String
Returns len
characters of this
String, starting at position pos
.
If len
is omitted, all characters from position pos
to the end of
this
String are included.
Prior to 4.9.0 it was useful to change this value, but that feature is deprecated.
Instead use the defaultDrawTarget
argument in FlxG.cameras.add
.
-orFlxG.cameras.setDefaultDrawTarget
.
See also:
FlxG.cameras.setDefaultDrawTarget
staticdefaultZoom:Float = 1.0
Any FlxCamera
with a zoom of 0 (the default value) will have this zoom value.
Constructor
new(X:Int = 0, Y:Int = 0, Width:Int = 0, Height:Int = 0, Zoom:Float = 0)
Instantiates a new camera at the specified location, with the specified size and zoom level.
Parameters:
X | X location of the camera's display in pixels. Uses native, 1:1 resolution, ignores zoom. | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Y | Y location of the camera's display in pixels. Uses native, 1:1 resolution, ignores zoom. | ||||||||||||||||||||
Width | The width of the camera display in pixels. | ||||||||||||||||||||
Height | The height of the camera display in pixels. | ||||||||||||||||||||
Zoom | The initial zoom level of the camera.
+or See also:
|
X | X location of the camera's display in pixels. Uses native, 1:1 resolution, ignores zoom. |
---|---|
Y | Y location of the camera's display in pixels. Uses native, 1:1 resolution, ignores zoom. |
Width | The width of the camera display in pixels. |
Height | The height of the camera display in pixels. |
Zoom | The initial zoom level of the camera. A zoom level of 2 will make all pixels display at 2x resolution. |
Variables
antialiasing:Bool = false
Whether the camera display is smooth and filtered, or chunky and pixelated. Default behavior is chunky-style.
bgColor:FlxColor
The natural background color of the camera, in AARRGGBB
format. Defaults to FlxG.cameras.bgColor
.
On Flash, transparent backgrounds can be used in conjunction with useBgAlphaBlending
.
buffer:BitmapData
The actual BitmapData
of the camera display itself.
diff --git a/flixel/FlxG.html b/flixel/FlxG.html
index f76385f17..a0c98a0ed 100644
--- a/flixel/FlxG.html
+++ b/flixel/FlxG.html
@@ -1,7 +1,7 @@
-
Global helper class for audio, input, the camera system, the debugger and other global properties.
Static variables
staticread onlyVERSION:FlxVersion = new FlxVersion(5, 4, 1)
The HaxeFlixel version, in semantic versioning syntax. Use Std.string()
+
Global helper class for audio, input, the camera system, the debugger and other global properties.
Static variables
staticread onlyVERSION:FlxVersion = new FlxVersion(5, 6, 2)
The HaxeFlixel version, in semantic versioning syntax. Use Std.string()
on it to get a String
formatted like this: "HaxeFlixel MAJOR.MINOR.PATCH-COMMIT_SHA"
.
staticanimationTimeScale:Float = 1.0
How fast or slow animations should pass in the game; default is 1.0
.
5.5.0
.staticautoPause:Bool = true
Whether the game should be paused when focus is lost or not. Use -D FLX_NO_FOCUS_LOST_SCREEN
if you only want to get rid of the default pause screen.
Override onFocus()
and onFocusLost()
for your own behaviour in your state.
staticread onlybitmap:BitmapFrontEnd = new BitmapFrontEnd()
Contains things related to bitmaps, for example regarding the BitmapData
cache and the cache itself.
staticread onlybitmapLog:BitmapLogFrontEnd = new BitmapLogFrontEnd()
Used to add images to the bitmap log window.
staticcamera:FlxCamera
By default this just refers to the first entry in the FlxG.cameras.list
@@ -57,6 +57,8 @@
pixel perfect match on the intersecting area. Works with rotated and animated sprites.
May be slow, so use it sparingly.
Parameters:
sprite1 | The first |
---|---|
sprite2 | The second |
alphaTolerance | The tolerance value above which alpha pixels are included.
Default to |
camera | If the collision is taking place in a camera other than
- |
Returns:
Whether the sprites collide
staticinlineremoveChild<T>(child:T):T
Removes a child from the Flixel display list, if it is part of it.
Parameters:
child | The |
---|
Returns:
The removed DisplayObject
staticinlineresetGame():Void
Like hitting the reset button a game console, this will re-launch the game as if it just started.
staticinlineresetState():Void
Request a reset of the current game state.
-Calls switchState()
with a new instance of the current state
.
staticinlineresizeGame(width:Int, height:Int):Void
Resizes the game within the window by reapplying the current scale mode.
staticresizeWindow(width:Int, height:Int):Void
Resizes the window. Only works on desktop targets (Neko, Windows, Linux, Mac).
staticinlineswitchState(nextState:FlxState):Void
Attempts to switch from the current game state to nextState
.
-The state switch is successful if switchTo()
of the current state
returns true
.
FlxG.camera
(the default/current) then pass it here.Returns:
Whether the sprites collide
staticinlineremoveChild<T>(child:T):T
Removes a child from the Flixel display list, if it is part of it.
Parameters:
child | The |
---|
Returns:
The removed DisplayObject
staticinlineresetGame():Void
Like hitting the reset button on a game console, this will re-launch the game as if it just started.
staticinlineresetState():Void
Request a reset of the current game state.
+Calls switchState()
with a new instance of the current state
.
staticinlineresizeGame(width:Int, height:Int):Void
Resizes the game within the window by reapplying the current scale mode.
staticresizeWindow(width:Int, height:Int):Void
Resizes the window. Only works on desktop targets (Neko, Windows, Linux, Mac).
staticinlineswitchState(nextState:NextState):Void
Attempts to switch from the current game state to nextState
.
+The state switch is successful if switchTo()
of the current state
returns true
.
Parameters:
nextState | A constructor for the initial state, ex: |
---|
class FlxGame
package flixel
extends Sprite › DisplayObjectContainer › InteractiveObject › DisplayObject › EventDispatcher
FlxGame
is the heart of all Flixel games, and contains a bunch of basic game loops and things.
It is a long and sloppy file that you shouldn't have to worry about too much!
It is basically only used to create your game object in the first place,
-after that FlxG
and FlxState
have all the useful stuff you actually need.
Constructor
new(gameWidth:Int = 0, gameHeight:Int = 0, ?initialState:Class<FlxState>, updateFramerate:Int = 60, drawFramerate:Int = 60, skipSplash:Bool = false, startFullscreen:Bool = false)
Instantiate a new game object.
Parameters:
gameWidth | The width of your game in pixels. If Constructor
|
---|
gameWidth | The width of your game in pixels. If |
---|---|
gameHeight | The height of your game in pixels. If |
initialState | The class name of the state you want to create and switch to first (e.g. |
updateFramerate | How frequently the game should update. Default is 60 fps. |
drawFramerate | Sets the actual display / draw framerate for the game. Default is 60 fps. |
skipSplash | Whether you want to skip the flixel splash screen with |
startFullscreen | Whether to start the game in fullscreen mode (desktop targets only). |
See also: