Classes Bitmap - hikipuro/rpgmakermv_ref GitHub Wiki
Bitmap クラス
[クラス一覧]
(ver.1.6.2)
定義場所: rpg_core.js
関連項目
フィールド
名前 | 型 | 初期値 | 説明 |
---|---|---|---|
_reuseImages | Array | [] | (Static) iOS用の再利用する画像の配列 |
_image | null | ||
_url | string | "" | |
_paintOpacity | number | 255 | |
_smooth | boolean | false | |
_loadListeners | Array | [] | |
_loadingState | string | "none" | |
_decodeAfterRequest | boolean | false | |
_dirty | boolean | undefined | |
_defer | boolean | undefined | |
cacheEntry | null | ||
fontFace | string | "GameFont" | |
fontSize | number | 28 | |
fontItalic | boolean | false | |
textColor | string | "#ffffff" | |
outlineColor | string | "rgba(0, 0, 0, 0.5)" | |
outlineWidth | number | 4 |
プロパティ
名前 | 型 | 説明 |
---|---|---|
url | string | (読み込み専用) |
baseTexture | PIXI.BaseTexture | (読み込み専用) |
canvas | HTMLCanvasElement | (読み込み専用) |
context | CanvasRenderingContext2D | (読み込み専用) |
width | number | (読み込み専用) |
height | number | (読み込み専用) |
rect | Rectangle | (読み込み専用) |
smooth | boolean | |
paintOpacity | number |
メソッド
名前 | 説明 |
---|---|
_createCanvas | |
_createBaseTexture | |
_clearImgInstance | |
_renewCanvas | |
initialize | 初期化 |
load | |
snap | |
isReady | |
isError | |
touch | |
resize | サイズを変更する |
blt | |
bltImage | |
getPixel | 色を取得する |
getAlphaPixel | 透明度を取得する |
clearRect | 矩形領域を消去する |
clear | 全体を消去する |
fillRect | 矩形領域を塗りつぶす |
fillAll | 全体を塗りつぶす |
gradientFillRect | 矩形領域をグラデーションで塗りつぶす |
drawCircle | 円を描く |
drawText | テキストをアウトライン付きで描く |
measureTextWidth | |
adjustTone | |
rotateHue | |
blur | |
addLoadListener | |
_makeFontNameText | |
_drawTextOutline | テキストのアウトラインを描く |
_drawTextBody | テキストを描く |
_onLoad | |
decode | |
_callLoadListeners | |
_onError | |
_setDirty | ダーティフラグをセットする |
checkDirty | ダーティフラグがセットされている場合は表示内容を更新する |
request | |
_requestImage | |
isRequestOnly | |
isRequestReady | |
startRequest |
_createCanvas
定義: _createCanvas(width, height)
_createBaseTexture
定義: _createBaseTexture(source)
_clearImgInstance
定義: _clearImgInstance()
_renewCanvas
定義: _renewCanvas()
initialize
定義: initialize(width, height)
初期化。コンストラクタから呼び出す
load
定義: load(url)
(Static メソッド)
snap
定義: snap(stage)
(Static メソッド)
isReady
定義: isReady()
isError
定義: isError()
touch
定義: touch()
resize
定義: resize(width, height)
サイズを変更する
- 最小サイズ 1x1
引数 | 型 | 説明 |
---|---|---|
width | number | 幅 |
height | number | 高さ |
blt
定義: blt(source, sx, sy, sw, sh, dx, dy, dw, dh)
bltImage
定義: bltImage(source, sx, sy, sw, sh, dx, dy, dw, dh)
getPixel
定義: getPixel(x, y)
色を取得する
引数 | 型 | 説明 |
---|---|---|
x | number | X座標 |
y | number | Y座標 |
戻り値
(string) "#000000" 形式の文字列
getAlphaPixel
定義: getAlphaPixel(x, y)
透明度を取得する
引数 | 型 | 説明 |
---|---|---|
x | number | X座標 |
y | number | Y座標 |
戻り値
(number) 0 - 255
clearRect
定義: clearRect(x, y, width, height)
矩形領域を消去する
引数 | 型 | 説明 |
---|---|---|
x | number | 左上のX座標 |
y | number | 左上のY座標 |
width | number | 幅 |
height | number | 高さ |
clear
定義: clear()
全体を消去する
fillRect
定義: fillRect(x, y, width, height, color)
矩形領域を塗りつぶす
引数 | 型 | 説明 |
---|---|---|
x | number | 左上のX座標 |
y | number | 左上のY座標 |
width | number | 幅 |
height | number | 高さ |
color | string | CSS形式の色 |
fillAll
定義: fillAll(color)
全体を塗りつぶす
引数 | 型 | 説明 |
---|---|---|
color | string | CSS形式の色 |
gradientFillRect
定義: gradientFillRect(x, y, width, height, color1, color2, vertical)
矩形領域をグラデーションで塗りつぶす
引数 | 型 | 説明 |
---|---|---|
x | number | 左上のX座標 |
y | number | 左上のY座標 |
width | number | 幅 |
height | number | 高さ |
color1 | string | CSS形式の色 (開始) |
color2 | string | CSS形式の色 (終了) |
vertical | boolean | 縦方向: true, 横方向: false |
drawCircle
定義: drawCircle(x, y, radius, color)
円を描く
引数 | 型 | 説明 |
---|---|---|
x | number | 中心のX座標 |
y | number | 中心のY座標 |
radius | number | 半径 |
color | string | CSS形式の色 |
drawText
定義: drawText(text, x, y, maxWidth, lineHeight, align)
テキストをアウトライン付きで描く
引数 | 型 | 説明 |
---|---|---|
text | string | テキスト |
x | number | X座標 |
y | number | Y座標 |
maxWidth | number | 最大幅 |
lineHeight | number | 1行の高さ |
align | string | 位置の揃え方 "left", "center", "right" のいずれか |
measureTextWidth
定義: measureTextWidth(text)
adjustTone
定義: adjustTone(r, g, b)
rotateHue
定義: rotateHue(offset)
blur
定義: blur()
addLoadListener
定義: addLoadListener(listner)
_makeFontNameText
定義: _makeFontNameText()
_drawTextOutline
定義: _drawTextOutline(text, tx, ty, maxWidth)
テキストのアウトラインを描く
- テキストの色: outlineColor の値
- アウトラインの太さ: outlineWidth の値
引数 | 型 | 説明 |
---|---|---|
text | string | テキスト |
tx | number | X座標 |
ty | number | Y座標 |
maxWidth | number | 最大幅 |
_drawTextBody
定義: _drawTextBody(text, tx, ty, maxWidth)
テキストを描く
- テキストの色: textColor の値
引数 | 型 | 説明 |
---|---|---|
text | string | テキスト |
tx | number | X座標 |
ty | number | Y座標 |
maxWidth | number | 最大幅 |
_onLoad
定義: _onLoad()
decode
定義: decode()
_callLoadListeners
定義: _callLoadListeners()
_onError
定義: _onError()
_setDirty
定義: _setDirty()
ダーティフラグをセットする
this._dirty = true;
checkDirty
定義: checkDirty()
ダーティフラグがセットされている場合は表示内容を更新する
- ダーティフラグがセットされていない場合: なにもしない
- _baseTexture.update() を呼び出す
- ダーティフラグをクリアする
request
定義: request(url)
(Static メソッド)
_requestImage
定義: _requestImage(url)
isRequestOnly
定義: isRequestOnly()
isRequestReady
定義: isRequestReady()
startRequest
定義: startRequest()