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


Java Decal.newDecal方法代码示例

本文整理汇总了Java中com.badlogic.gdx.graphics.g3d.decals.Decal.newDecal方法的典型用法代码示例。如果您正苦于以下问题:Java Decal.newDecal方法的具体用法?Java Decal.newDecal怎么用?Java Decal.newDecal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.badlogic.gdx.graphics.g3d.decals.Decal的用法示例。


在下文中一共展示了Decal.newDecal方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addBackground

import com.badlogic.gdx.graphics.g3d.decals.Decal; //导入方法依赖的package包/类
private void addBackground(){
        decalBackground = Decal.newDecal(new TextureRegion(managerAssets.getAssetsCrafting().getTexture(NameFiles.backgroundCrafting)));
        decalBackground.setDimensions(100,200);
        decalBackground.setPosition(0,0,0);
        environment = new Environment();
//        environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 1f, 1f, 1f, 1f));
        environment.set(new ColorAttribute(ColorAttribute.Diffuse));
        environment.set(new ColorAttribute(ColorAttribute.Specular));
        environment.set(new ColorAttribute(ColorAttribute.Reflection));
        environment.add(new DirectionalLight().set(0.51f, 0.5f, 0.5f, 0f, -2f, -30f));
        Model model = managerAssets.getAssetsRaider().getModel(NameFiles.raiderFull);
        model.nodes.get(2).translation.set(-12,28.6f,-5.5f);
//        model.nodes.get(0).translation.set(0,28f,29.2f);
//        model.nodes.get(2).translation.set(0,13,-1);
        instance = new ModelInstance(model);
        instance.transform.trn(0,-20,25).rotate(0,1,0,-25);
        instance.transform.scale(1.5f,1.5f,1.5f);
    }
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:19,代码来源:ScreenRaider.java

示例2: inserted

import com.badlogic.gdx.graphics.g3d.decals.Decal; //导入方法依赖的package包/类
@Override
public void inserted(int entityId, RenderSystem renderSystem) {
    RenderComponent render = renderSystem.getMapperRender().get(entityId);
    PositionComponent position = renderSystem.getMapperPosition().get(entityId);
    if (render.animations.size == 0) {
        for (Map.Entry<String, RenderComponent.RenderTemplate.AnimationTemplate> entry : render.renderTemplate.animationTemplates.entrySet()) {
            TextureRegion texture = renderSystem.getLevelAssets().get(entry.getValue().texture);

            TextureRegion[][] tmp = texture.split(
                    +texture.getRegionWidth() / entry.getValue().frameColumns,
                    +texture.getRegionHeight() / entry.getValue().frameRows);
            TextureRegion[] frames = new TextureRegion[entry.getValue().frameColumns * entry.getValue().frameRows];
            int index = 0;
            for (int i = 0; i < entry.getValue().frameRows; i++) {
                for (int j = 0; j < entry.getValue().frameColumns; j++) {
                    frames[index++] = tmp[i][j];
                }
            }
            render.animations.put(entry.getKey(), new Animation<TextureRegion>(entry.getValue().frameDuration, new Array<>(frames), Animation.PlayMode.LOOP));
        }
    }
    Decal decal = Decal.newDecal(render.width, render.height, render.getCurrentKeyFrame(renderSystem.getStateTime()), render.transparent);
    decal.rotateX(renderSystem.getWorldDegree());
    decal.setPosition(position.position.x, position.position.y, 0);
    renderSystem.getDecalMap().put(entityId, decal);
}
 
开发者ID:EtherWorks,项目名称:arcadelegends-gg,代码行数:27,代码来源:BulletRenderer.java

示例3: LayeredEntity

import com.badlogic.gdx.graphics.g3d.decals.Decal; //导入方法依赖的package包/类
public LayeredEntity(float x, float y, float z, String texturePath, int numberOfLayers){
	setPosition(x,y,z);
	this.numberOfLayers = numberOfLayers;
	
	tag = "";
	
	decalList = new ArrayList<Decal>();
	Texture t = MyGdxGame.assetManager.get(texturePath, Texture.class);
	width = t.getWidth() / numberOfLayers;
	depth = t.getHeight();
	height = numberOfLayers;
	TextureRegion tr = new TextureRegion(t);
	for(int i = 0; i < numberOfLayers; i++){
		tr.setRegion(i * width, 0, width, depth);
		Decal decal = Decal.newDecal(tr, true);
		decal.setPosition(x, y + i * LAYER_SIZE, z);
		decal.rotateX(-90);
		decalList.add(decal);
	}
	velocity = new Vector3();
	maxVelocity = new Vector3();
	drag = new Vector3();
	
}
 
开发者ID:MisterYO1122,项目名称:utilsLibGDX,代码行数:25,代码来源:LayeredEntity.java

示例4: addMap

import com.badlogic.gdx.graphics.g3d.decals.Decal; //导入方法依赖的package包/类
private void addMap() {
    MapPixmap imagesmap = MapPixmap.getInstance();
    extendmaps = new Decal[9];
    int k = 0;
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
            extendmaps[k] = Decal.newDecal(new TextureRegion(new Texture(imagesmap.getImage(i, j))));
            extendmaps[k].setDimensions((HEIGHT*0.3125f), (HEIGHT*0.3125f));
            k++;
        }
    }
    repositionEnklave();
    queueDisplay = QueueDisplay.getInstance();
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:15,代码来源:ScreenEnklave.java

示例5: addimagebg

import com.badlogic.gdx.graphics.g3d.decals.Decal; //导入方法依赖的package包/类
private void addimagebg(){
    MapPixmap imageBG = MapPixmap.getInstance();
    decalBackground = Decal.newDecal(new TextureRegion(new Texture(imageBG.getImage(1,1))));
    decalBackground.setPosition(0, 0, 0);
    decalBackground.setDimensions(Gdx.graphics.getHeight() * 0.3125f, Gdx.graphics.getHeight() * 0.3125f);
    decalBackground.setBlending(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:8,代码来源:ScreenRooms.java

示例6: drawProfile

import com.badlogic.gdx.graphics.g3d.decals.Decal; //导入方法依赖的package包/类
private void drawProfile() {
    environment = new Environment();
    environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 1f, 1f, 1f, 1f));
    environment.add(new DirectionalLight().set(1f, 1f, 1f, 1f, 1f, 1f));
    Model model = managerAssets.getAssetsProfile().getModel(NameFiles.profileObject);
    model.nodes.get(2).translation.set(0,-14.5f,9);
    instance = new ModelInstance(model);
    instance.transform.scale(0.2f,0.2f,0.2f);
    instance.transform.trn(0,-8f,27).rotate(0,1,0,55);
    decalBackground = Decal.newDecal(new TextureRegion(managerAssets.getAssetsCrafting().getTexture(NameFiles.backgroundCrafting)));
    decalBackground.setDimensions(75,150);
    decalBackground.setPosition(0,0,0);
    queueDisplay = QueueDisplay.getInstance();
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:15,代码来源:ScreenProfile.java

示例7: drawmap

import com.badlogic.gdx.graphics.g3d.decals.Decal; //导入方法依赖的package包/类
private void drawmap() {
    MapPixmap imageBG = MapPixmap.getInstance();
    decalBackground = Decal.newDecal(new TextureRegion(new Texture(imageBG.getImage(1, 1))));
    decalBackground.setPosition(0, 0, 0);
    decalBackground.setDimensions(800, 800);
    decalBackground.setBlending(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
    Texture text = null;
    groupCenter = new Group();
    switch (InformationEnklave.getInstance().getFaction()){
        case 1:{
            text = managerAssets.getAssetsCombat().getTexture(NameFiles.enklavered);
            break;
        }
        case 2:{
            text = managerAssets.getAssetsCombat().getTexture(NameFiles.enklaveblue);
            break;
        }
        case 3:{
            text = managerAssets.getAssetsCombat().getTexture(NameFiles.enklavegreen);
            break;
        }
    }

    Vector2 crop = Scaling.fit.apply(text.getWidth(),text.getHeight(),WIDTH,HEIGHT);
    Image enklave = new Image(new TextureRegion(text));
    enklave.setSize(crop.x*0.6f,crop.y*0.6f);
    enklave.setPosition(WIDTH / 2 - enklave.getWidth() / 2, HEIGHT / 2 - enklave.getHeight() / 1.7F);
    groupCenter.addActor(enklave);
    labelDistance = new Label("Distance: ",new Label.LabelStyle(Font.getFont((int)(HEIGHT*0.025f)),Color.ORANGE));
    groupCenter.addActor(labelDistance);
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:32,代码来源:ScreenCombat.java

示例8: ExtentMap

import com.badlogic.gdx.graphics.g3d.decals.Decal; //导入方法依赖的package包/类
private void ExtentMap() {
    int k =0;
    for(int i=0;i<3;i++) {
        for (int j = 0; j < 3; j++) {
            extendmaps[k] = Decal.newDecal(new TextureRegion(new Texture(matrixPixmap.getImage(i,j))));
            extendmaps[k].setPosition(pos[i][j].x, pos[i][j].y, 0);
            extendmaps[k].setDimensions(600, 600);
            k++;
        }
    }
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:12,代码来源:MapsScreen.java

示例9: addDecal

import com.badlogic.gdx.graphics.g3d.decals.Decal; //导入方法依赖的package包/类
public void addDecal(TextureRegion texture, int w, int h, Vector3 worldPos, Vector3 normal, int life) {
    Decal decal = Decal.newDecal(w, h, texture, true);
    decal.value = life;
    decal.setScale(.1f);
    decal.setPosition(worldPos.add(normal.nor().scl(.001f)));
    decal.lookAt(worldPos.add(normal), Vector3.Zero);
    decals.add(decal);
    decalLife.put(decal, 0f);
}
 
开发者ID:ncguy2,项目名称:Argent,代码行数:10,代码来源:DecalManager.java

示例10: create

import com.badlogic.gdx.graphics.g3d.decals.Decal; //导入方法依赖的package包/类
public void create () {
	float width = Gdx.graphics.getWidth();
	float height = Gdx.graphics.getHeight();

	camera = new PerspectiveCamera(45, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
	camera.near = 1;
	camera.far = 300;
	camera.position.set(0, 0, 5);
	controller = new PerspectiveCamController(camera);

	Gdx.input.setInputProcessor(controller);
	batch = new DecalBatch(new CameraGroupStrategy(camera));

	TextureRegion[] textures = {new TextureRegion(new Texture(Gdx.files.internal("data/egg.png"))),
		new TextureRegion(new Texture(Gdx.files.internal("data/wheel.png"))),
		new TextureRegion(new Texture(Gdx.files.internal("data/badlogic.jpg")))};

	Decal decal = Decal.newDecal(1, 1, textures[1]);
	decal.setPosition(0, 0, 0);
	decals.add(decal);

	decal = Decal.newDecal(1, 1, textures[0], true);
	decal.setPosition(0.5f, 0.5f, 1);
	decals.add(decal);

	decal = Decal.newDecal(1, 1, textures[0], true);
	decal.setPosition(1, 1, -1);
	decals.add(decal);

	decal = Decal.newDecal(1, 1, textures[2]);
	decal.setPosition(1.5f, 1.5f, -2);
	decals.add(decal);

	decal = Decal.newDecal(1, 1, textures[1]);
	decal.setPosition(2, 2, -1.5f);
	decals.add(decal);
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:38,代码来源:SimpleDecalTest.java

示例11: makeDecal

import com.badlogic.gdx.graphics.g3d.decals.Decal; //导入方法依赖的package包/类
private Decal makeDecal () {
	Decal sprite = null;
	switch (idx % 2) {
	case 0:
		sprite = Decal.newDecal(new TextureRegion(egg), willItBlend_that_is_the_question);
		break;
	case 1:
		sprite = Decal.newDecal(new TextureRegion(wheel));
		break;
	}
	sprite.setPosition(-w / 2 + (float)Math.random() * w, h / 2 - (float)Math.random() * h, (float)-Math.random() * 10);
	idx++;
	return sprite;
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:15,代码来源:DecalTest.java

示例12: doneLoading

import com.badlogic.gdx.graphics.g3d.decals.Decal; //导入方法依赖的package包/类
/**
 * Constructs the interface
 */
public void doneLoading(AssetManager assetManager) {
    skin = GlobalResources.skin;

    aiTexture = assetManager.get("data/tex/attitudeindicator.png", Texture.class);
    aiTexture.setFilter(TextureFilter.Linear, TextureFilter.Linear);
    aiPointerTexture = assetManager.get("img/ai-pointer.png", Texture.class);
    aiPointerTexture.setFilter(TextureFilter.Linear, TextureFilter.Linear);

    aiVelTex = assetManager.get("img/ai-vel.png", Texture.class);
    aiVelTex.setFilter(TextureFilter.Linear, TextureFilter.Linear);
    aiAntivelTex = assetManager.get("img/ai-antivel.png", Texture.class);
    aiAntivelTex.setFilter(TextureFilter.Linear, TextureFilter.Linear);

    aiVelDec = Decal.newDecal(new TextureRegion(aiVelTex));
    aiAntivelDec = Decal.newDecal(new TextureRegion(aiAntivelTex));

    Material mat = new Material(new TextureAttribute(TextureAttribute.Diffuse, aiTexture), new ColorAttribute(ColorAttribute.Specular, 0.3f, 0.3f, 0.3f, 1f));
    aiModel = new ModelBuilder2().createSphere(1 * GlobalConf.SCALE_FACTOR, 30, 30, false, mat, Usage.Position | Usage.Normal | Usage.TextureCoordinates);
    aiTransform = new Matrix4();
    aiModelInstance = new ModelInstance(aiModel, aiTransform);
    aiViewport = new ExtendViewport(indicatorw, indicatorh, aiCam);

    buildGui();

    EventManager.instance.subscribe(this, Events.SPACECRAFT_STABILISE_CMD, Events.SPACECRAFT_STOP_CMD, Events.SPACECRAFT_INFO, Events.SPACECRAFT_NEAREST_INFO, Events.SPACECRAFT_THRUST_INFO);
    EventManager.instance.unsubscribe(this, Events.SPACECRAFT_LOADED);

}
 
开发者ID:langurmonkey,项目名称:gaiasky,代码行数:32,代码来源:SpacecraftGui.java

示例13: sonarDecal

import com.badlogic.gdx.graphics.g3d.decals.Decal; //导入方法依赖的package包/类
public Decal sonarDecal() {
  Decal decal = Decal.newDecal(this.effectsAtlas.findRegion("sonar_ping"), true);
  decal.setWidth(1);
  decal.setHeight(1);
  decal.rotateX(90);
  return decal;
}
 
开发者ID:macbury,项目名称:BotLogic,代码行数:8,代码来源:SpritesManager.java

示例14: addPuls

import com.badlogic.gdx.graphics.g3d.decals.Decal; //导入方法依赖的package包/类
public void addPuls(){
    pulsImage = Decal.newDecal(new TextureRegion(manager.getAssetsExtension().getTexture(NameFiles.imagePulse)));
    pulsImage.setDimensions(Gdx.graphics.getHeight()*0.0104f, Gdx.graphics.getHeight()*0.0104f);
    pulsImage.setPosition(0, 0, Gdx.graphics.getHeight()*0.001f);
    pulsImage.setBlending(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:7,代码来源:ScreenExtensions.java

示例15: addPuls

import com.badlogic.gdx.graphics.g3d.decals.Decal; //导入方法依赖的package包/类
public void addPuls(){
    pulsImage = Decal.newDecal(new TextureRegion(manager.getAssetsRooms().getTexture(NameFiles.imagePulse)));
    pulsImage.setDimensions(Gdx.graphics.getHeight()*0.0104f, Gdx.graphics.getHeight()*0.0104f);
    pulsImage.setPosition(0, 0, 3);
    pulsImage.setBlending(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:7,代码来源:ScreenRooms.java


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