Class: textConsole

textConsole(width, column)

TEXT CONSOLE DISPLAY EMU LIB javascript ncurses

Constructor

new textConsole(width, column)

instance create
Parameters:
Name Type Description
width number textBufferWidthSize
column number textBufferLineSize
Source:
Example
consl = new textConsole(80, 30);
consl.setFontId("std"); 
consl.setPrompt( ["#" ,"_"]);
consl.setCharwidth(8);
consl.setLinewidth(16);

consl.draw(gameCore, 0 ,0);

Members

buffer :Array.<string>

textBuffer
Type:
  • Array.<string>
Source:

cursor :object

cursorPosition
Type:
  • object
Source:

Methods

addch(chr_to_add)

カーソル位置に1文字表示
Parameters:
Name Type Description
chr_to_add string 文字
Source:

clear()

画面全体を消去
Source:

delch()

カーソル位置の文字を削除し、それより右の文字列を左に1文字分ずらす
Source:

deleteln()

カーソル位置の行を削除し、それより下の行を上に1行分スクロールする
Source:

draw(g, xopt, yopt)

draw funciton/描画してscreenに反映する
Parameters:
Name Type Attributes Default Description
g GameCore gameCoreインスタンス
x number <optional>
0 描画位置x
y number <optional>
0 描画位置y
Source:

insch(string)

カーソル位置に文字を挿入し、それより右の文字列を右に1文字分ずらす
Parameters:
Name Type Description
string string
Source:

insertln()

カーソル位置に空行を挿入し、それより下の行を下方向に1行分スクロールする
Source:

move(new_x, new_y)

カーソルを任意の位置(座標)に移動
Parameters:
Name Type Description
new_x number 移動先x座標
new_y number 移動先y座標
Source:

mvprintw(text, x, y)

カーソル位置を指定して右方向に文字列を表示
\ move関数とprintw関数を組み合わせた関数
Parameters:
Name Type Description
text string 文字列
x number 開始x座標
y number 開始y座標
Source:

printw(text)

カーソル位置から右方向に文字列を表示
Parameters:
Name Type Description
text string 文字列
Source:

scrolllock(mode)

スクロール可能/不可を設定 (Scroll:false/free ,true/lock
Parameters:
Name Type Description
mode boolean
Source:

setCharwidth(num)

文字幅の指定
Parameters:
Name Type Description
num number 文字幅pixel
Source:

setFontId(Id)

使用するフォントIDの指定/ASCII font Id
Parameters:
Name Type Description
Id number | string
Source:

setLinewidth(num)

改行幅の指定
Parameters:
Name Type Description
num number 行間pixel
Source:

setPrompt(p)

カーソル文字の指定
Parameters:
Name Type Description
p Array.<string>
Source:
Example
["_","#"]

wscrl(linenum)

指定行数をスクロール
Parameters:
Name Type Description
linenum number
Source: