Class LineView
java.lang.Object
gaiasky.scene.view.AbstractView
gaiasky.scene.view.BaseView
gaiasky.scene.view.LineView
- All Implemented Interfaces:
ILineRenderable, IRenderable
-
Field Summary
FieldsFields inherited from class AbstractView
entityModifier and TypeFieldDescriptionprotected com.badlogic.ashley.core.EntityA reference to the entity. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidContains actions to take after a new entity has been set.protected voidThis method is called when the entity of this view is cleared.Gets the component types of this entitydoubleGets the last distance to the camera calculated for this entityintfloatfloatReturns the opacity of this renderablevoidrender(LineRenderSystem renderer, ICamera camera, float alpha) Methods inherited from class BaseView
componentsCheck, entityCheck, getBase, getBody, getComponent, 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.protected voidentityCheck(com.badlogic.ashley.core.Entity entity) Checks whether the given entity is suitable for this view.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 IRenderable
isHalfResolutionBufferModifier and TypeMethodDescriptionbooleanIs this renderable flagged to be rendered in a half-resolution buffer?
-
Field Details
-
trajectory
-
verts
-
line
-
-
Constructor Details
-
LineView
public LineView()Creates an empty line view. -
LineView
public LineView(com.badlogic.ashley.core.Entity entity) Creates an abstract view with the given entity.- Parameters:
entity- The entity.
-
-
Method Details
-
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 classBaseView
-
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 classBaseView
-
getLineWidth
public float getLineWidth()- Specified by:
getLineWidthin interfaceILineRenderable
-
render
- Specified by:
renderin interfaceILineRenderable
-
getGlPrimitive
public int getGlPrimitive()- Specified by:
getGlPrimitivein interfaceILineRenderable
-
getComponentType
Description copied from interface:IRenderableGets the component types of this entity- Specified by:
getComponentTypein interfaceIRenderable- Overrides:
getComponentTypein classBaseView- Returns:
- The component types
-
getDistToCamera
public double getDistToCamera()Description copied from interface:IRenderableGets the last distance to the camera calculated for this entity- Specified by:
getDistToCamerain interfaceIRenderable- Returns:
- The distance
-
getOpacity
public float getOpacity()Description copied from interface:IRenderableReturns the opacity of this renderable- Specified by:
getOpacityin interfaceIRenderable- Overrides:
getOpacityin classBaseView- Returns:
- The opacity
-