ZenScript main repository
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DLabelStyle.java 956B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package org.openzen.drawablegui;
  7. import org.openzen.drawablegui.border.DBorder;
  8. import org.openzen.drawablegui.border.DPaddedBorder;
  9. import org.openzen.drawablegui.style.DStyleDefinition;
  10. /**
  11. *
  12. * @author Hoofdgebruiker
  13. */
  14. public class DLabelStyle {
  15. public final DBorder border;
  16. public final DFont font;
  17. public final int color;
  18. public DLabelStyle(DStyleDefinition style) {
  19. border = style.getBorder("border", context -> new DPaddedBorder(
  20. (int)(4 * context.getScale()),
  21. (int)(4 * context.getScale()),
  22. (int)(4 * context.getScale()),
  23. (int)(4 * context.getScale())));
  24. font = style.getFont("font", context -> new DFont(DFontFamily.UI, false, false, false, (int)(14 * context.getTextScale())));
  25. color = style.getColor("color", 0xFF000000);
  26. }
  27. }