Skip to content

ElasticTweenEquation

abstract class ElasticTweenEquation
Extends: TweenEquation
Package: dev.joid.lib.animation.tween.equation · Module: core · Source: ElasticTweenEquation.java

Easing curves that oscillate like a spring at the start or at the end.

Each constant is also in TweenEquations, as ELASTIC_IN, ELASTIC_OUT and ELASTIC_IN_OUT. period(...) and amplitude(...) give the same curve with other oscillations, whose toString() carries them, period first: "Elastic.IN(0.3, 2.0)", which TweenEquations.of reads back.

ReturnsSignatureSummary
ElasticTweenEquation(float period, float amplitude) protectedCreates a curve with the oscillation period and the amplitude, for a subclass.

PropertyTypeDefaultSummary
periodfloat0.3F in IN and OUT, 0.45F in IN_OUTThe length of one oscillation, as a part of the step: smaller values oscillate faster.
amplitudefloat0F in the three constants, which counts as 1FThe height of the oscillations; a value below 1F counts as 1F.

Inherited from TweenEquation (1)

isValueOf

TypeNameValueSummary
ElasticTweenEquationINElasticTweenEquation.in(0.3F, 0F)Oscillates at the start, like a spring.
ElasticTweenEquationOUTElasticTweenEquation.out(0.3F, 0F)Oscillates at the end, like a spring.
ElasticTweenEquationIN_OUTElasticTweenEquation.inOut(0.3F * 1.5F, 0F)Oscillates at the start and at the end.
floatperiodThe length of one oscillation, as a part of the step: smaller values oscillate faster.
floatamplitudeThe height of the oscillations; a value below 1F counts as 1F.

ElasticTweenEquation(float period, float amplitude) protected

Creates a curve with the oscillation period and the amplitude, for a subclass.

  • this period(float period) fluent hook abstract
  • float getPeriod()

Default: 0.3F in IN and OUT, 0.45F in IN_OUT

The length of one oscillation, as a part of the step: smaller values oscillate faster. period(float) returns a curve of the same direction with that period and leaves this one unchanged.

  • this amplitude(float amplitude) fluent hook abstract
  • float getAmplitude()

Default: 0F in the three constants, which counts as 1F

The height of the oscillations; a value below 1F counts as 1F. amplitude(float) returns a curve of the same direction with that amplitude and leaves this one unchanged.

ElasticTweenEquation IN

Oscillates at the start, like a spring.

ElasticTweenEquation OUT

Oscillates at the end, like a spring.

ElasticTweenEquation IN_OUT

Oscillates at the start and at the end.

float period protected

The length of one oscillation, as a part of the step: smaller values oscillate faster. period(float) returns a curve of the same direction with that period and leaves this one unchanged.

float amplitude protected

The height of the oscillations; a value below 1F counts as 1F. amplitude(float) returns a curve of the same direction with that amplitude and leaves this one unchanged.


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