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
Contains the actual implementation of label rendering for different object types.
-
Field Summary
FieldsModifier and TypeFieldDescriptionFields inherited from class RenderView
extra, particleSet, starSetModifier and TypeFieldDescriptionParticle component, maybe.Particle set componentStar set componentFields inherited from class AbstractView
entityModifier and TypeFieldDescriptionprotected com.badlogic.ashley.core.EntityA reference to the entity. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidprotected voidContains actions to take after a new entity has been set.protected voidentityCheck(com.badlogic.ashley.core.Entity entity) Checks whether the given entity is suitable for this view.protected voidThis method is called when the entity of this view is cleared.floatGets the text opacitybooleanisLabel()Is it a label or another kind of text?booleanvoidvoidrender(ExtSpriteBatch batch, ExtShaderProgram shader, TextRenderer sys, RenderingContext rc, ICamera camera) Renders the textprotected voidrender2DLabel(ExtSpriteBatch batch, ExtShaderProgram shader, RenderingContext rc, BitmapFont font, ICamera camera, String label, float x, float y) protected voidrender2DLabel(ExtSpriteBatch batch, ExtShaderProgram shader, RenderingContext rc, BitmapFont font, ICamera camera, String label, float x, float y, float scale) protected voidrender2DLabel(ExtSpriteBatch batch, ExtShaderProgram shader, RenderingContext rc, BitmapFont font, ICamera camera, String label, float x, float y, float scale, int align) protected voidrender2DLabel(ExtSpriteBatch batch, ExtShaderProgram shader, RenderingContext rc, BitmapFont font, ICamera camera, String label, Vector3D pos3d) protected voidrender3DLabel(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 voidrender3DLabel(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) booleanTells whether the text must be rendered or not for this entitybooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleantext()Returns the textvoidExecutes the blending for the textvoidtextPosition(ICamera cam, Vector3D out) Text position for single objects (models, single stars, etc.).floatReturns the text scale for the scale varying in the shaderfloattextSize()Returns the text sizeMethods inherited from class RenderView
getDistToCamera, getOpacity, getRadius, textColour, textColourModifier and TypeMethodDescriptiondoubleGets the last distance to the camera calculated for this entityfloatReturns the opacity of this renderabledoublefloat[]Text color for single objectsfloat[]textColour(String name) Text color for the star with the given name in a star set.Methods inherited from class BaseView
componentsCheck, getBase, getBody, getComponent, getComponentType, getRender, hasCt, isHalfResolutionBuffer, isVisible, isVisible, setColor, setVisible, setVisibleModifier and TypeMethodDescriptionprotected booleancomponentsCheck(com.badlogic.ashley.core.Entity entity) Check whether the current components are the same as the components of the given entity.getBase()getBody()<T extends com.badlogic.ashley.core.Component>
TgetComponent(Class<T> c) booleanbooleanbooleanbooleanisVisible(boolean attributeValue) voidsetColor(float[] color) voidsetVisible(boolean visible) voidsetVisible(boolean visible, String name) Methods inherited from class AbstractView
check, clearEntity, getEntity, isEmpty, isValid, setEntityModifier and TypeMethodDescriptionprotected voidcheck(com.badlogic.ashley.core.Entity entity, com.badlogic.ashley.core.ComponentMapper mapper, Class<? extends com.badlogic.ashley.core.Component> componentClass) Checks whether an entity has a component, and throws aRuntimeExceptionif it does not.voidRemoves the entity (if any) of this view and sets all component references to null.com.badlogic.ashley.core.EntityReturns the current entity under this view.booleanisEmpty()Checks whether an entity is set in this view.booleanisValid()Checks whether the entity is valid, i.e., it is not null and has at least one component.voidsetEntity(com.badlogic.ashley.core.Entity entity) Sets the entity behind this view.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface I3DTextRenderable
textColourModifier and TypeMethodDescriptionfloat[]Returns an array with the text colour in the fashion [r, g, b, a]Methods inherited from interface IRenderable
getComponentType, isHalfResolutionBufferModifier and TypeMethodDescriptionGets the component types of this entitybooleanIs this renderable flagged to be rendered in a half-resolution buffer?
-
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:AbstractViewChecks whether the given entity is suitable for this view. This method should throw aRuntimeExceptionif the entity is not suitable.- Overrides:
entityCheckin classBaseView- Parameters:
entity- The entity.
-
entityChanged
protected void entityChanged()Description copied from class:AbstractViewContains actions to take after a new entity has been set. This method is typically used to initialize the view components.- Overrides:
entityChangedin classRenderView
-
entityCleared
protected void entityCleared()Description copied from class:AbstractViewThis method is called when the entity of this view is cleared. It should set all component references to null.- Overrides:
entityClearedin 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:I3DTextRenderableTells whether the text must be rendered or not for this entity- Specified by:
renderTextin interfaceI3DTextRenderable- Returns:
- True if text must be rendered
-
render
public void render(ExtSpriteBatch batch, ExtShaderProgram shader, TextRenderer sys, RenderingContext rc, ICamera camera) Description copied from interface:I3DTextRenderableRenders the text- Specified by:
renderin interfaceI3DTextRenderable- Parameters:
batch- The sprite batchshader- The shadersys- The text rendererrc- The render contextcamera- The camera
-
textSize
public float textSize()Description copied from interface:I3DTextRenderableReturns the text size- Specified by:
textSizein interfaceI3DTextRenderable- Returns:
- The text size
-
textScale
public float textScale()Description copied from interface:I3DTextRenderableReturns the text scale for the scale varying in the shader- Specified by:
textScalein interfaceI3DTextRenderable- Returns:
- The scale
-
textPosition
Text position for single objects (models, single stars, etc.).- Specified by:
textPositionin interfaceI3DTextRenderable- Parameters:
cam- The camera.out- The out parameter with the result.
-
text
Description copied from interface:I3DTextRenderableReturns the text- Specified by:
textin interfaceI3DTextRenderable- Returns:
- The text
-
textDepthBuffer
public void textDepthBuffer()Description copied from interface:I3DTextRenderableExecutes the blending for the text- Specified by:
textDepthBufferin interfaceI3DTextRenderable
-
defaultTextDepthBuffer
public void defaultTextDepthBuffer() -
noTextDepthBuffer
public void noTextDepthBuffer() -
emptyTextDepthBuffer
public void emptyTextDepthBuffer() -
isLabel
public boolean isLabel()Description copied from interface:I3DTextRenderableIs it a label or another kind of text?- Specified by:
isLabelin interfaceI3DTextRenderable- Returns:
- Whether this is a label
-
isLocation
public boolean isLocation() -
getTextOpacity
public float getTextOpacity()Description copied from interface:I3DTextRenderableGets the text opacity- Specified by:
getTextOpacityin 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)
-