Package org.newdawn.slick.font.effects

Examples of org.newdawn.slick.font.effects.ColorEffect


  private static void loadFont(String name, Color color, int size)
      throws SlickException {
    String key = getKey(name, color, size);
    UnicodeFont font = new UnicodeFont(name, size, false, false);
    font.addAsciiGlyphs();
    font.getEffects().add(new ColorEffect(color));
    font.loadGlyphs();
    cache.put(key, font);
  }
View Full Code Here


  @SuppressWarnings("unchecked")
  private void initFonts() {
    try {
      sFont = new UnicodeFont("lib/sundaycomicsbb_reg.ttf", 14, false, false);
      sFont.getEffects().add(new ColorEffect(java.awt.Color.white));
      sFont.addAsciiGlyphs();
      sFont.loadGlyphs();
     
      sFont2 = new UnicodeFont("lib/sundaycomicsbb_reg.ttf", 24, false, false);
      sFont2.getEffects().add(new ColorEffect(java.awt.Color.white));
      sFont2.addAsciiGlyphs();
      sFont2.loadGlyphs();
    } catch (Exception e) {
      System.err.println("Failed to load font");
    }
View Full Code Here

    renderingBackgroundColor = new Color(backgroundColor.getRed(), backgroundColor.getGreen(), backgroundColor.getBlue());
    fontList.setSelectedValue(prefs.get("system.font", "Arial"), true);
    fontFileText.setText(prefs.get("font.file", ""));

    java.awt.Color foregroundColor = EffectUtil.fromString(prefs.get("foreground", "ffffff"));
    colorEffect = new ColorEffect();
    colorEffect.setColor(foregroundColor);
    effectsListModel.addElement(colorEffect);
    effectsListModel.addElement(new GradientEffect());
    effectsListModel.addElement(new OutlineEffect());
    effectsListModel.addElement(new OutlineWobbleEffect());
View Full Code Here

    unicodeFont = new UnicodeFont("testdata/Lato-Thin.ttf", 48, false, false);
//    unicodeFont.setPaddingBottom(10);
//    unicodeFont.setPaddingRight(10);
//    unicodeFont.setPaddingAdvanceX(-10);
//    unicodeFont.getEffects().add(new ShadowEffect(java.awt.Color.black, 5, 5, 0.5f));
    unicodeFont.getEffects().add(new ColorEffect(java.awt.Color.white));

    // unicodeFont = new UnicodeFont("Arial", 25, false, false);
    // unicodeFont = new UnicodeFont("Everson Mono", 44, false, false);

    // font.addGlyphs(0, 255);
View Full Code Here

TOP

Related Classes of org.newdawn.slick.font.effects.ColorEffect

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.