Skip to main content

FlxHitbox

Kindclass
Packagemobile.flixel
Full namemobile.flixel.FlxHitbox
Sourcesource/mobile/flixel/FlxHitbox.hx
ExtendsFlxSpriteGroup

A zone with 4 hint's (A hitbox). It's really easy to customize the layout.

Public fields​

NameTypeStaticDefaultNotes
hintsArray<FlxButton>no—property (default, null)

Public methods​

new (constructor)​

function new(ammo:UInt, perHintWidth:Int, perHintHeight:Int, colors:Array<FlxColor>):Void

Create the zone.

@param ammo The ammount of hints you want to create. @param perHintWidth The width that the hints will use. @param perHintHeight The height that the hints will use. @param colors The color per hint.

ParameterTypeDefault
ammoUInt—
perHintWidthInt—
perHintHeightInt—
colorsArray<FlxColor>—

View source

updateLayout​

function updateLayout(width:Int, height:Int):Void

Rebuild the graphics and hit tests together, without replacing bound buttons.

ParameterTypeDefault
widthInt—
heightInt—

View source

destroy​

override function destroy():Void

Clean up memory and the resize listener when the owning state closes.

View source

Internals​

Private / internal members
FieldTypeStatic
laneCountIntno
laneColorsArray<FlxColor>no
fillsViewportBoolno
requestedWidthIntno
requestedHeightIntno
layoutWidthIntno
layoutHeightIntno
Method
function onGameResized(_:Int, _:Int):Void
function createHint(X:Float, Y:Float, Width:Int, Height:Int, Color:Int = 0xFFFFFF):FlxButton
function createHintGraphic(Width:Int, Height:Int, Color:Int = 0xFFFFFF):BitmapData