Class PolyImage
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumPolyImage.TypeTypes for images in PolyUI.
public enumPolyImage.MaterialStyleStyles for Google Material icons
-
Field Summary
Fields Modifier and Type Field Description private Vec2.Immutablesizeprivate final Floatwidthprivate final Floatheightprivate final Booleaninvalidprivate PolyImage.Typetypeprivate final transient Booleaninitprivate final transient Booleanerroredprivate final transient Booleanresettableprivate final InputStreamstreamprivate final StringresourcePath
-
Constructor Summary
Constructors Constructor Description PolyImage(String resourcePath, PolyImage.Type type)PolyImage(String resourcePath)
-
Method Summary
Modifier and Type Method Description final Vec2.ImmutablegetSize()Size of the image. final UnitsetSize(Vec2.Immutable size)Size of the image. final FloatgetWidth()final FloatgetHeight()final BooleangetInvalid()final PolyImage.TypegetType()final UnitsetType(PolyImage.Type type)StringtoString()IntegerhashCode()Booleanequals(Object other)final static PolyImage.Typefrom(String fileName)final static PolyImagegetMaterialIcon(String icon, PolyImage.MaterialStyle style)Get an SVG icon from the Google Material Icons repository on GitHub. final static PolyImagegetMaterialIcon(String icon)Get an SVG icon from the Google Material Icons repository on GitHub. -
Methods inherited from class org.polyfrost.polyui.renderer.data.Resource
addCompletionCallback, close, get, getAsync, getAsyncNullable, getErrored, getInit, getResettable, getResourcePath, getStream, reset -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
PolyImage
PolyImage(String resourcePath, PolyImage.Type type)
- Parameters:
resourcePath- the path to the resourcetype- the image type.
-
PolyImage
PolyImage(String resourcePath)
- Parameters:
resourcePath- the path to the resource
-
-
Method Detail
-
getSize
final Vec2.Immutable getSize()
Size of the image.
-
setSize
@ApiStatus.Internal() final Unit setSize(Vec2.Immutable size)
Size of the image.
-
getInvalid
final Boolean getInvalid()
-
getType
final PolyImage.Type getType()
-
setType
final Unit setType(PolyImage.Type type)
- Parameters:
type- the image type.
-
from
final static PolyImage.Type from(String fileName)
-
getMaterialIcon
@JvmOverloads() final static PolyImage getMaterialIcon(String icon, PolyImage.MaterialStyle style)
Get an SVG icon from the Google Material Icons repository on GitHub.
Note that these icons are licensed under the Apache 2.0 License.
- Parameters:
icon- the name of the icon, as a path as it is on the repo, using either dots or slashes, for examplecamera.11mporactions.abc.style- the Material icon style to use.- Since:
0.16.0
-
getMaterialIcon
@JvmOverloads() final static PolyImage getMaterialIcon(String icon)
Get an SVG icon from the Google Material Icons repository on GitHub.
Note that these icons are licensed under the Apache 2.0 License.
- Parameters:
icon- the name of the icon, as a path as it is on the repo, using either dots or slashes, for examplecamera.11mporactions.abc.- Since:
0.16.0
-
-
-
-