extends FlxBaseTilemap › FlxObject › FlxBasic
extended by FlxNapeTilemap, FlxRayCastTilemap, FlxTilemapExt
This is a traditional tilemap display and collision class. It takes a string of comma-separated numbers and then associates those values with tiles from the sheet you pass in. It also includes some handy static parsers that can convert arrays or images into strings that can be loaded.
antialiasing:Bool = false
Controls whether the object is smoothed when rotated, affects performance.
Blending modes, just like Photoshop or whatever, e.g. "multiply", "screen", etc.
Tints the whole sprite to a color (0xRRGGBB format) - similar to OpenGL vertex colors. You can use 0xAARRGGBB colors, but the alpha value will simply be ignored. To change the opacity use alpha.
Use to offset the drawing position of the tilemap, just like FlxSprite.
Changes the size of this tilemap. Default is (1, 1). Anything other than the default is very slow with blitting!
GLSL shader for this tilemap. Only works with OpenFL Next or WebGL. Avoid changing it frequently as this is a costly operation.
Call this function to lock the automatic camera to the map's edges.
Specify which game camera you want. If null getScreenPosition() will just grab the first global camera.
Adjusts the camera follow boundary by whatever number of tiles you specify here. Handy for blocking off deadends that are offscreen, etc. Use a negative number to add padding instead of hiding the edges.
Whether to update the collision system's world size, default value is true.
getTileCoords(Index:Int, Midpoint:Bool = true):Array<FlxPoint>
Returns a new array full of every coordinate of the requested tile type.
The requested tile type.
Whether to return the coordinates of the tile midpoint, or upper left corner. Default is true, return midpoint.
An Array with a list of all the coordinates of that tile type.
Check and see if this object is currently on screen. Differs from
in that it takes the actual graphic into account, not just the hitbox or bounding box or whatever.
Specify which game camera you want. If
Whether the object is on screen or not.
overlapsWithCallback(Object:FlxObject, ?Callback:(FlxObject, FlxObject) ‑> Bool, FlipCallbackParams:Bool = false, ?Position:FlxPoint):Bool
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.
The FlxObject you are checking for overlaps against.
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.
Used to preserve A-B list ordering from FlxObject.separate() - returns the FlxTile object as the second parameter instead.
Optional, specify a custom position for the tilemap (useful for overlapsAt()-type functionality).
Whether there were overlaps, or if a callback was specified, whatever the return value of the callback was.
Shoots a ray from the start point to the end point. If/when it passes through a tile, it stores that point and returns false.
The world coordinates of the start of the ray.
The world coordinates of the end of the ray.
An optional point containing the first wall impact if there was one. Null otherwise.
Defaults to 1, meaning check every tile or so. Higher means more checks!
Returns true if the ray made it from Start to End without hitting anything. Returns false and fills Result if a tile was hit.
Set the dirty flag on all the tilemap buffers. Basically forces a reset of the drawn tilemaps, even if it wasn't necessary.
Whether to flag the tilemap buffers as dirty or not.
tileToSprite(X:Int, Y:Int, NewTile:Int = 0, ?SpriteFactory:FlxTileProperties ‑> FlxSprite):FlxSprite
Change a particular tile to FlxSprite. Or just copy the graphic if you dont want any changes to map data itself.
The X coordinate of the tile (in tiles, not pixels).
The Y coordinate of the tile (in tiles, not pixels).
New tile for the map data. Use -1 if you dont want any changes. Default = 0 (empty)
Method for converting FlxTile to FlxSprite. If null then will be used defaultTileToSprite() method.