_Button.js |
ボタン情報を保持するオブジェクトです。
_USE_MOUSE | マウスイベントを使用します。 |
_USE_TOUCH | タッチイベントを使用します。 |
createButton |
createButton(parent,src,x,y,width,height)
イメージリソースから _Button オブジェクトを構築して表示します。
parent | 親の要素を指定します。 |
src | イメージリソースURL |
x | 親の要素からの相対X座標 |
y | 親の要素からの相対Y座標 |
width | ボタンの幅 |
height | ボタンの高さ |
戻り値:
構築された _Button オブジェクトを返します。
createButtonArea |
createButtonArea(parent,src,x,y,width,height,areaName,shape,coords)
イメージリソースから _Button オブジェクトを構築して表示します。
parent | 親の要素を指定します。 |
src | イメージリソースURL |
x | 親の要素からの相対X座標 |
y | 親の要素からの相対Y座標 |
width | ボタンの幅 |
height | ボタンの高さ |
areaName | 割り当てる一意のエリア名を指定します。 |
shape | 領域の形 |
coords | 領域の座標 |
戻り値:
構築された _Button オブジェクトを返します。
shape | coords |
"circle" | "中心X座標,中心Y座標,半径" |
"poly" | "X座標1,Y座標1,X座標2,Y座標2…" |
"rect" | "左上X座標,左上Y座標,右下X座標,右下Y座標" |
attachButton |
attachButton(parent,id,x,y,width,height)
<img> 要素から _Button オブジェクトを構築して表示します。
parent | 親の要素を指定します。 |
id | <img> 要素の id 属性 |
x | 親の要素からの相対X座標 |
y | 親の要素からの相対Y座標 |
width | ボタンの幅 |
height | ボタンの高さ |
戻り値:
構築された _Button オブジェクトを返します。
attachButtonArea |
attachButtonArea(parent,id,x,y,width,height,areaId)
イメージマップの定義が関連付けられた <img> 要素から _Button オブジェクトを構築して表示します。
parent | 親の要素を指定します。 |
id | <img> 要素の id 属性 |
x | 親の要素からの相対X座標 |
y | 親の要素からの相対Y座標 |
width | ボタンの幅 |
height | ボタンの高さ |
areaId | <area> 要素の id 属性 |
戻り値:
構築された _Button オブジェクトを返します。
removeButton |
removeButton(button)
ボタンを削除します。
button | _Button オブジェクト |
補足説明:
createButton()/createButtonArea() で構築されたボタンのみ有効です。
buttonElement |
buttonElement(button)
_Button オブジェクトの要素を取得します。
button | _Button オブジェクト |
戻り値:
_Button オブジェクトの要素を返します。
buttonX |
buttonX(button)
親の要素からの相対X座標を取得します。
button | _Button オブジェクト |
戻り値:
親の要素からの相対X座標を返します。
buttonY |
buttonY(button)
親の要素からの相対Y座標を取得します。
button | _Button オブジェクト |
戻り値:
親の要素からの相対Y座標を返します。
buttonWidth |
buttonWidth(button)
ボタンの幅を取得します。
button | _Button オブジェクト |
戻り値:
ボタンの幅を返します。
buttonHeight |
buttonHeight(button)
ボタンの高さを取得します。
button | _Button オブジェクト |
戻り値:
ボタンの高さを返します。
setButtonSrc |
setButtonSrc(button,src)
イメージリソースを差し替えます。
button | _Button オブジェクト |
src | 新しいイメージリソースURL |
setButtonX |
setButtonX(button,x)
ボタンのX座標を変更します。
button | _Button オブジェクト |
x | 親の要素からの相対X座標 |
setButtonY |
setButtonY(button,y)
ボタンのY座標を変更します。
button | _Button オブジェクト |
y | 親の要素からの相対Y座標 |
setButtonPos |
setButtonPos(button,x,y)
ボタンの位置を変更します。
button | _Button オブジェクト |
x | 親の要素からの相対X座標 |
y | 親の要素からの相対Y座標 |
setButtonWidth |
setButtonWidth(button,width)
ボタンの幅を変更します。
button | _Button オブジェクト |
width | ボタンの幅 |
setButtonHeight |
setButtonHeight(button,height)
ボタンの高さを変更します。
button | _Button オブジェクト |
height | ボタンの高さ |
setButtonSize |
setButtonSize(button,width,height)
ボタンの大きさを変更します。
button | _Button オブジェクト |
width | ボタンの幅 |
height | ボタンの高さ |
setButtonPosSize |
setButtonPosSize(button,x,y,width,height)
ボタンの位置と大きさを変更します。
button | _Button オブジェクト |
x | 親の要素からの相対X座標 |
y | 親の要素からの相対Y座標 |
width | ボタンの幅 |
height | ボタンの高さ |
updateButtonPos |
updateButtonPos(button)
親の要素のブラウザ画面内での座標が変更されたことを、ボタンに反映させます。
button | _Button オブジェクト |
setButtonArea |
setButtonArea(button,shape,coords)
領域を変更します。
button | _Button オブジェクト |
shape | 領域の形 |
coords | 領域の座標 |
shape | coords |
"circle" | "中心X座標,中心Y座標,半径" |
"poly" | "X座標1,Y座標1,X座標2,Y座標2…" |
"rect" | "左上X座標,左上Y座標,右下X座標,右下Y座標" |