macroquad icon indicating copy to clipboard operation
macroquad copied to clipboard

tiled: Support tile flipping flags

Open septum opened this issue 3 years ago • 1 comments

Based from this documentation reference.

Beware: code may be ugly and unidiomatic.

septum avatar Jul 18 '21 22:07 septum

This feature requires fixing rotation code. At line 121@tiled/src/lib.rs we should multiply by 90 instead of -90.

Please disregard my previous comment.

Currrently this works for me, though I'm sure there must be a simpler method to do this:

flip_x: (flags.horizontally
    && (!flags.antidiagonally || (flags.vertically && flags.antidiagonally)))
    || (!flags.horizontally && flags.antidiagonally && !flags.vertically),  
    
flip_y: flags.vertically && !flags.antidiagonally && !flags.horizontally,  

rotation: if flags.antidiagonally {  
    if !flags.horizontally {  
        -f32::consts::PI / 2.0  
    } else {  
        f32::consts::PI / 2.0  
    }  
} else {
    0.
}

vdrn avatar Jul 16 '22 15:07 vdrn

I'll close this now.

septum avatar Feb 26 '23 23:02 septum