class flixel.addons.tile.FlxTilemapExt extends FlxTilemap
Available on all platforms
Extended FlxTilemap class that provides collision detection against slopes * Based on the original by Dirk Bunk. * --- * Also add support to flipped / rotated tiles. * @author Peter Christiansen * @author MrCdK * @link https://github.com/TheTurnipMaster/SlopeDemo
Class Fields
Instance Fields
THIS IS A COPY FROM FlxTilemap * I've only swapped lines 386 and 387 to give DrawTilemap() a chance to set the buffer dirty * --- * Draws the tilemap buffers to the cameras.
function overlapsWithCallback(Object:FlxObject, ?Callback:FlxObject ->FlxObject ->Bool = null, ?FlipCallbackParams:Bool = false, ?Position:FlxPoint = null):Bool
THIS IS A COPY FROM FlxTilemap BUT IT SOLVES SLOPE COLLISION TOO * Checks if the Object overlaps any tiles with any collision flags set, * and calls the specified callback function (if there is one). * Also calls the tile's registered callback if the filter matches. * *
Object | The FlxObject you are checking for overlaps against. * |
Callback | An optional function that takes the form "myCallback(Object1:FlxObject,Object2:FlxObject)", where Object1 is a FlxTile object, and Object2 is the object passed in in the first parameter of this method. * |
FlipCallbackParams | Used to preserve A-B list ordering from FlxObject.separate() - returns the FlxTile object as the second parameter instead. * |
Position | Optional, specify a custom position for the tilemap (useful for overlapsAt()-type funcitonality). * * |
returns | Whether there were overlaps, or if a callback was specified, whatever the return value of the callback was. |
function setClouds(?Clouds:Array<Int> = null):Void
Sets the tiles that are treated as "clouds" or blocks that are only solid from the top. * *
Clouds | An array containing the numbers of the tiles to be treated as clouds. |
function setSlopes(?LeftFloorSlopes:Array<Int> = null, ?RightFloorSlopes:Array<Int> = null, ?LeftCeilSlopes:Array<Int> = null, ?RightCeilSlopes:Array<Int> = null):Void
Sets the slope arrays, which define which tiles are treated as slopes. * *
LeftFloorSlopes | An array containing the numbers of the tiles to be treated as floor tiles with a slope on the left. * |
RightFloorSlopes | An array containing the numbers of the tiles to be treated as floor tiles with a slope on the right. * |
LeftCeilSlopes | An array containing the numbers of the tiles to be treated as ceiling tiles with a slope on the left. * |
RightCeilSlopes | An array containing the numbers of the tiles to be treated as ceiling tiles with a slope on the right. |
function setSpecialTiles(tiles:Array<FlxTileSpecial>):Void
Set the special tiles (rotated or flipped) *
tiles | An Array with all the FlxTileSpecial |