com.theoworlds.builder.Tile |
Tile class -- floor tile main class
1.0
© TheoWorlds.com, 2007--2009.
| com. | Tile class -- floor tile main class |
| Variables | |
| MARK_COLOR | |
| WALKABLE_COLOR | |
| UNWALKABLE_COLOR | |
| _baseWalkable | this parametters is set when initializing the World unlike Tile.oWalkable it is NOT changed. |
| _baseAction | the same as with _baseWalkable it stores the current action |
| _markerMC | |
| _gridMC | |
| Functions | |
| Tile | |
| init | inherited from MapObjectSettings(MapObjectSettings) TileSettings(TileSettings) and overwritten |
| drawTilePreview | for debug tile registration point is in the center tileElevation -- if the tile has height, it will draw a 3D tile |
| Properties | |
| grid | draws a tile preview or removes it (Tile._gridMC) used for debug |
| grid | - is the tile outline displayed (a grid) |
| mark | used for debug to mark tiles in different colors |
| stackable | -- a flag (Boolean) that tells if other tiles can be stacked on top |
| stackable | -- stackable value (Tile._stackable) |
| walkable | -- returns walkable value (Tile._walkable) |
| walkable | |
| baseWalkable | returns the default walkable flag (Tile._baseWalkable) that is set on initialization |
| baseWalkable | do not use it this method is called only by MapEditor (MapEditor) |
| baseActionName | do not use it this method is called only by MapEditor (MapEditor) |
| baseActionName | the default action name that is set on initialization |
| elevation | the height/elevation of a tile |
| elevation |
private var _baseWalkable: Boolean
this parametters is set when initializing the World unlike Tile.oWalkable it is NOT changed. It is used to store the walkable value set during initialization this is because oWalkable can be changed depending on Furniture.walkable. this is needed when creating dynamic landscapes (that change) Example Puddle._walkable == 0; // we can not walk on it, but if we place a wood log on it log.walkable == 1, it becomes walkable the walkable is changed in the base tile so we don’t have to loop through the whole stack of furniture to find it out World.aFloor[tileX--1][tileY--1][0] (World.aFloor) When we delete furniture, the base tile gets the walkable value of the furniture that was under the deleted one OR, if there is nothing on the top, we take the value stored in baseWalkable
public function Tile( target: MovieClip, spriteMCName: String, spriteMCZOrder: Number, tileX: Number, tileY: Number, ts: TileSettings )
| target | MovieClip to wich the character object is attached to |
| spriteMCName | the name of the Character._spriteMC (if it’s created) |
| spriteMCZOrder | z--order of the Character._spriteMC (if it’s created) |
| tileX | position on the map -- column(:Number) (also storred in CharacterSettings) |
| tileY | position on the map -- row(:Number)... |
| ts | (TileSettings) |
private function init( ts: TileSettings ):Void
inherited from MapObjectSettings(MapObjectSettings) TileSettings(TileSettings) and overwritten
public static function drawTilePreview ( target: MovieClip, borderWidth: Number, borderColor: Number, borderAlpha: Number, tileColor: Number, tileAlpha: Number, tileElevation: Number ):Void
for debug tile registration point is in the center tileElevation -- if the tile has height, it will draw a 3D tile
| target | MovieClip |
| borderWidth | Number |
| borderColor | Number |
| borderAlpha | Number |
| tileColor | Number |
| tileColor | Number |
| tileAlpha | Number |
| tileElevation | Number |
public function set grid( b: Boolean ):Void
draws a tile preview or removes it (Tile._gridMC) used for debug
| b | (Boolean) |
public function get baseWalkable():Boolean
returns the default walkable flag (Tile._baseWalkable) that is set on initialization
private static var MARK_COLOR: Number
private static var WALKABLE_COLOR: Number
private static var UNWALKABLE_COLOR: Number
this parametters is set when initializing the World unlike Tile.oWalkable it is NOT changed.
private var _baseWalkable: Boolean
the same as with _baseWalkable it stores the current action
private var _baseAction: String
private var _markerMC: MovieClip
private var _gridMC: MovieClip
public function Tile( target: MovieClip, spriteMCName: String, spriteMCZOrder: Number, tileX: Number, tileY: Number, ts: TileSettings )
inherited from MapObjectSettings(MapObjectSettings) TileSettings(TileSettings) and overwritten
private function init( ts: TileSettings ):Void
for debug tile registration point is in the center tileElevation -- if the tile has height, it will draw a 3D tile
public static function drawTilePreview ( target: MovieClip, borderWidth: Number, borderColor: Number, borderAlpha: Number, tileColor: Number, tileAlpha: Number, tileElevation: Number ):Void
draws a tile preview or removes it (Tile._gridMC) used for debug
public function set grid( b: Boolean ):Void
used for debug to mark tiles in different colors
public function set mark( b: Boolean ):Void
-- a flag (Boolean) that tells if other tiles can be stacked on top
public function get stackable():Boolean
-- returns walkable value (Tile._walkable)
public function get walkable():Boolean
returns the default walkable flag (Tile._baseWalkable) that is set on initialization
public function get baseWalkable():Boolean
do not use it this method is called only by MapEditor (MapEditor)
public function set baseActionName( action: String ):Void
the height/elevation of a tile
public function get elevation():Number
a flag (Boolean) that tells if the furniture can be stepped on by characters (Character)
public function get walkable():Boolean