API Docs for: 最后更新日期:2014年8月25日
Google搜索   
Show:

グローバル関数 Class

Defined in: main/Function.js:1

Available since 1.0.0

Methods

addChild

(
  • expression
)
public

Defined in main/Function.js:188

Available since 1.0.0

Stageに子 DisplayObject インスタンスを追加します。

Parameters:

  • expression Object

    追加される DisplayObject インスタンスです。

Example:

var backLayer = LSprite();
addChild(backLayer);

getTimer

() Float public

Defined in main/Function.js:326

Available since 1.0.0

ライブラリの初期化終わってからの経過時間をミリ秒単位で返します。

Returns:

Float:

ライブラリの初期化終わってからの経過時間。

LExtends

(
  • child
  • parent
  • params
)
public

Defined in main/Function.js:276

Available since 1.0.0

オブジェクトの継承。base と同等。

Parameters:

  • child LDisplayObject

    子供オブジェクト。

  • parent Object

    親オブジェクト。

  • params Array

    パラメータ。

Example:

LInit(50, "legend", 800, 480, main);
function FatherClass(){
    this.name = "Father";
}
FatherClass.prototype.getName = function(){
    return this.name;
};
function ChildClass(){
    LExtends(this,FatherClass,[]);
    this.name = "Child";
}
function main () {
    LGlobal.setDebug(true);
    var father = new FatherClass();
    var child = new ChildClass();
    trace("father.getName() = " + father.getName()); //father.getName() = Father
    trace("child.getName() = " + child.getName());//child.getName() = Child
}

LInit

(
  • speed
  • divid
  • width
  • height
  • callback
  • type
)
public

Defined in main/Function.js:215

Available since 1.0.0

ライブラリの初期化。init と同等。

Parameters:

  • speed Float

    ゲームスピード(单位:ミリ秒), FPS = 1000 / speed。

  • divid String

    divタブのid,ライブラリの初期化をする時,自動的にこのdivタブの中にcanvasを生成する。

  • width Int

    ゲーム画面の幅。

  • height Int

    ゲーム画面の高さ。

  • callback Function

    ライブラリの初期化が終わったら,この関数を呼び出す。

  • type String

    ライブラリの初期化がwindow.onloadの後にしたら,このパラメータをLEvent.INITに設定しなければなりません。

Example:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script type="text/javascript" src="../lufylegend-x.x.x.min.js"></script> 
<title>demo</title>
</head>
<body>
<div id="mylegend">loading……</div>
<script>
LInit(50,"mylegend",800,480,main);
//window.onload = function(){LInit(50, "mylegend", 800, 480, main, LEvent.INIT);};
function main(){
    alert("Hello lufylegend!");
}
</script>
</body>
</html>

removeChild

(
  • expression
)
public

Defined in main/Function.js:201

Available since 1.0.0

Stage インスタンスの子リストから指定の child DisplayObject インスタンスを削除します。

Parameters:

  • expression Object

    削除する DisplayObject インスタンスです。

Example:

var backLayer = LSprite();
addChild(backLayer);
removeChild(backLayer);

trace

(
  • expression
)
public

Defined in main/Function.js:161

Available since 1.0.0

Debugモード を使用すると、trace() 関数の出力を取得し、その結果を表示できます。trace ステートメント内の引数に String 以外のデータ型が含まれる場合、trace 関数はそのデータ型に関連した toString() メソッドを呼び出します。たとえば、引数がブール値の場合、trace 関数は Boolean.toString() を呼び出して戻り値を表示します。

Parameters:

  • expression Object

    評価する式。expression パラメータの値が [出力] パネルに表示されます。

Example:

trace("debug text 1", "debug text 2", "debug text 3");