Package sk.tuke.kpi.gamelib.graphics
Class OverlayDrawing<E extends OverlayDrawing.Element<?>>
- java.lang.Object
-
- sk.tuke.kpi.gamelib.graphics.OverlayDrawing<E>
-
- All Implemented Interfaces:
Disposable
public final class OverlayDrawing<E extends OverlayDrawing.Element<?>> extends java.lang.Object implements Disposable
An element drawn in anoverlay
.By default, it is shown only for a single frame. Method
showFor(float)
can be used to prolong its display time.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
OverlayDrawing.Element<T>
-
Constructor Summary
Constructors Constructor Description OverlayDrawing(@NotNull java.util.List<E> elements)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
Disposes the object by performing required cleanup operations.@NotNull java.util.List<E>
getElements()
boolean
isDisposed()
void
showFor(float duration)
Defines how long the drawing should be shown (in seconds).
-
-
-
Constructor Detail
-
OverlayDrawing
public OverlayDrawing(@NotNull @NotNull java.util.List<E> elements)
-
-
Method Detail
-
showFor
public void showFor(float duration)
Defines how long the drawing should be shown (in seconds). Has no effect whenisDisposed()
already returnstrue
.- Parameters:
duration
- defines time in seconds to show the drawing
-
getElements
@NotNull public @NotNull java.util.List<E> getElements()
-
isDisposed
public boolean isDisposed()
-
dispose
public void dispose()
Description copied from interface:Disposable
Disposes the object by performing required cleanup operations.- Specified by:
dispose
in interfaceDisposable
-
-