Package gaiasky.scene.view
Class LabelView
java.lang.Object
gaiasky.scene.view.AbstractView
gaiasky.scene.view.BaseView
gaiasky.scene.view.RenderView
gaiasky.scene.view.LabelView
- All Implemented Interfaces:
I3DTextRenderable
,IRenderable
-
Field Summary
Modifier and TypeFieldDescriptionFields inherited from class gaiasky.scene.view.RenderView
extra, particleSet, starSet
Fields inherited from class gaiasky.scene.view.AbstractView
entity
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
protected void
Contains actions to take after a new entity has been set.protected void
entityCheck
(com.badlogic.ashley.core.Entity entity) Checks whether the given entity is suitable for this view.protected void
This method is called when the entity of this view is cleared.float
Gets the text opacityboolean
isLabel()
Is it a label or another kind of text?boolean
void
void
render
(ExtSpriteBatch batch, ExtShaderProgram shader, FontRenderSystem sys, RenderingContext rc, ICamera camera) Renders the textprotected void
render2DLabel
(ExtSpriteBatch batch, ExtShaderProgram shader, RenderingContext rc, BitmapFont font, ICamera camera, String label, float x, float y) protected void
render2DLabel
(ExtSpriteBatch batch, ExtShaderProgram shader, RenderingContext rc, BitmapFont font, ICamera camera, String label, float x, float y, float scale) protected void
render2DLabel
(ExtSpriteBatch batch, ExtShaderProgram shader, RenderingContext rc, BitmapFont font, ICamera camera, String label, float x, float y, float scale, int align) protected void
render2DLabel
(ExtSpriteBatch batch, ExtShaderProgram shader, RenderingContext rc, BitmapFont font, ICamera camera, String label, Vector3d pos3d) protected void
render3DLabel
(ExtSpriteBatch batch, ExtShaderProgram shader, BitmapFont font, ICamera camera, RenderingContext rc, String label, Vector3d pos, double distToCamera, float scale, double size, double radius, boolean forceLabel) protected void
render3DLabel
(ExtSpriteBatch batch, ExtShaderProgram shader, BitmapFont font, ICamera camera, RenderingContext rc, String label, Vector3d pos, double distToCamera, float scale, double size, double radius, float minSizeDegrees, float maxSizeDegrees, boolean forceLabel) boolean
Tells whether the text must be rendered or not for this entityboolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
text()
Returns the textvoid
Executes the blending for the textvoid
textPosition
(ICamera cam, Vector3d out) Text position for single objects (models, single stars, etc.).float
Returns the text scale for the scale varying in the shaderfloat
textSize()
Returns the text sizeMethods inherited from class gaiasky.scene.view.RenderView
getDistToCamera, getOpacity, getRadius, textColour, textColour
Methods inherited from class gaiasky.scene.view.BaseView
componentsCheck, getBase, getBody, getComponent, getComponentType, hasCt, isVisible, isVisible, setColor, setVisible, setVisible
Methods inherited from class gaiasky.scene.view.AbstractView
check, clearEntity, getEntity, isEmpty, isValid, setEntity
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface gaiasky.render.api.I3DTextRenderable
textColour
Methods inherited from interface gaiasky.render.api.IRenderable
getComponentType, getDistToCamera, getOpacity
-
Field Details
-
label
-
graph
-
sa
-
cluster
-
bbSet
-
constel
-
mesh
-
ruler
-
loc
-
-
Constructor Details
-
LabelView
public LabelView()
-
-
Method Details
-
entityCheck
protected void entityCheck(com.badlogic.ashley.core.Entity entity) Description copied from class:AbstractView
Checks whether the given entity is suitable for this view. This method should throw aRuntimeException
if the entity is not suitable.- Overrides:
entityCheck
in classBaseView
- Parameters:
entity
- The entity.
-
entityChanged
protected void entityChanged()Description copied from class:AbstractView
Contains actions to take after a new entity has been set. This method is typically used to initialize the view components.- Overrides:
entityChanged
in classRenderView
-
entityCleared
protected void entityCleared()Description copied from class:AbstractView
This method is called when the entity of this view is cleared. It should set all component references to null.- Overrides:
entityCleared
in classRenderView
-
renderTextCelestial
public boolean renderTextCelestial() -
renderTextParticle
public boolean renderTextParticle() -
renderTextLocation
public boolean renderTextLocation() -
renderTextKeyframe
public boolean renderTextKeyframe() -
renderTextRuler
public boolean renderTextRuler() -
renderTextBackgroundModel
public boolean renderTextBackgroundModel() -
renderTextTitle
public boolean renderTextTitle() -
renderTextTrajectory
public boolean renderTextTrajectory() -
renderTextGridRec
public boolean renderTextGridRec() -
renderTextEssential
public boolean renderTextEssential() -
renderTextBase
public boolean renderTextBase() -
renderText
public boolean renderText()Description copied from interface:I3DTextRenderable
Tells whether the text must be rendered or not for this entity- Specified by:
renderText
in interfaceI3DTextRenderable
- Returns:
- True if text must be rendered
-
render
public void render(ExtSpriteBatch batch, ExtShaderProgram shader, FontRenderSystem sys, RenderingContext rc, ICamera camera) Description copied from interface:I3DTextRenderable
Renders the text- Specified by:
render
in interfaceI3DTextRenderable
- Parameters:
batch
- The sprite batchshader
- The shadersys
- The font render systemrc
- The render contextcamera
- The camera
-
textSize
public float textSize()Description copied from interface:I3DTextRenderable
Returns the text size- Specified by:
textSize
in interfaceI3DTextRenderable
- Returns:
- The text size
-
textScale
public float textScale()Description copied from interface:I3DTextRenderable
Returns the text scale for the scale varying in the shader- Specified by:
textScale
in interfaceI3DTextRenderable
- Returns:
- The scale
-
textPosition
Text position for single objects (models, single stars, etc.).- Specified by:
textPosition
in interfaceI3DTextRenderable
- Parameters:
cam
- The camera.out
- The out parameter with the result.
-
text
Description copied from interface:I3DTextRenderable
Returns the text- Specified by:
text
in interfaceI3DTextRenderable
- Returns:
- The text
-
textDepthBuffer
public void textDepthBuffer()Description copied from interface:I3DTextRenderable
Executes the blending for the text- Specified by:
textDepthBuffer
in interfaceI3DTextRenderable
-
defaultTextDepthBuffer
public void defaultTextDepthBuffer() -
noTextDepthBuffer
public void noTextDepthBuffer() -
emptyTextDepthBuffer
public void emptyTextDepthBuffer() -
isLabel
public boolean isLabel()Description copied from interface:I3DTextRenderable
Is it a label or another kind of text?- Specified by:
isLabel
in interfaceI3DTextRenderable
- Returns:
- Whether this is a label
-
isLocation
public boolean isLocation() -
getTextOpacity
public float getTextOpacity()Description copied from interface:I3DTextRenderable
Gets the text opacity- Specified by:
getTextOpacity
in interfaceI3DTextRenderable
- Returns:
- Text opacity
-
render2DLabel
protected void render2DLabel(ExtSpriteBatch batch, ExtShaderProgram shader, RenderingContext rc, BitmapFont font, ICamera camera, String label, Vector3d pos3d) -
render2DLabel
protected void render2DLabel(ExtSpriteBatch batch, ExtShaderProgram shader, RenderingContext rc, BitmapFont font, ICamera camera, String label, float x, float y, float scale, int align) -
render2DLabel
protected void render2DLabel(ExtSpriteBatch batch, ExtShaderProgram shader, RenderingContext rc, BitmapFont font, ICamera camera, String label, float x, float y) -
render2DLabel
protected void render2DLabel(ExtSpriteBatch batch, ExtShaderProgram shader, RenderingContext rc, BitmapFont font, ICamera camera, String label, float x, float y, float scale) -
render3DLabel
protected void render3DLabel(ExtSpriteBatch batch, ExtShaderProgram shader, BitmapFont font, ICamera camera, RenderingContext rc, String label, Vector3d pos, double distToCamera, float scale, double size, double radius, boolean forceLabel) -
render3DLabel
protected void render3DLabel(ExtSpriteBatch batch, ExtShaderProgram shader, BitmapFont font, ICamera camera, RenderingContext rc, String label, Vector3d pos, double distToCamera, float scale, double size, double radius, float minSizeDegrees, float maxSizeDegrees, boolean forceLabel)
-