ResourceProperties
final class ResourceProperties
Package: dev.joid.lib.resource · Module: core · Source: ResourceProperties.java
The drawing settings of a resource handle, its filtering, its mipmaps and its region.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
ResourceProperties | create() factory | Creates settings with linear filtering, automatic mipmaps and no region. |
Properties
Section titled “Properties”| Property | Type | Default | Summary |
|---|---|---|---|
| interpolation | TextureFilter | TextureFilter.LINEAR | The TextureFilter used when the texture is scaled: LINEAR smooths, NEAREST keeps the pixels sharp. |
| mipmap | boolean | not forced | true to always use mipmaps, false to never use them; null lets JOID turn them on when the image is drawn smaller than its texture with linear filtering. |
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
this | linear() fluent | Sets the filtering to LINEAR. |
this | nearest() fluent | Sets the filtering to NEAREST. |
this | textureCoords(double u, double v, double width, double height) fluent | Sets the region at u, v of width × height pixels of the image to draw. |
double[] | getTextureCoords() | Returns a copy of the region as u, v, width, height, or null for the whole image. |
ResourceProperties | copy() | Returns a copy of these settings. |
this | set(ResourceProperties properties) fluent | Copies every setting of properties into these. |
boolean | equals(Object other) | If true, the other object is of the same class with the same mipmap, texture coordinates and interpolation. |
int | hashCode() | Returns a hash of the values that equals compares. |
Creation details
Section titled “Creation details”create
Section titled “create”ResourceProperties create() factory
Creates settings with linear filtering, automatic mipmaps and no region.
Property details
Section titled “Property details”interpolation
Section titled “interpolation”this interpolation(TextureFilter interpolation)fluentTextureFilter getInterpolation()
Default: TextureFilter.LINEAR
The TextureFilter used when the texture is scaled: LINEAR smooths, NEAREST keeps the pixels sharp.
mipmap
Section titled “mipmap”this mipmap(boolean mipmap)fluentBoolean getMipmap()
Default: not forced
true to always use mipmaps, false to never use them; null lets JOID turn them on when the image is drawn smaller than its texture with linear filtering.
Method details
Section titled “Method details”linear
Section titled “linear”this linear() fluent
Sets the filtering to LINEAR.
nearest
Section titled “nearest”this nearest() fluent
Sets the filtering to NEAREST.
textureCoords
Section titled “textureCoords”this textureCoords(double u, double v, double width, double height) fluent
Sets the region at u, v of width × height pixels of the image to draw.
getTextureCoords
Section titled “getTextureCoords”double[] getTextureCoords()
Returns a copy of the region as u, v, width, height, or null for the whole image.
ResourceProperties copy()
Returns a copy of these settings.
this set(ResourceProperties properties) fluent
Copies every setting of properties into these.
equals
Section titled “equals”boolean equals(Object other)
If true, the other object is of the same class with the same mipmap, texture coordinates and interpolation.
hashCode
Section titled “hashCode”int hashCode()
Returns a hash of the values that equals compares.
fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses
