Attract-Mode Support Forum

Attract-Mode Support => Scripting => Topic started by: sosimple on November 16, 2019, 11:30:26 AM

Title: Newbie question: Rotate snapshot?
Post by: sosimple on November 16, 2019, 11:30:26 AM
Hi. I have modified a basic script to my needs, changing the values i wanted. Only thing i still trying without succes is rotating a bit the video snap. Perhaps anyone can help. I read some time but havent succed. I wont need something more than that for the simple theme i build.
What should i add to the code to rotate the video snap ? This :  local t = fe.add_artwork( "snap", 348+240, 152-60, 262+550, 262+380 ); It display horizontally as is. I need a small angle to much my graphics (bg.png).
Thanks .
This is the code:

Code: [Select]
//
// Attract-Mode Front-End - "Basic" sample layout
//
fe.layout.width=2160;
fe.layout.height=1440;

//fe.layout.width=2160;
//fe.layout.height=1440;


//*****This is what i want to rotate
local t = fe.add_artwork( "snap", 348+240, 152-60, 262+550, 262+380 );



t.trigger = Transition.EndNavigation;

//t = fe.add_artwork( "marquee", 348, 64, 262, 72 );
t.trigger = Transition.EndNavigation;

local lb = fe.add_listbox( 32, 64, 262, 852 );
lb.charsize = 19;
lb.set_selbg_rgb( 255, 255, 255 );
lb.set_sel_rgb( 0, 0, 0 );
lb.sel_style = Style.Bold;

fe.add_image( "bg.png", 0, 0 );

local l = fe.add_text( "[DisplayName]", 30, 15, 270, 30 );
l.set_rgb( 255, 255, 255 );
l.style = Style.Bold;

// The following function tells the frontend to use our title
// text and listbox (created above) for any menus (exit menu,
// etc...
//
fe.overlay.set_custom_controls( l, lb );

// Left side:

//*******tilos
//lText.rotation = -60.5;
l = fe.add_text( "[Title]", 1970, 1265, 320, 16 );
l.align = Align.Left;
l.charsize = 17;
l.style = Style.Bold;
l.rotation = -4.0;
l.set_rgb(240, 240, 240  );




l = fe.add_text( "[Year] [Manufacturer]", 30, 441, 320, 16 );
l.set_rgb( 200, 200, 70 );
l.align = Align.Left;



l = fe.add_text( "[Category]", 30, 458, 320, 16 );
l.set_rgb( 200, 200, 70 );
l.align = Align.Left;

// Right side:

l = fe.add_text( "[ListEntry]/[ListSize]", 935, 1067, 290, 16 );
l.set_rgb( 255, 255, 255 );
l.align = Align.Right;
l.charsize = 16;
l.style = Style.Bold;
l.rotation = 2.0;

l = fe.add_text( "[FilterName]", 320, 441, 290, 16 );
l.set_rgb( 200, 200, 70 );
l.align = Align.Right;


Title: Re: Newbie question: Rotate snapshot?
Post by: progets on November 16, 2019, 12:28:53 PM
https://github.com/mickelson/attract/blob/v2.4.0/Layouts.md#Image (https://github.com/mickelson/attract/blob/v2.4.0/Layouts.md#Image)

Depending on what you're trying to do...

rotation - Get/set rotation of image around its origin. Range is [0 ... 360]. Default value is 0.

skew_x - Get/set the amount of x-direction image skew (in layout coordinates). Default value is 0. Use a negative value to skew the image to the left instead.

skew_y - Get/set the amount of y-direction image skew (in layout coordinates). Default value is 0. Use a negative value to skew the image up instead.

example
Code: [Select]
//*****This is what i want to rotate
local t = fe.add_artwork( "snap", 348+240, 152-60, 262+550, 262+380 );
 t.rotation = -1.5;
Title: Re: Newbie question: Rotate snapshot?
Post by: sosimple on November 16, 2019, 02:37:19 PM
https://github.com/mickelson/attract/blob/v2.4.0/Layouts.md#Image (https://github.com/mickelson/attract/blob/v2.4.0/Layouts.md#Image)

Depending on what you're trying to do...

rotation - Get/set rotation of image around its origin. Range is [0 ... 360]. Default value is 0.

skew_x - Get/set the amount of x-direction image skew (in layout coordinates). Default value is 0. Use a negative value to skew the image to the left instead.

skew_y - Get/set the amount of y-direction image skew (in layout coordinates). Default value is 0. Use a negative value to skew the image up instead.

example
Code: [Select]
//*****This is what i want to rotate
local t = fe.add_artwork( "snap", 348+240, 152-60, 262+550, 262+380 );
 t.rotation = -1.5;

Many thank although, I read your edited reply / solution after founding it by my self after many effort.. I had read your reply before posting the solution, but hadnt reply as i was trying myself to found out  what was actually the one value i wanted from all this.  I havent thought before reading  your answer that there is rotation in many angles..
I was changing values to other themes to understanding better..
What you posted was what i actually was asking. If you had posted sooner  would have been better. :) But if i hadnt read your first answer probably i wouldnt have solve it by myself.
Thanks again, and thanks everyone for your very helpful forum. I may probably upload the theme when i feel is good enough ,although it is very simple and easy, nothing special. But it is for amstrad cpc 464 and there aren't many so may probably be useful to someone as a part of a bigger theme.