FlxHitbox
| Kind | class |
| Package | mobile.flixel |
| Full name | mobile.flixel.FlxHitbox |
| Source | source/mobile/flixel/FlxHitbox.hx |
| Extends | FlxSpriteGroup |
A zone with 4 hint's (A hitbox). It's really easy to customize the layout.
Public fields
| Name | Type | Static | Default | Notes |
|---|---|---|---|---|
hints | Array<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.
| Parameter | Type | Default |
|---|---|---|
ammo | UInt | — |
perHintWidth | Int | — |
perHintHeight | Int | — |
colors | Array<FlxColor> | — |
updateLayout
function updateLayout(width:Int, height:Int):Void
Rebuild the graphics and hit tests together, without replacing bound buttons.
| Parameter | Type | Default |
|---|---|---|
width | Int | — |
height | Int | — |
destroy
override function destroy():Void
Clean up memory and the resize listener when the owning state closes.
Internals
Private / internal members
| Field | Type | Static |
|---|---|---|
laneCount | Int | no |
laneColors | Array<FlxColor> | no |
fillsViewport | Bool | no |
requestedWidth | Int | no |
requestedHeight | Int | no |
layoutWidth | Int | no |
layoutHeight | Int | no |
| 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 |