Classes Graphics - hikipuro/rpgmakermv_ref GitHub Wiki

Graphics クラス

[クラス一覧 / rpg_core.js]

(ver.1.6.2)

画像表示関連の処理

定義場所: rpg_core.js

クラスの属性

  • Static クラス

関連項目

メソッド

名前 説明
initialize 初期化
_setupCssFontLoading
canUseCssFontLoading
tickStart 毎フレームの処理開始
tickEnd 毎フレームの処理終了
render ステージを描画する
isWebGL レンダリングタイプが WebGL か確認
hasWebGL 実行中のブラウザが WebGL をサポートしているか確認
canUseDifferenceBlend 'difference' ブレンドモードをサポートするか確認
canUseSaturationBlend 'saturation' ブレンドモードをサポートするか確認
setLoadingImage ローディング画像を設定
startLoading ローディング画像の表示を開始
updateLoading ローディング画像の状態を更新
endLoading ローディング画像の表示を終了
printLoadingError ロードエラーメッセージを画面に表示
eraseLoadingError ロードエラーメッセージを画面から消去
printError
showFps FPSMeter を表示する
hideFps FPSMeter を非表示にする
loadFont
isFontLoaded
playVideo 動画を再生する
_playVideo 動画を再生する
isVideoPlaying 動画が再生中か確認
canPlayVideoType 再生可能な動画形式か確認
setVideoVolume 動画の音量を設定
pageToCanvasX
pageToCanvasY
isInsideCanvas
callGC
_createAllElements
_updateAllElements
_updateRealScale
_makeErrorHtml
_defaultStretchMode
_testCanvasBlendModes
_modifyExistingElements
_createErrorPrinter
_updateErrorPrinter
_createCanvas
_updateCanvas
_createVideo
_updateVideo
_createUpperCanvas
_updateUpperCanvas
_clearUpperCanvas
_paintUpperCanvas
_createRenderer
_updateRenderer
_createFPSMeter
_createModeBox
_createGameFontLoader
_createFontLoader
_centerElement
_disableTextSelection
_disableContextMenu 右クリックメニューの表示を禁止する
_applyCanvasFilter
_onVideoLoad
_onVideoError
_onVideoEnd
_updateVisibility
_isVideoVisible 動画が表示中か確認
_setupEventHandlers
_onWindowResize
_onKeyDown
_onTouchEnd
_switchFPSMeter FPSMeter の表示を切り替え (F2)
_switchStretchMode ゲーム画面の引き伸ばしモードを切り替え (F3)
_switchFullScreen フルスクリーンモードを切り替え (F4)
_isFullScreen フルスクリーン表示か確認
_requestFullScreen フルスクリーン表示への切り替えリクエストを送る
_cancelFullScreen フルスクリーン表示をやめる

initialize

定義: initialize(width, height, type)

初期化

引数 デフォルト値 説明
width number 800 ゲーム画面の幅
height number 600 ゲーム画面の高さ
type string 'auto' レンダラーのタイプ 'canvas', 'webgl', 'auto' のいずれか

_setupCssFontLoading

定義: _setupCssFontLoading()


canUseCssFontLoading

定義: canUseCssFontLoading()


tickStart

定義: tickStart()

毎フレームの処理開始

FPSMeter 用


tickEnd

定義: tickEnd()

毎フレームの処理終了

FPSMeter 用


render

定義: render(stage)

ステージを描画する

引数 説明
stage Stage 描画するステージ

isWebGL

定義: isWebGL()

レンダリングタイプが WebGL か確認

戻り値

  • WebGL: true
  • それ以外: false

hasWebGL

定義: hasWebGL()

実行中のブラウザが WebGL をサポートしているか確認

戻り値

  • サポートしている: true
  • それ以外: false

canUseDifferenceBlend

定義: canUseDifferenceBlend()

'difference' ブレンドモードをサポートするか確認

  • Sprite の色調変更時に確認される

canUseSaturationBlend

定義: canUseSaturationBlend()

'saturation' ブレンドモードをサポートするか確認

  • Sprite の色調変更時に確認される

setLoadingImage

定義: setLoadingImage(src)

ローディング画像を設定する

"Now Loading" の表示で使用する

引数 説明
src string 画像の URL

startLoading

定義: startLoading()

ローディング画像の表示を開始


updateLoading

定義: updateLoading()

ローディング画像の状態を更新


endLoading

定義: endLoading()

ローディング画像の表示を終了


printLoadingError

定義: printLoadingError()

ロードエラーメッセージを画面に表示


eraseLoadingError

定義: eraseLoadingError()

ロードエラーメッセージを画面から消去


printError

定義: printError()


showFps

定義: showFps()

FPSMeter を表示する


hideFps

定義: hideFps()

FPSMeter を非表示にする


loadFont

定義: loadFont()


isFontLoaded

定義: isFontLoaded()


playVideo

定義: playVideo(src)

動画を再生する

引数 説明
src string 動画の URL

_playVideo

定義: _playVideo(src)

動画を再生する (内部的な処理)

playVideo() から呼ばれる

引数 説明
src string 動画の URL

isVideoPlaying

定義: isVideoPlaying()

動画が再生中か確認


canPlayVideoType

定義: canPlayVideoType(type)

引数で指定された動画のタイプが再生可能な形式か確認

引数 説明
type string MIME タイプ

使用例

// rpg_objects.js 10046 行目
Graphics.canPlayVideoType('video/webm')

setVideoVolume

定義: setVideoVolume(value)

動画の音量を設定

引数 説明
value number 動画の音量 (0 - 1)

pageToCanvasX

定義: pageToCanvasX()


pageToCanvasY

定義: pageToCanvasY()


isInsideCanvas

定義: isInsideCanvas()


callGC

定義: callGC()


_createAllElements

定義: _createAllElements()


_updateAllElements

定義: _updateAllElements()


_updateRealScale

定義: _updateRealScale()


_makeErrorHtml

定義: _makeErrorHtml()


_defaultStretchMode

定義: _defaultStretchMode()


_testCanvasBlendModes

定義: _testCanvasBlendModes()


_modifyExistingElements

定義: _modifyExistingElements()


_createErrorPrinter

定義: _createErrorPrinter()


_updateErrorPrinter

定義: _updateErrorPrinter()


_createCanvas

定義: _createCanvas()


_updateCanvas

定義: _updateCanvas()


_createVideo

定義: _createVideo()


_updateVideo

定義: _updateVideo()


_createUpperCanvas

定義: _createUpperCanvas()


_updateUpperCanvas

定義: _updateUpperCanvas()


_clearUpperCanvas

定義: _clearUpperCanvas()


_paintUpperCanvas

定義: _paintUpperCanvas()


_createRenderer

定義: _createRenderer()


_updateRenderer

定義: _updateRenderer()


_createFPSMeter

定義: _createFPSMeter()


_createModeBox

定義: _createModeBox()


_createGameFontLoader

定義: _createGameFontLoader()


_createFontLoader

定義: _createFontLoader()


_centerElement

定義: _centerElement()


_disableTextSelection

定義: _disableTextSelection()


_disableContextMenu

定義: _disableContextMenu()

右クリックメニューの表示を禁止する


_applyCanvasFilter

定義: _applyCanvasFilter()


_onVideoLoad

定義: _onVideoLoad()


_onVideoError

定義: _onVideoError()


_onVideoEnd

定義: _onVideoEnd()


_updateVisibility

定義: _updateVisibility()


_isVideoVisible

定義: _isVideoVisible()

動画が表示中か確認


_setupEventHandlers

定義: _setupEventHandlers()


_onWindowResize

定義: _onWindowResize()


_onKeyDown

定義: _onKeyDown()


_onTouchEnd

定義: _onTouchEnd()


_switchFPSMeter

定義: _switchFPSMeter()

FPSMeter の表示を切り替え (F2 キーの処理)

次の状態を巡回する

  • 非表示
  • FPS を表示
  • 処理時間を表示

_switchStretchMode

定義: _switchStretchMode()

ゲーム画面の引き伸ばしモードを切り替え (F3 キーの処理)

次の状態を巡回する

  • オリジナルのサイズで表示
  • ゲーム画面の表示サイズを調整 (画面からはみ出ないようにする)

_switchFullScreen

定義: _switchFullScreen()

フルスクリーンモードを切り替え (F4 キーの処理)

次の状態を巡回する

  • ウインドウ表示
  • フルスクリーン表示

_isFullScreen

定義: _isFullScreen()

フルスクリーン表示か確認


_requestFullScreen

定義: _requestFullScreen()

フルスクリーン表示への切り替えリクエストを送る


_cancelFullScreen

定義: _cancelFullScreen()

フルスクリーン表示をやめる