Skip to content

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.

ReturnsSignatureSummary
ResourcePropertiescreate() factoryCreates settings with linear filtering, automatic mipmaps and no region.

PropertyTypeDefaultSummary
interpolationTextureFilterTextureFilter.LINEARThe TextureFilter used when the texture is scaled: LINEAR smooths, NEAREST keeps the pixels sharp.
mipmapbooleannot forcedtrue 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.

ReturnsSignatureSummary
thislinear() fluentSets the filtering to LINEAR.
thisnearest() fluentSets the filtering to NEAREST.
thistextureCoords(double u, double v, double width, double height) fluentSets 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.
ResourcePropertiescopy()Returns a copy of these settings.
thisset(ResourceProperties properties) fluentCopies every setting of properties into these.
booleanequals(Object other)If true, the other object is of the same class with the same mipmap, texture coordinates and interpolation.
inthashCode()Returns a hash of the values that equals compares.

ResourceProperties create() factory

Creates settings with linear filtering, automatic mipmaps and no region.

  • this interpolation(TextureFilter interpolation) fluent
  • TextureFilter getInterpolation()

Default: TextureFilter.LINEAR

The TextureFilter used when the texture is scaled: LINEAR smooths, NEAREST keeps the pixels sharp.

  • this mipmap(boolean mipmap) fluent
  • Boolean 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.

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.


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

Report a problem with this page