Attract-Mode Support Forum
Attract-Mode Support => Scripting => Topic started by: justintime on October 06, 2024, 03:06:01 PM
-
So I am writing my own theme, and I am finding that in order to fine tune the display of the snap/video, I need to have a different skew and pinch depending on whether the video is horizontal or vertical. I believe I can NOT obtain easily the width/height of the video itself even using the texture_width or texture_height properties.
So, I am thinking if I can obtain the rom/game orientation info then I can put a conditional statement in my code and format the video/snap object accordingly.
Is there a way to do this? If not, any other workarounds?
Thanks, Im lovig the power of AM, coming from HyperSpin.
-
You can thank Oomek for this, it'll render the snap, maintain it's aspect ratio and place a border around it. You need Attract Mode + and inertia installed
local snap = fe.add_artwork( "snap",358, 220, 1200, 480);
snap.preserve_aspect_ratio = true;
snap.zorder = 5;
local flw = fe.layout.width
local flh = fe.layout.height
local frame = fe.add_rectangle( -30 ,210, 0, 0)
frame.zorder = 4
frame.outline = 5
frame.alpha = 100
// position the frame at the centre of the artwork, to avoid troublesome x offset calculations
frame.anchor = Anchor.Centre
frame.x = snap.x + snap.width / 2
frame.y = snap.y + snap.height / 2
frame.height = snap.height
frame = Inertia( frame, 1000, "alpha");
fe.add_transition_callback( "snap_transition" )
function snap_transition( ttype, var, ttime )
{
if ( ttype == Transition.ToNewList || ttype == Transition.FromOldSelection )
{
// pixel aspect ratio of the artwork
local par = snap.texture_width.tofloat() / snap.texture_height.tofloat() * snap.sample_aspect_ratio
frame.width = snap.height * par
frame.tween_alpha = Tween.Quint;
frame.loop_alpha = false;
frame.set_alpha = 0;
frame.to_alpha = 255;
frame.delay_alpha = 1000;
}
if( ttype == Transition.ToNewSelection){
frame.alpha = 0
}
}
-
I testd this. Unfortunately the frame class does not seem to support skew and pinch, and I am trying to get a border around a snap/video that is deformed with a perspective style effect.
Any other ideas welcome!
-
I solved this with some ridiculous trickery. I will have a new very clean theme with some cool fresh effects for everyone in the next few weeks.
-
i solved this , perhaps it help you:
https://youtu.be/Zr8ZmwlTWjg?si=zBTpEqXVVH85-6o1