Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Map

マップUI

classdesc

マップUIクラス

constructor
memberof

FrameWork

extends

enchant.Map

Hierarchy

  • Map
    • Map

Index

Constructors

constructor

  • new Map(tipWidth: number, tipHeight: number, parent: Group): Map
  • コンストラクタ

    method
    name

    FrameWork.Map#Map

    Parameters

    • tipWidth: number

      マップチップサイズ.幅

    • tipHeight: number

      マップチップサイズ.高さ

    • parent: Group

      親Group

    Returns Map

Properties

backgroundColor

backgroundColor: string

The Entity background color. Must be provided in the same format as the CSS 'color' property.

type

String

debugColor

debugColor: string

The Entity debug color. Must be provided in the same format as the CSS 'color' property.

type

String

Protected fileName

fileName: string

Private height

height: number

image

image: Surface

Image with which the tile set is displayed on the map.

type

enchant.Surface

opacity

opacity: number

The transparency of this entity. Defines the transparency level from 0 to 1 (0 is completely transparent, 1 is completely opaque).

type

Number

originX

originX: number

The point of origin used for rotation and scaling.

type

Number

originY

originY: number

The point of origin used for rotation and scaling.

type

Number

rotation

rotation: number

Entity rotation angle (degree).

type

Number

scaleX

scaleX: number

Scaling factor on the x axis of this Entity.

type

Number

scaleY

scaleY: number

Scaling factor on the y axis of this Entity.

type

Number

tileHeight

tileHeight: number

Map tile height.

type

Number

tileWidth

tileWidth: number

Map tile width.

type

Number

touchEnabled

touchEnabled: boolean

Indicates whether or not this Entity can be touched.

type

Boolean

visible

visible: boolean

Indicates whether or not to display this Entity.

type

Boolean

Private width

width: number

x

x: number

x coordinates of the Node.

type

Number

y

y: number

y coordinates of the Node.

type

Number

Accessors

FileName

  • set FileName(value: string): void
  • ファイル名プロパティ

    method
    name

    FrameWork.Sprite#Sprite

    Parameters

    • value: string

      ファイル名

    Returns void

Methods

LoadData

  • LoadData(mapData: any): void
  • マップ情報の読み込み

    method
    name

    FrameWork.Map#LoadData

    Parameters

    • mapData: any

      マップ情報(2次元配列)

    Returns void

LoadDatas

  • LoadDatas(mapData0: any, mapData1: any): void
  • 複数のマップ情報の読み込み

    method
    name

    FrameWork.Map#LoadDatas

    Parameters

    • mapData0: any

      前景マップ情報(2次元配列)

    • mapData1: any

      背景マップ情報(2次元配列)

    Returns void

addEventListener

  • addEventListener(type: string, listener: function): void
  • Add a new event listener which will be executed when the event is dispatched.

    Parameters

    • type: string

      Type of the events.

    • listener: function

      Event listener to be added.

        • (e: Event): void
        • Parameters

          • e: Event

          Returns void

    Returns void

checkTile

  • checkTile(x: number, y: number): number
  • Checks what tile is present at the given position.

    Parameters

    • x: number

      x coordinates of the point on the map.

    • y: number

      y coordinates of the point on the map.

    Returns number

    The tile data for the given position.

clearEventListener

  • clearEventListener(type: string): any
  • Clear all defined event listeners of a given type. If no type is given, all listeners will be removed.

    Parameters

    • type: string

      Type of the events.

    Returns any

disableCollection

  • disableCollection(): any

dispatchEvent

  • dispatchEvent(e: Event): any
  • Issue an event.

    Parameters

    • e: Event

      Event to be issued.

    Returns any

enableCollection

  • enableCollection(): any

getBoundingRect

  • getBoundingRect(): object
  • Returns object

    • height: number
    • left: number
    • top: number
    • width: number

getOrientedBoundingRect

  • getOrientedBoundingRect(): object
  • Returns object

    • leftBottom: number
    • leftTop: number
    • rightBottom: number
    • rightTop: number

hitTest

  • hitTest(x: number, y: number): boolean
  • Judges whether or not obstacles are on top of Map.

    Parameters

    • x: number

      x coordinates of detection spot on map.

    • y: number

      y coordinates of detection spot on map.

    Returns boolean

    True, if there are obstacles.

intersect

  • intersect(other: Entity): boolean
  • Performs a collision detection based on whether or not the bounding rectangles are intersecting.

    Parameters

    • other: Entity

      An object like Entity, with the properties x, y, width, height, which are used for the collision detection.

    Returns boolean

    True, if a collision was detected.

loadData

  • loadData(...data: Array<any>): any
  • Set map data. Sets the tile data, whereas the data (two-dimensional array with indizes starting from 0) is mapped on the image starting from the upper left corner. When more than one map data array is set, they are displayed in reverse order.

    Parameters

    • Rest ...data: Array<any>

      Two-dimensional array of tile indizes. Multiple designations possible.

    Returns any

moveBy

  • moveBy(x: any, y: any): any
  • Move the Node relative to its current position.

    Parameters

    • x: any

      x axis movement distance.

    • y: any

      y axis movement distance.

    Returns any

moveTo

  • moveTo(x: any, y: any): any
  • Move the Node to the given target location.

    Parameters

    • x: any

      Target x coordinates.

    • y: any

      Target y coordinates.

    Returns any

on

  • on(eventName: string, func: function): any
  • Synonym for addEventListener.

    see

    enchant.EventTarget#addEventListener

    Parameters

    • eventName: string
    • func: function
        • (arg: any): void
        • Parameters

          • arg: any

          Returns void

    Returns any

Private redraw

  • redraw(x: number, y: number, width: number, height: number): any
  • Parameters

    • x: number
    • y: number
    • width: number
    • height: number

    Returns any

remove

  • remove(): any

removeEventListener

  • removeEventListener(type: string, listener: function): void
  • Delete an event listener.

    Parameters

    • type: string
    • listener: function

      Event listener to be deleted.

        • (e: Event): void
        • Parameters

          • e: Event

          Returns void

    Returns void

rotate

  • rotate(deg: number): any
  • Rotate this Entity.

    Parameters

    • deg: number

      Rotation angle (degree).

    Returns any

scale

  • scale(x: number, y: number): any
  • Enlarges or shrinks this Entity.

    Parameters

    • x: number

      Scaling factor on the x axis.

    • y: number

    Returns any

within

  • within(other: Entity, distance: number): boolean
  • Performs a collision detection based on distance from the Entity's central point.

    Parameters

    • other: Entity

      An object like Entity, with properties x, y, width, height, which are used for the collision detection.

    • distance: number

    Returns boolean

    True, if a collision was detected.

Generated using TypeDoc