forked from NASAWorldWind/WorldWindJava
-
Notifications
You must be signed in to change notification settings - Fork 17
Closed
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
Sometimes it is required to put SurfaceText rotated according North.
This possibility is absent but easy to add.
- Add angle attribute, its setter and getter to SurfaceText class.
- Add glRotated method call into applyDrawTransform.
See example of overridden class:
public class CustomSurfaceText extends SurfaceText {
private double angle;
public CustomSurfaceText(String text, Position position) {
super(text, position);
}
public CustomSurfaceText(String text, Position position, Font font, Color color) {
super(text, position, font, color);
}
public double getAngle() {
return angle;
}
public void setAngle(double angle) {
this.angle = angle;
}
@Override
protected void applyDrawTransform(DrawContext dc, SurfaceTileDrawContext sdc) {
super.applyDrawTransform(dc, sdc);
dc.getGL().getGL2().glRotated(-angle, 0, 0, 1);
}
}
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request