Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anchor and Rotation_Origin fail on un-scaled images #81

Open
Chadnaut opened this issue Nov 21, 2024 · 1 comment
Open

Anchor and Rotation_Origin fail on un-scaled images #81

Chadnaut opened this issue Nov 21, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Chadnaut
Copy link
Collaborator

Anchor and Rotation_Origin require width and height to be explicitly set before they take effect.
Since the image defaults to using the texture size (or when zeroed), you would expect these to do the same.

Pretty sure you already know about this one, but I just came across it. Adding this ticket so it doesn't fall off the radar.

local flw = ::fe.layout.width;
local flh = ::fe.layout.height;
local art = ::fe.add_artwork("snap", flw * 0.5, flh * 0.5);
art.video_flags = Vid.ImagesOnly;

art.anchor = Anchor.Centre;
art.rotation_origin = Origin.Centre;

// The size must be set for the above origins to work
// art.width = 200;
// art.height = 200;

::fe.add_ticks_callback("on_tick");
function on_tick(ttime) {
    art.rotation += 1;
}
@oomek oomek added the bug Something isn't working label Nov 21, 2024
@oomek
Copy link
Owner

oomek commented Jan 5, 2025

Anchor is also not working properly with art.preserve_aspect_ratio = true

local flw = fe.layout.width
local flh = fe.layout.height

local snap = fe.add_artwork( "snap" , flw/2, flh/2, flw/2, flh/2 )
snap.video_flags = Vid.ImagesOnly
snap.preserve_aspect_ratio = true
snap.anchor = Anchor.Bottom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants