BitmapDebug available on flash10+ only.

This debug draw makes use of Alchemy opcodes so you may wish to forgo it if you do not want to be subjcet to Adobe licensing rules should you also be using Stage3D.

This debug draw draws things pixel by pixel into alchemy memory, flushing to a BitmapData object. Believe it or not, this is in almost all cases 'faster' than flash's built in graphics API.

Constructor

@:value({ transparent : false, bgColour : 0x333333 })new(width:Int, height:Int, bgColour:Int = 0x333333, transparent:Bool = false)

Construct new BitmapDebug object.

Parameters:

width

The width of Debug draw viewport.

height

The height of Debug draw viewport.

bgColour

The background colour for debug draw. (default 0x333333)

transparent

If true, then the debug draw will use an ARGB bitmap with a transparent background. This will be slower. (default false)

Returns:

The constructed BitmapDebug.

Throws:

#

If width or height are not strictly positive.

Variables

@:value(null)zpp_inner_zn:ZPP_BitmapDebug = null

@private

Methods

clear():Void

@inheritDoc

@:has_untypeddraw(object:Dynamic):Void

@inheritDoc

@:has_untypeddrawAABB(aabb:AABB, colour:Int):Void

@inheritDoc

@:has_untypeddrawCircle(position:Vec2, radius:Float, colour:Int):Void

@inheritDoc

drawCurve(start:Vec2, control:Vec2, end:Vec2, colour:Int):Void

@inheritDoc

@:has_untypeddrawFilledCircle(position:Vec2, radius:Float, colour:Int):Void

@inheritDoc

@:has_untypeddrawFilledPolygon(polygon:Dynamic, colour:Int):Void

@inheritDoc

drawFilledTriangle(p0:Vec2, p1:Vec2, p2:Vec2, colour:Int):Void

@inheritDoc

@:has_untypeddrawLine(start:Vec2, end:Vec2, colour:Int):Void

@inheritDoc

@:has_untypeddrawPolygon(polygon:Dynamic, colour:Int):Void

@inheritDoc

@:value({ radius : 3.0, coils : 3 })drawSpring(start:Vec2, end:Vec2, colour:Int, coils:Int = 3, radius:Float = 3.0):Void

@inheritDoc

flush():Void

@inheritDoc

prepare():Void

Prepare BitmapDebug for operations.

If you are using any other Alchemy code along side BitmapDebug, then you must call this method before performing draw operations so that the assignemd memory block is correctly set.

Inherited Variables

Defined by Debug

bgColour:Int

Background colour for debug draw display.

This value does not have much use for ShapeDebug, or for a transparent BitmapDebug but will still be used in tinting object colours to better fit an idealised background colour.

@:value(null)colour:Null<Int ‑> Int> = null

User defined colour picking.

When not null, this method will be called to decide which colour to use for an object with argument being the id of that object.

The return value should be an RGB value.

@:value(false)cullingEnabled:Bool = false

When true, objects outside the debug draw screen will not be drawn.

The debug draw screen is defined as the rectangle (0,0) -> (width,height). To 'move' the debug draw screen in your world, you should modify the transform property.

This culling has a cost, so is not worth enabling if everything is always on screen anyways.

read onlydisplay:DisplayObject

The flash/openflnme native display object representing debug draw.



When using debug drawer, you should add this to your display list.

@:value(false)drawBodies:Bool = false

If true, then all bodies in the space (whether active or not) will be drawn.

@:value(false)drawBodyDetail:Bool = false

If true, then things like the body centre of mass, and bouncing box will be drawn.

This will only have an effect if drawBodies is true.

@:value(false)drawCollisionArbiters:Bool = false

If true, a representation of contact patches will be drawn.

Only active arbiters are drawn.

@:value(false)drawConstraints:Bool = false

If true, then representations of the active constraints will be drawn.

@:value(false)drawFluidArbiters:Bool = false

If true, a representation of centres of buoyancy and overlap will be drawn.

Only active arbiters are drawn.

@:value(false)drawSensorArbiters:Bool = false

If true, a representation of sensor interactions will be drawn.

Only active arbiters are drawn.

@:value(false)drawShapeAngleIndicators:Bool = false

If true, then indicators of the shapes rotation will be drawn.

This will only have an effect if drawBodies is true.

@:value(false)drawShapeDetail:Bool = false

If true, then things like shape centre of mass and bounding box will be drawn.

This will only have an effect if drawBodies is true.

transform:Mat23

Transformation to apply to all debug draw operations.

This transform can be used to 'move' the debug draw screen through your world as well as rotating and zooming in etc.

This transform effects 'all' debug draw operations and optimisation is in place to not perform any transformation if matrix is the identity matrix.

@:value(null)zpp_inner:ZPP_Debug = null

@private

Inherited Methods