Class: MessageLayer

MessageLayer(rect)

new MessageLayer(rect)

Parameters:
Name Type Description
rect Rect
Implements:

Extends

Members

(static, constant) KINSOKU_BURASAGARI

(static, constant) KINSOKU_NONE

(static, constant) KINSOKU_OIDASHI

(readonly) canvas

Properties:
Name Type Description
canvas Canvas
Inherited From:

(readonly) ctx

Properties:
Name Type Description
ctx CanvasRenderingContext2D
Inherited From:

(constant) initializer :string

The name of constructor the class, will be used to restore the object. The constructor has to be accessable via
window[initializer]
Type:
  • string
Overrides:
Implements:

needRedraw

Properties:
Type Description
boolean
Inherited From:

partialDraw

Properties:
Type Description
boolean
Inherited From:

rect

Properties:
Type Description
Rect
Overrides:

Methods

addButton(button)

Parameters:
Name Type Description
button Button
Parameters:
Name Type Description
link Link

addRoutineButton(button)

Parameters:
Name Type Description
button RoutineButton

canDrawPartial() → {boolean}

Can it draw only a certain part? If yes, drawContext will be called with rect, and drawable should draw only in that rect. Drawing less = better performance.
Inherited From:
Returns:
Type
boolean

children() → {Array.<Drawable>}

Drawable to be draw in the layer
Overrides:
Returns:
Type
Array.<Drawable>

draw(drawable)

Parameters:
Name Type Description
drawable Drawable The drawable to redraw, it has to be one of the children.
Inherited From:

drawOnContext(context, rect)

Draw on this context. If canDrawPartial is true, this can be called with rect. When it is called with rect, drawable should only draw in the specificed area.
Parameters:
Name Type Description
context CanvasRenderingContext2D
rect Rect In the context's coordinate.
Inherited From:

flush() → {boolean}

Inherited From:
Returns:
trueならredrawしています、falseならしていない
Type
boolean

frame() → {Rect}

Return the frame, which is the actually area this drawable draws on (including things like shadow). Subclass should override if needed.
Inherited From:
Returns:
Type
Rect

getCorrespondingLayer() → {Layer}

Get the fore / back corresponding layer
Inherited From:
Returns:
Type
Layer

measureText(texts) → {TextMetrics}

このメッセージレイヤで文字を書いたら、どのくらいのサイズになるのかを計算します 改行は計算しません。 stringが渡されたら今のメッセージレイヤのスタイルで計算します TextPropertiesだと、そのobjectの設定で計算します
Parameters:
Name Type Description
texts Array.<string> | Array.<TextProperties>
Returns:
Type
TextMetrics

mousedown() → {boolean}

Return true if this layer handled the event, otherwise the event will passed to the next layer.
Overrides:
Returns:
Type
boolean

mousemove() → {boolean}

Return true if this layer handled the event, otherwise the event will passed to the next layer.
Overrides:
Returns:
Type
boolean

mouseup() → {boolean}

Return true if this layer handled the event, otherwise the event will passed to the next layer.
Overrides:
Returns:
Type
boolean

objectToBeSerialized(key) → {object|Serializable}

Return an object to be serialized for a specific key.
Parameters:
Name Type Description
key string The key of property to be serialized
Overrides:
Implements:
Returns:
- An object or serializable to be saved for the specific key, return undefined = not to be saved.
Type
object | Serializable

redrawRect(rect)

Parameters:
Name Type Description
rect Rect Redraw a rect within the layer
Inherited From:

resetCursor()

Reset cursor location according to margin and rect.

resetMessageLayer()

Reset message Layer

setRect(rect)

Parameters:
Name Type Description
rect Rect
Overrides:

showGlyphLayer(glyphLayer, mode)

Parameters:
Name Type Description
glyphLayer GlyphLayer
mode string "line" or "page"