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 final Vec2sizeprivate Floatwidthprivate Floatheightprivate final PolyImage.Typetypeprivate final transient Booleaninitprivate final transient Booleanresettableprivate final InputStreamstreamprivate final StringresourcePath
-
Method Summary
Modifier and Type Method Description final Vec2getSize()final FloatgetWidth()final UnitsetWidth(Float width)final FloatgetHeight()final UnitsetHeight(Float height)final PolyImage.TypegetType()StringtoString()IntegerhashCode()Booleanequals(Object other)final static PolyImage.Typefrom(String fileName)final static PolyImagegetMaterialIcon(String icon, Vec2 size, PolyImage.MaterialStyle style)Get an SVG icon from the Google Material Icons repository on GitHub. final static PolyImagegetMaterialIcon(String icon, Vec2 size)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
close, get, getAsync, getAsyncNullable, 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, Vec2 size, PolyImage.Type type)
- Parameters:
resourcePath- the path to the resourcesize- the size of the image.type- the image type.
-
PolyImage
PolyImage(String resourcePath, Vec2 size)
- Parameters:
resourcePath- the path to the resourcesize- the size of the image.
-
PolyImage
PolyImage(String resourcePath)
- Parameters:
resourcePath- the path to the resource
-
-
Method Detail
-
getType
final PolyImage.Type getType()
-
from
final static PolyImage.Type from(String fileName)
-
getMaterialIcon
@JvmOverloads() final static PolyImage getMaterialIcon(String icon, Vec2 size, 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, Vec2 size)
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
-
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
-
-
-
-