本文整理汇总了Java中com.b3dgs.lionengine.Viewer类的典型用法代码示例。如果您正苦于以下问题:Java Viewer类的具体用法?Java Viewer怎么用?Java Viewer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Viewer类属于com.b3dgs.lionengine包,在下文中一共展示了Viewer类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Entity
import com.b3dgs.lionengine.Viewer; //导入依赖的package包/类
/**
* Create an entity.
*
* @param services The services reference.
* @param setup The setup used.
* @throws LionEngineException If error.
*/
public Entity(Services services, SetupSurfaceRastered setup)
{
super();
final FramesConfig frames = FramesConfig.imports(setup);
surface = Drawable.loadSpriteAnimated(setup.getSurface(), frames.getHorizontal(), frames.getVertical());
tileCollidable = addFeatureAndGet(new TileCollidableModel(services, setup));
body.setMass(2.0);
body.setGravityMax(7.0);
body.setDesiredFps(60);
body.setVectors(movement, jump);
viewer = services.get(Viewer.class);
StateAnimationBased.Util.loadStates(EntityState.values(), stateFactory, this, setup);
stateHandler.addInput(getInput());
stateHandler.changeState(EntityState.IDLE);
}
示例2: Effect
import com.b3dgs.lionengine.Viewer; //导入依赖的package包/类
/**
* Create an effect.
*
* @param services The services reference.
* @param setup The setup reference.
*/
public Effect(Services services, Setup setup)
{
super(services, setup);
viewer = services.get(Viewer.class);
addFeature(new Recycler());
addFeature(new LayerableModel(Constant.LAYER_EFFECT));
transformable = addFeatureAndGet(new TransformableModel(setup));
final EffectModel model = addFeatureAndGet(new EffectModel(setup));
addFeature(new EffectUpdater(services, model));
addFeature(new EffectRenderer(model));
anim = AnimationConfig.imports(setup).getAnimation("start");
surface = model.getSurface();
}
示例3: MarioRenderer
import com.b3dgs.lionengine.Viewer; //导入依赖的package包/类
/**
* Constructor.
*
* @param services The services reference.
* @param model The model reference.
*/
public MarioRenderer(Services services, MarioModel model)
{
super();
viewer = services.get(Viewer.class);
surface = model.getSurface();
}
示例4: EntityRenderer
import com.b3dgs.lionengine.Viewer; //导入依赖的package包/类
/**
* Create an entity renderer.
*
* @param services The services reference.
*/
EntityRenderer(Services services)
{
super();
viewer = services.get(Viewer.class);
}
示例5: Ship
import com.b3dgs.lionengine.Viewer; //导入依赖的package包/类
/**
* Create ship.
*
* @param services The services reference.
* @param setup The setup reference.
*/
public Ship(Services services, Setup setup)
{
super();
this.services = services;
viewer = services.get(Viewer.class);
y = UtilRandom.getRandomInteger(RANDOM_Y);
follow = UtilRandom.getRandomBoolean();
}
示例6: ShipRenderer
import com.b3dgs.lionengine.Viewer; //导入依赖的package包/类
/**
* Create a ship renderer.
*
* @param services The services reference.
* @param setup The setup reference.
*/
ShipRenderer(Services services, Setup setup)
{
super();
context = services.get(Context.class);
viewer = services.get(Viewer.class);
}
示例7: Hud
import com.b3dgs.lionengine.Viewer; //导入依赖的package包/类
/**
* Create HUD.
*
* @param services The services reference.
*/
public Hud(Services services)
{
super();
camera = services.get(Camera.class);
map = services.get(MapTile.class);
surface.load();
surface.prepare();
surface.setLocation(0.0, services.get(Viewer.class).getHeight() - surface.getHeight());
shipUpdater = services.get(ShipUpdater.class);
ship = shipUpdater.getFeature(ShipModel.class);
shield.setLocation(4, 305);
shield.setColor(ColorRgba.BLACK, ColorRgba.BLUE);
armor.setLocation(4, 342);
armor.setColor(ColorRgba.BLACK, BROWN);
energy.setLocation(100, 303);
energy.setColorBackground(ColorRgba.BLACK);
energy.setColorGradient(ColorRgba.RED, ColorRgba.YELLOW);
levelFront.setLocation(190, 319);
levelFront.setColorBackground(ColorRgba.BLACK);
levelFront.setColorGradient(ColorRgba.YELLOW, ColorRgba.RED);
levelRear.setLocation(190, 335);
levelRear.setColorBackground(ColorRgba.BLACK);
levelRear.setColorGradient(ColorRgba.YELLOW, ColorRgba.RED);
progress.setLocation(73, 302);
progress.setColorGradient(ColorRgba.GREEN, ColorRgba.RED);
}
示例8: EffectUpdater
import com.b3dgs.lionengine.Viewer; //导入依赖的package包/类
/**
* Create an effect updater.
*
* @param services The services reference.
* @param model The model reference.
*/
EffectUpdater(Services services, EffectModel model)
{
super();
viewer = services.get(Viewer.class);
surface = model.getSurface();
}
示例9: ProjectileUpdater
import com.b3dgs.lionengine.Viewer; //导入依赖的package包/类
/**
* Create a projectile updater.
*
* @param services The services reference.
* @param model The model reference.
*/
ProjectileUpdater(Services services, ProjectileModel model)
{
super();
context = services.get(Context.class);
factory = services.get(Factory.class);
handler = services.get(Handler.class);
viewer = services.get(Viewer.class);
surface = model.getSurface();
effectRate = model.getEffectRate();
effectMedia = model.getEffectMedia();
acceleration = model.getAcceleration();
}
示例10: BuildButton
import com.b3dgs.lionengine.Viewer; //导入依赖的package包/类
/**
* Create build button action.
*
* @param services The services reference.
* @param setup The setup reference.
*/
public BuildButton(Services services, Setup setup)
{
super(services, setup);
factory = services.get(Factory.class);
viewer = services.get(Viewer.class);
selector = services.get(Selector.class);
map = services.get(MapTile.class);
target = Medias.create(setup.getText("media").split("/"));
}