Cocos2D開發Math類中常用函數

cocos2d-js中Math對象的常用方法總結     1.丟棄小數部分,保留整數部分 parseInt(5/2) 2.向上取整,有小數就整數部分加1 Math.ceil(5/2) 3,四捨五入. Math.round(5/2) 4,向下取整 Math.floor(5/2) 二、Math 對象的方法 1. Math.abs(num) : 返回num的絕對值2. Math.acos(num) :
相關文章
相關標籤/搜索