36 lines
809 B
Java
36 lines
809 B
Java
|
package engine.object;
|
||
|
|
||
|
import engine.Engine;
|
||
|
import engine.math.Vector3f;
|
||
|
|
||
|
import java.util.ArrayList;
|
||
|
import java.util.List;
|
||
|
import java.util.Objects;
|
||
|
|
||
|
public class UIElement {
|
||
|
|
||
|
private List<ObjectGl> objs;
|
||
|
private Engine engine;
|
||
|
|
||
|
public UIElement(List<ObjectGl> objs, Engine engine){
|
||
|
this.objs = new ArrayList<>();
|
||
|
this.objs.addAll(objs);
|
||
|
this.engine = engine;
|
||
|
}
|
||
|
|
||
|
public void addObj(ObjectGl obj){
|
||
|
this.objs.add(obj);
|
||
|
}
|
||
|
|
||
|
public void addObj(List<ObjectGl> objs){
|
||
|
this.objs.addAll(objs);
|
||
|
}
|
||
|
|
||
|
public void update(){
|
||
|
for (ObjectGl obj : this.objs){
|
||
|
obj.translate(new Vector3f(-engine.transformationView.x, engine.transformationView.y)); // Tous les elmts font le même déplacement que la caméra
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|