UIDummy is now an abstract class
This commit is contained in:
parent
eaeb8ccee7
commit
9ebf04338e
@ -1,6 +1,11 @@
|
||||
package engine.gui;
|
||||
|
||||
public class UIDummy {
|
||||
/**
|
||||
* Classe dont hérite tous les autres élements d'interface
|
||||
*/
|
||||
public abstract class UIDummy {
|
||||
|
||||
protected float scalingFactor;
|
||||
|
||||
public void init(){
|
||||
}
|
||||
@ -8,7 +13,12 @@ public class UIDummy {
|
||||
private void getObjInPosition(){
|
||||
}
|
||||
|
||||
/**
|
||||
* Method pour le moteur ne pas utiliser
|
||||
* @param scaleFactor
|
||||
*/
|
||||
public void updateScalingFactor(float scaleFactor){
|
||||
this.scalingFactor *= scaleFactor;
|
||||
}
|
||||
|
||||
public void update(){
|
||||
|
@ -6,12 +6,14 @@ import engine.math.Vector3f;
|
||||
import engine.object.Camera;
|
||||
import engine.object.ObjectGl;
|
||||
|
||||
/**
|
||||
* Affiche un seul ObjectGl le lie à une position dans la zone de projection
|
||||
*/
|
||||
public class UIElement extends UIDummy{
|
||||
|
||||
private final ObjectGl obj;
|
||||
private final Engine engine;
|
||||
private final Camera camera;
|
||||
private float scalingFactor;
|
||||
private float xPos;
|
||||
private float yPos;
|
||||
private float zPos;
|
||||
@ -52,10 +54,6 @@ public class UIElement extends UIDummy{
|
||||
obj.translate(new Vector3f(- engine.transformationView.x, engine.transformationView.y));
|
||||
}
|
||||
|
||||
public void updateScalingFactor(float scaleFactor){
|
||||
this.scalingFactor *= scaleFactor;
|
||||
}
|
||||
|
||||
public void update(){
|
||||
this.getObjInPosition();
|
||||
}
|
||||
|
@ -10,13 +10,15 @@ import engine.object.Text;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Affiche du texte le lie à une position dans la zone de projection
|
||||
*/
|
||||
public class UIElementText extends UIDummy{
|
||||
|
||||
private final List<ObjectGl> objs;
|
||||
private final Engine engine;
|
||||
private final Camera camera;
|
||||
private final Text txt;
|
||||
private float scalingFactor;
|
||||
private float xPos;
|
||||
private float yPos;
|
||||
private float zPos;
|
||||
@ -40,10 +42,17 @@ public class UIElementText extends UIDummy{
|
||||
this.getObjInPosition();
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajouter l'element à la liste de rendu du moteur dont il est lié.
|
||||
*/
|
||||
public void init(){
|
||||
this.engine.add_objectsGl(objs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Modifier le texte
|
||||
* @param txt le nouveau texte
|
||||
*/
|
||||
public void setText(String txt){
|
||||
this.txt.setNewText(txt);
|
||||
}
|
||||
@ -66,10 +75,6 @@ public class UIElementText extends UIDummy{
|
||||
}
|
||||
}
|
||||
|
||||
public void updateScalingFactor(float scaleFactor){
|
||||
this.scalingFactor *= scaleFactor;
|
||||
}
|
||||
|
||||
public void update(){
|
||||
this.getObjInPosition();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user