|
PeekLevelTile | |||
TileIndex = PeekLevelTile(MapIndex, LevelIndex, TileXpos, TileYpos, [ResolveAnim=false]) | |||
Parameters: MapIndex = The Index Identifier of the Map you wish to query a level within. LevelIndex = The index of the level you wish to query. TileXpos = The X coordinate in the level map TileYpos = The Y coordinate in the level map [ResolveAnim=false] = Optional parameter that forces the command to return a current tile within a animation, if peeking an animation. |
|||
Returns: TileIndex = This will be either a Tile Index or Animation Index |
|||
PeekLevelTile lets us read tiles directly from a level. Note: When reading information from a level map, two types of data can be returned. It could be either a Tile Index or Tile animation Index. You can distinguishe between them by analyzing the values returned. Animations indexes will be 'negative', as when these values are poked into the level, they have the high bit set (bit 31). I.e. This code will distinguish between a Tile Index and an Tile animation Index
FACTS: * Tile Indexes will range between 0 and 4096 * Tile Animation indexes will be returned as negative numbers. As values have their high bit set (bit 31 See PBMapAnim_Mask). you an convert them back to Animation Index by masking (Anding) off the high bit and keeping the lower bits ie. AnimIndex = Value and $ffff. * The TileXpos parameter is in TILES not pixels. * The TileYpos parameter is in TILES not pixels. Mini Tutorial: This example creates a map with tile graphics and a level map the size of the display. The user can draw tiles onto the blank map by Poking them with the mouse as well and examining by hovering the mouse over them.
This example would output.
|
Related Info: | LevelAnimated | LevelDrawMode | LevelSolid | LevelTransparent | PBMapAnim_Mask | PokeLevelTile : |
|
|||||||||||||||||||||||||||||||||||||||
(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com |