本文整理汇总了Java中jgame.impl.JGEngineInterface类的典型用法代码示例。如果您正苦于以下问题:Java JGEngineInterface类的具体用法?Java JGEngineInterface怎么用?Java JGEngineInterface使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JGEngineInterface类属于jgame.impl包,在下文中一共展示了JGEngineInterface类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setEngine
import jgame.impl.JGEngineInterface; //导入依赖的package包/类
/** Set the engine to connect to when a new object is created. This
* should be called only by the JGEngine implementation.
* @param engine pass null to indicate the engine has exited.
* @return true if success; false if other engine already running. */
public static boolean setEngine(JGEngineInterface engine) {
if (engine==null) {
default_engine=null;
return true;
}
if (default_engine!=null) return false;
default_engine=engine;
// copy some constants from engine for fast access
viewwidth=engine.viewWidth();
viewheight=engine.viewHeight();
tilewidth=engine.tileWidth();
tileheight=engine.tileHeight();
updateEngineSettings();
return true;
}
示例2: initObject
import jgame.impl.JGEngineInterface; //导入依赖的package包/类
private void initObject(JGEngineInterface engine,
String name,int collisionid) {
this.eng=engine;
this.name=name;
colid=collisionid;
// XXX the test on suspend should really be done after the
// constructor of the subclass is finished, in case the position is
// changed later in the constructor.
if ((int)expiry==suspend_off_view
|| (int)expiry==suspend_off_view_expire_off_pf) {
if (!isInView(eng.getOffscreenMarginX(),eng.getOffscreenMarginY()))
suspend();
}
eng.markAddObject(this);
}