Documentation generator: JsDoc Toolkit 2.4.0
Template: Codeview 1.2
Generated on: 2016-0-4 21:22

Class enchant.box2d.PhySprite

Class Summary
Constructor Attributes Constructor Name and Description
 
enchant.box2d.PhySprite(width, height)
画像表示機能を持った物理シミュレーションクラス.
Field Summary
Field Attributes Field Name and Description
 
Spriteの角度 (度数法).
 
Spriteの角速度(単位はdeg/s).
 
Spriteの中心のx座標.
 
Spriteの中心のy座標.
 
Spriteの中心座標ベクトル.
 
物理シミュレーションされているか
 
Spriteのタイプ 静的(STATIC_SPRITE)か動的(DYNAMIC_SPRITE)か
 
Spriteの速度(単位はpx/s).
 
vx
Spriteのx座標の速度(単位はpx/s).
 
vy
Spriteのy座標の速度(単位はpx/s).
 
x
Spriteのx座標.
 
y
Spriteのy座標.
Fields borrowed from class enchant.Sprite:
frame, image
Fields borrowed from class enchant.Entity:
backgroundColor, buttonMode, buttonPressed, compositeOperation, debugColor, height, opacity, originX, originY, rotation, scaleX, scaleY, touchEnabled, visible, width
Fields borrowed from class enchant.Node:
age, parentNode, scene

Method Summary

Method Attributes Method Name and Description
 
applyForce(force)
継続的な力を加える
 
applyImpulse(impulse)
瞬間的な力を加える
 
applyTorque(torque)
継続的な回転力を与える
 
contact(func)
衝突判定
 
createPhyBox(staticOrDynamic, density, friction, restitution, isSleeping)
四角形の物理シミュレーション用Sprite生成.
 
createPhyCircle(staticOrDynamic, density, friction, restitution, isSleeping)
円形の物理シミュレーション用Sprite生成.
 
物体の削除 removeChildではなくこちらでSpriteを取り除く
 
setAwake(flag)
物理シミュレーションされていない時、物理シミュレーションを行う(sleep時は動かなくなるので)
Methods borrowed from class enchant.Entity:
disableCollection
enableCollection
intersect
rotate
scale
within
Methods borrowed from class enchant.Node:
moveBy
moveTo
Methods borrowed from class enchant.EventTarget:
addEventListener
clearEventListener
dispatchEvent
on
removeEventListener

Class Detail

enchant.box2d.PhySprite(width, height)
画像表示機能を持った物理シミュレーションクラス.
Parameters:
{Number} width Optional
Spriteの横幅.
{Number} height Optional
Spriteの高さ.

Field Detail

angle
Spriteの角度 (度数法)..
angularVelocity
Spriteの角速度(単位はdeg/s).
centerX
Spriteの中心のx座標.
centerY
Spriteの中心のy座標.
position
Spriteの中心座標ベクトル.
sleep
物理シミュレーションされているか
type
Spriteのタイプ 静的(STATIC_SPRITE)か動的(DYNAMIC_SPRITE)か
velocity
Spriteの速度(単位はpx/s).
vx
Spriteのx座標の速度(単位はpx/s).
vy
Spriteのy座標の速度(単位はpx/s).
x
Spriteのx座標.
y
Spriteのy座標.

Method Detail

  • applyForce(force)
    継続的な力を加える
    Parameters:
    {b2Vec2} force
    加える力のベクトル
  • applyImpulse(impulse)
    瞬間的な力を加える
    Parameters:
    {b2Vec2} impulse
    加える力のベクトル
  • applyTorque(torque)
    継続的な回転力を与える
    Parameters:
    {Number} torque
    加える回転力
  • contact(func)
    衝突判定
      //bearに当たったSpriteを消す
      bear.contact(function (sprite) {
         sprite.destroy();
      });
    Parameters:
    {function(sprite:enchant.box2d.PhySprite)} func Optional
    ぶつかったSpriteを引数とする関数
  • createPhyBox(staticOrDynamic, density, friction, restitution, isSleeping)
    四角形の物理シミュレーション用Sprite生成.
    Parameters:
    {Boolean} staticOrDynamic
    静止するか動くか.
    {Number} density
    Spriteの密度.
    {Number} friction
    Spriteの摩擦.
    {Number} restitution
    Spriteの反発.
    {Boolean} isSleeping
    Spriteが初めから物理演算を行うか.
  • createPhyCircle(staticOrDynamic, density, friction, restitution, isSleeping)
    円形の物理シミュレーション用Sprite生成.
    Parameters:
    {Boolean} staticOrDynamic
    静止するか動くか.
    {Number} density
    Spriteの密度.
    {Number} friction
    Spriteの摩擦.
    {Number} restitution
    Spriteの反発.
    {Boolean} isSleeping
    Spriteが初めから物理演算を行うか.
  • destroy()
    物体の削除 removeChildではなくこちらでSpriteを取り除く
  • setAwake(flag)
    物理シミュレーションされていない時、物理シミュレーションを行う(sleep時は動かなくなるので)
    Parameters:
    {Boolean} flag
    物理シミュレーションを行うかどうか