Trait tween::TweenValue

source ·
pub trait TweenValue: Copy + Debug + Add<Output = Self> + Sub<Output = Self> {
    // Required method
    fn scale(self, scale: f32) -> Self;
}
Expand description

A TweenValue is a value which can be Tweened. The library fundamentally outputs TweenValue eventually.

If you want to implement your own values to be tweened (for example, your favorite color lib), then you’ll need to implement this trait.

For now, we require Copy, but can reduce this to a Clone implementation. Please file an issue if that is needed for your workflow.

Required Methods§

source

fn scale(self, scale: f32) -> Self

This should be implemented as a simple multiplication. For f64, for example, it’s implemented as (self as f32 * scale) as f64.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl TweenValue for f32

source§

fn scale(self, scale: f32) -> Self

source§

impl TweenValue for f64

source§

fn scale(self, scale: f32) -> Self

source§

impl TweenValue for i8

source§

fn scale(self, scale: f32) -> Self

source§

impl TweenValue for i16

source§

fn scale(self, scale: f32) -> Self

source§

impl TweenValue for i32

source§

fn scale(self, scale: f32) -> Self

source§

impl TweenValue for i64

source§

fn scale(self, scale: f32) -> Self

source§

impl TweenValue for i128

source§

fn scale(self, scale: f32) -> Self

source§

impl TweenValue for isize

source§

fn scale(self, scale: f32) -> Self

source§

impl TweenValue for u8

source§

fn scale(self, scale: f32) -> Self

source§

impl TweenValue for u16

source§

fn scale(self, scale: f32) -> Self

source§

impl TweenValue for u32

source§

fn scale(self, scale: f32) -> Self

source§

impl TweenValue for u64

source§

fn scale(self, scale: f32) -> Self

source§

impl TweenValue for u128

source§

fn scale(self, scale: f32) -> Self

source§

impl TweenValue for usize

source§

fn scale(self, scale: f32) -> Self

Implementors§