Attract-Mode Support Forum
Attract-Mode Support => Scripting => Topic started by: mesoraven on February 15, 2022, 03:21:41 AM
-
hey,
so ive been making some small modifications to the Retrodiction theme found here: http://forum.attractmode.org/index.php?topic=3199.0
ive added in a space above the games list for the game logo.
ive managed to freely modify every bit of the layout except the indicator circle. i can move it in the x axis but not matter how much i increase the y value its starting position never changes
i only started learning programming about a year ago for fun so its probably just me missing something small but any help would be appriciated.
here is the offending code as far as i can tell.
//Indicator Bar
local indicator_bar = fe.add_image( "images/indicator_bar.png", 21, 240, 12,730 );
local indicator_graph = fe.add_image( "images/indicator_graph.png", 23, 240, 8, 760 );
local indicator_position = fe.add_image( "images/indicator_circle.png", 5, 400, 42, 42 );
-
function on_indextransition( ttype, var, ttime )
{
indicator_graph.height = (indicator_bar.height)/(fe.list.size) * (fe.list.index+1)
indicator_position.y = (indicator_bar.height)/(fe.list.size) * (fe.list.index) +418
indicator_text.y = (indicator_bar.height)/(fe.list.size) * (fe.list.index) + 418
}
fe.add_transition_callback( this, "on_indextransition" )
That's the section of code that moves the circle in the original layout
https://github.com/randombyt/RetroDiction/blob/master/layouts/retrodiction/layout.nut
-
function on_indextransition( ttype, var, ttime )
{
indicator_graph.height = (indicator_bar.height)/(fe.list.size) * (fe.list.index+1)
indicator_position.y = (indicator_bar.height)/(fe.list.size) * (fe.list.index) +418
indicator_text.y = (indicator_bar.height)/(fe.list.size) * (fe.list.index) + 418
}
fe.add_transition_callback( this, "on_indextransition" )
That's the section of code that moves the circle in the original layout
https://github.com/randombyt/RetroDiction/blob/master/layouts/retrodiction/layout.nut
Awesome thankyou, makes sense now you have pointed it out. obviously its vertical location would be based of the list rather than the objects location
-
function on_indextransition( ttype, var, ttime )
{
indicator_graph.height = (indicator_bar.height)/(fe.list.size) * (fe.list.index+1)
indicator_position.y = (indicator_bar.height)/(fe.list.size) * (fe.list.index) +418
indicator_text.y = (indicator_bar.height)/(fe.list.size) * (fe.list.index) + 418
}
fe.add_transition_callback( this, "on_indextransition" )
That's the section of code that moves the circle in the original layout
https://github.com/randombyt/RetroDiction/blob/master/layouts/retrodiction/layout.nut
Awesome thankyou, makes sense now you have pointed it out. obviously its vertical location would be based of the list rather than the objects location
Exactly.
Think I still have an horizontal mod of this I did a while ago somewhere. I'll see if I can find it in case anyone wants it.
EDIT:
Modified code in the "horizontal.txt" attached along with the two images it calls
Can be seen working in this video: https://www.youtube.com/watch?v=v4_EcawSvb4