Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [...]
- public class EntityItem2D {
- [...]
- public EntityItem2D(String fileName, float posX, float posZ, int offsetX, int offsetZ) {
- Quad quad = new Quad(1, 1, false);
- Material mat = ResourceManager.createMaterial("Common/MatDefs/Misc/Unshaded.j3md");
- Texture2D texture = (Texture2D) ResourceManager.loadTexture("Textures/" + fileName);
- mat.setTexture("ColorMap", texture);
- mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
- geom = new Geometry("Quad", quad);
- geom.setMaterial(mat);
- geom.setLocalScale(texture.getImage().getWidth() * CameraController.UNITS_PER_PIXEL, texture.getImage().getHeight() * CameraController.UNITS_PER_PIXEL, 1f);
- geom.setLocalTranslation(offsetX, 0, offsetZ);
- geom.setQueueBucket(Bucket.Transparent);
- geom.addControl(new BillboardControl());
- node = new Node("ItemTest");
- node.setLocalTranslation(posX * MapChunk.TILE_UNITS, 0, posZ * MapChunk.TILE_UNITS);
- node.attachChild(geom);
- }
- [...]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement