Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the ability to change the text size #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Added the ability to change the text size #20

wants to merge 1 commit into from

Conversation

badadin
Copy link

@badadin badadin commented Nov 19, 2016

Добавил возможность менять размер шрифта, уж очень он мелкий.

Нужно только подправить VisualClient, например в Java:
public void text(double x, double y, int size, String msg, Color color)
{
Formatter f = new Formatter();
sendCommand(f.format("text %1.1f %1.1f %d %s %1.1f %1.1f %1.1f", x, y, size, msg, (float) color.getRed() / 255, (float) color.getGreen() / 255, (float) color.getBlue() / 255).toString());
}

А в MyStrategy использовать так:
vc.text(nextWaypoint.getX(), nextWaypoint.getY(), 35, "Next waypoint", Color.BLUE);

@@ -482,13 +485,13 @@ private void drawCircle(double centerX, double centerY, double radius, boolean u
graphics.drawOval(topLeft.getX(), topLeft.getY(), size.getX(), size.getY());
}

private void showText(double X, double Y, String text, boolean useAbsCoords)
private void showText(double X, double Y, String text, int size, boolean useAbsCoords)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

как насчет обратной совместимости?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Предлагаю переделать, добавив отдельную команду text_size, которая меняет текущий (для вывода) размер шрифта.
Тогда не страдает обратная совместимость клиентов.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants