com.codingame.gameengine.module.entities.BitmapText Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of module-entities Show documentation
Show all versions of module-entities Show documentation
Entity Manager module for the CodinGame engine toolkit. Simplify the management of shapes and drawings.
package com.codingame.gameengine.module.entities;
import java.util.Objects;
/**
* Represents a label on screen, you can use any bitmap font in your asset folder as it's font.
*/
public class BitmapText extends TextBasedEntity {
private String font;
@Override
Type getType() {
return Entity.Type.BITMAPTEXT;
}
/**
* Returns the name of the font of this BitmapText
in px.
*
* Default is null.
*
*
* @return the size of the font of this BitmapText
.
*/
public String getFont() {
return font;
}
/**
* Sets the name of the font of this BitmapText
.
*
* Only fonts available to the browser can be displayed.
*
*
* Default is null.
*
*
*
* @param font
* the size for the font of this BitmapText
.
* @return this BitmapText
.
* @exception NullPointerException
* if font is null.
*/
public BitmapText setFont(String font) {
Objects.requireNonNull(font);
this.font = font;
set("fontFamily", font, null);
return this;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy