当前位置: 首页>>代码示例>>Java>>正文


Java Viewer类代码示例

本文整理汇总了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);
}
 
开发者ID:b3dgs,项目名称:lionheart-remake,代码行数:29,代码来源:Entity.java

示例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();
}
 
开发者ID:b3dgs,项目名称:tyrian-remake,代码行数:24,代码来源:Effect.java

示例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();
}
 
开发者ID:b3dgs,项目名称:lionheart-remake,代码行数:14,代码来源:MarioRenderer.java

示例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);
}
 
开发者ID:b3dgs,项目名称:tyrian-remake,代码行数:12,代码来源:EntityRenderer.java

示例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();
}
 
开发者ID:b3dgs,项目名称:tyrian-remake,代码行数:17,代码来源:Ship.java

示例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);
}
 
开发者ID:b3dgs,项目名称:tyrian-remake,代码行数:14,代码来源:ShipRenderer.java

示例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);
}
 
开发者ID:b3dgs,项目名称:tyrian-remake,代码行数:41,代码来源:Hud.java

示例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();
}
 
开发者ID:b3dgs,项目名称:tyrian-remake,代码行数:14,代码来源:EffectUpdater.java

示例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();
}
 
开发者ID:b3dgs,项目名称:tyrian-remake,代码行数:21,代码来源:ProjectileUpdater.java

示例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("/"));
}
 
开发者ID:b3dgs,项目名称:warcraft-remake,代码行数:18,代码来源:BuildButton.java


注:本文中的com.b3dgs.lionengine.Viewer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。