CPSystemFont
System 1-character high font.
Attributes
- See also
- Example
-
See CPFontsExample source code for an example of font functionality.
- Source
- CPSystemFont.scala
- Graph
-
- Supertypes
- Self type
-
CPSystemFont.type
Members list
Value members
Concrete methods
Gets baseline of this font in standard character.
Gets baseline of this font in standard character.
Attributes
- Definition Classes
- Source
- CPSystemFont.scala
Gets encoding used by this font. Note that for the system font it returns "UTF-8"
.
Gets encoding used by this font. Note that for the system font it returns "UTF-8"
.
Attributes
- Definition Classes
- Source
- CPSystemFont.scala
Gets height of this font in standard characters.
Gets height of this font in standard characters.
Attributes
- Definition Classes
- Source
- CPSystemFont.scala
Gets width of this font in standard characters.
Gets width of this font in standard characters.
Attributes
- Definition Classes
- Source
- CPSystemFont.scala
Whether or not this is a "standard" 1-character height system font.
Whether or not this is a "standard" 1-character height system font.
Attributes
- Definition Classes
- Source
- CPSystemFont.scala
Renders single line text as an image with this font.
Renders single line text as an image with this font.
Attributes
- Definition Classes
- Source
- CPSystemFont.scala
Renders given one-line string into a sequence of pixels.
Renders given one-line string into a sequence of pixels.
Value parameters
- bg
-
Optional background color to use. Default value is
None
. - fg
-
Foreground color to use.
- s
-
Text to render. Must be non-empty.
Attributes
- Returns
-
Sequence of pixel representing given string in system font.
- Source
- CPSystemFont.scala
Inherited methods
Compares the receiver object (this
) with the argument object (that
) for equivalence.
Compares the receiver object (this
) with the argument object (that
) for equivalence.
Any implementation of this method should be an equivalence relation:
- It is reflexive: for any instance
x
of typeAny
,x.equals(x)
should returntrue
. - It is symmetric: for any instances
x
andy
of typeAny
,x.equals(y)
should returntrue
if and only ify.equals(x)
returnstrue
. - It is transitive: for any instances
x
,y
, andz
of typeAny
ifx.equals(y)
returnstrue
andy.equals(z)
returnstrue
, thenx.equals(z)
should returntrue
.
If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is usually necessary to override hashCode
to ensure that objects which are "equal" (o1.equals(o2)
returns true
) hash to the same scala.Int. (o1.hashCode.equals(o2.hashCode)
).
Value parameters
- that
-
the object to compare against this object for equality.
Attributes
- Returns
-
true
if the receiver object is equivalent to the argument;false
otherwise. - Definition Classes
-
CPGameObject -> Any
- Inherited from:
- CPGameObject
- Source
- CPGameObject.scala
Gets unique ID of this game object.
Gets unique ID of this game object.
Attributes
- Inherited from:
- CPGameObject
- Source
- CPGameObject.scala
Gets optional set of organizational tags. Note that by default the set of tags is empty.
Gets optional set of organizational tags. Note that by default the set of tags is empty.
Attributes
- See also
- Inherited from:
- CPGameObject
- Source
- CPGameObject.scala
Renders given multiline text as an image. Supplied string will be split by system-specific "new line' character sequence ('\n' or '\n\r'). This call is equivalent to:
Renders given multiline text as an image. Supplied string will be split by system-specific "new line' character sequence ('\n' or '\n\r'). This call is equivalent to:
renderSeq(s.split(CPUtils.NL).filter(!_.isBlank).toSeq, fg, bg, align)
Value parameters
- align
-
Alignment of text. The only allowed values are:
-1
- left justified alignment.0
- centered alignment.1
- right justified alignment. Default value is0
.
- bg
-
Optional background color to use. Default value is
None
. - fg
-
Foreground color to use.
- s
-
Multiline text to render as an image. Must be non-empty.
Attributes
- Returns
-
Image as a rendering of the given string with this font.
- Inherited from:
- CPFont
- Source
- CPFont.scala
Renders given multiline text as an image.
Renders given multiline text as an image.
Value parameters
- align
-
Alignment of text. The only allowed values are:
-1
- left justified alignment.0
- centered alignment.1
- right justified alignment. Default value is0
.
- bg
-
Optional background color to use. Default value is
None
. - fg
-
Foreground color to use.
- ss
-
Sequence of text lines to render as an image. Must be non-empty.
Attributes
- Returns
-
Image as a rendering of the given string with this font.
- Inherited from:
- CPFont
- Source
- CPFont.scala
Inherited fields
Gets the origin of this asset. Typically, this should be a URL, file name or class name for in-code assets like array images, animations or system font.
Gets the origin of this asset. Typically, this should be a URL, file name or class name for in-code assets like array images, animations or system font.
Attributes
- Inherited from:
- CPFont
- Source
- CPFont.scala