本文整理汇总了Java中com.watabou.utils.SystemTime.now方法的典型用法代码示例。如果您正苦于以下问题:Java SystemTime.now方法的具体用法?Java SystemTime.now怎么用?Java SystemTime.now使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.watabou.utils.SystemTime
的用法示例。
在下文中一共展示了SystemTime.now方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onDrawFrame
import com.watabou.utils.SystemTime; //导入方法依赖的package包/类
@Override
public void onDrawFrame( GL10 gl ) {
if (width == 0 || height == 0) {
return;
}
SystemTime.tick();
long rightNow = SystemTime.now;
step = (now == 0 ? 0 : rightNow - now);
now = rightNow;
step();
NoosaScript.get().resetCamera();
NoosaScriptNoLighting.get().resetCamera();
GLES20.glDisable( GLES20.GL_SCISSOR_TEST );
GLES20.glClear( GLES20.GL_COLOR_BUFFER_BIT );
draw();
}
示例2: render
import com.watabou.utils.SystemTime; //导入方法依赖的package包/类
@Override
public void render() {
if (width == 0 || height == 0) {
return;
}
SystemTime.tick();
long rightNow = SystemTime.now;
step = (now == 0 ? 0 : rightNow - now);
now = rightNow;
step();
NoosaScript.get().resetCamera();
Gdx.gl.glScissor( 0, 0, width, height );
Gdx.gl.glClear( GL20.GL_COLOR_BUFFER_BIT );
draw();
}
示例3: onDrawFrame
import com.watabou.utils.SystemTime; //导入方法依赖的package包/类
@Override
public void onDrawFrame( GL10 gl ) {
if (width == 0 || height == 0) {
return;
}
SystemTime.tick();
long rightNow = SystemTime.now;
step = (now == 0 ? 0 : rightNow - now);
now = rightNow;
step();
NoosaScript.get().resetCamera();
GLES20.glScissor( 0, 0, width, height );
GLES20.glClear( GLES20.GL_COLOR_BUFFER_BIT );
draw();
}
示例4: render
import com.watabou.utils.SystemTime; //导入方法依赖的package包/类
@Override
public void render() {
if (width == 0 || height == 0) {
return;
}
SystemTime.tick();
long rightNow = SystemTime.now;
step = (now == 0 ? 0 : rightNow - now);
now = rightNow;
step();
NoosaScript.get().resetCamera();
Gdx.gl.glScissor(0, 0, width, height);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
draw();
}
示例5: onDrawFrame
import com.watabou.utils.SystemTime; //导入方法依赖的package包/类
@Override
public void onDrawFrame(GL10 gl) {
if (instance() == null || width() == 0 || height() == 0) {
return;
}
if(paused) {
GLES20.glScissor(0, 0, width(), height());
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
return;
}
SystemTime.tick();
long rightNow = SystemTime.now();
step = (now == 0 ? 0 : rightNow - now);
now = rightNow;
step();
NoosaScript.get().resetCamera();
GLES20.glScissor(0, 0, width(), height());
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
draw();
}
示例6: saveAll
import com.watabou.utils.SystemTime; //导入方法依赖的package包/类
public synchronized static void saveAll() {
if (SystemTime.now() - lastSaveTimestamp < 250) {
GLog.i("Saving too fast...");
return;
}
GLog.i("save time: %d", SystemTime.now());
lastSaveTimestamp = SystemTime.now();
FutureTask<Void> saveTask = new FutureTask<>(new Runnable() {
@Override
public void run() {
saveAllImpl();
}
}, null);
Game.instance().executor.execute(saveTask);
try {
saveTask.get();
} catch (Exception e) {
throw new TrackedRuntimeException(e);
}
}
示例7: render
import com.watabou.utils.SystemTime; //导入方法依赖的package包/类
@Override
public void render() {
if (width == 0 || height == 0) {
return;
}
SystemTime.tick();
long rightNow = SystemTime.now;
step = (now == 0 ? 0 : rightNow - now);
now = rightNow;
step();
NoosaScript.get().resetCamera();
NoosaScriptNoLighting.get().resetCamera();
Gdx.gl.glDisable( GL20.GL_SCISSOR_TEST );
Gdx.gl.glClear( GL20.GL_COLOR_BUFFER_BIT );
draw();
}
示例8: timeout
import com.watabou.utils.SystemTime; //导入方法依赖的package包/类
@Override
protected boolean timeout() {
//GLog.i("timeout: %d %d", SystemTime.now(),lastActionTime);
if (SystemTime.now() - SystemTime.getLastActionTime() > PixelDungeon.getMoveTimeout()) {
SystemTime.updateLastActionTime();
spend(TIME_TO_REST);
return true;
}
return false;
}
示例9: update
import com.watabou.utils.SystemTime; //导入方法依赖的package包/类
@Override
public void update() {
super.update();
if(SystemTime.now() - lastUpdatedTime > 1000) {
lastUpdatedTime = SystemTime.now();
updateStatus();
}
}