Author Topic: LAVA v1.0 Official Release.  (Read 33154 times)

asahendrix

  • Full Member
  • ***
  • Posts: 76
    • View Profile
I've started to play with this a bit - I have a few questions/aspirations that I was hoping someone could help me with:

#1) Can I add multiple songs and have the music "shuffle" so that every time I navigate to the layout I get a different song. I'd also like to use this for the ambient music that's always playing.

#2) I have continuous ambient music in the background. This conflicts with the layout music - is there a code that stops the ambient music and plays the layout music?

#3) This sounds picky... but... how can I make a different color for the lava lamp? - I love this feature and I wanted to try blue or orange.

#4) Instead of the "static" screen for games with no snap, I wanted to add a 10-15 minutes video of a cable broadcast from say 1985 - with commercials and all - or something to this effect. Is there a way I can have a random video play instead of a static screen and instead of having the same broadcast video play every time? Like a video shuffle.


I'd appreciate any and all help with this! Right now I'm trying to add a game wheel option and I'm going off of the OlRoom wheel configurations.

takoni

  • Full Member
  • ***
  • Posts: 49
    • View Profile
WOW! .... thanks to all for your help, questions & ideas,,,,

Yaron2019: you are a "machine code man", i dont knew that ,,,,THANKS A LOT, i am going to include in my layouts... i am rookie with all this, so thanks for your lessons, trully.

keilmillerjr: i dont know how to make this more compatible , every of you can re write , i will thank you .

asahendrix: thanks for your ideas and your intense help to me , 1, 2 questions : i dont know but Yaron2019 it has given me an idea ;)  ,question 3: well lava is a video, so i have 3 color by the moment, i dont know if it can be done with code, i dont think so... but... i can edit more videos with different colors instead.... i will edit 2 videos for you with orange & blue;) ... and question 4, i dont know how at this moment... sorry so much,

and sorry about my english , i am re studing too.

by the way... here you can see my work with raspberrys marquee and the monitor rotation... a nice work ;)

https://youtu.be/6UHoO6Lha08

cheers
« Last Edit: July 18, 2019, 12:23:44 AM by takoni »

Yaron2019

  • Guest
WOW! .... thanks to all for your help, questions & ideas,,,,

Yaron2019: you are a "machine code man", i dont knew that ,,,,THANKS A LOT, i am going to include in my layouts... i am rookie with all this, so thanks for your lessons, trully.

keilmillerjr: i dont know how to make this more compatible , every of you can re write , i will thank you .

asahendrix: thanks for your ideas and your intense help to me , 1, 2 questions : i dont know but Yaron2019 it has given me an idea ;)  ,question 3: well lava is a video, so i have 3 color by the moment, i dont know if it can be done with code, i dont think so... but... i can edit more videos with different colors instead.... i will edit 2 videos for you with orange & blue;) ... and question 4, i dont know how at this moment... sorry so much,

and sorry about my english , i am re studing too.

by the way... here you can see my work with raspberrys marquee and the monitor rotation... a nice work ;)

https://youtu.be/6UHoO6Lha08

cheers

You are welcome. I will try to help out wit what I can.

keilmillerjr is talking about the relative paths.

As to what asahendrix wants I know how to do some of it at least. It's similar code to the code I wrote to play Hyperspin-like wheel sounds.

But wait... That Arcade machine you built with the turning display!! That is some serious work hombre!!  8)

bundangdon

  • Sr. Member
  • ****
  • Posts: 212
    • View Profile
Takoni, this is great! I've worked with similar themes but I really like the way you captured the lighting and various atmosphere-aspects of the room in your layout. I was just wondering if it's possible to share the artwork source, if it's available in .psd (photoshop)? I'd just like to edit a few things in the room, as I'm not really a fan of some of the decorations. But overall, this is extremely great work ;D

takoni

  • Full Member
  • ***
  • Posts: 49
    • View Profile
bundangdon: here are the PSDD file and the AFter Effects lava lamp file, but, the backgroud picture is not mine, asahendrix sugested me.

https://mega.nz/#!3JxWSCJD!WHGjVItHZYTTjpd0dEDJW4Be0YhXYxyJiyQlkugCdPY


takoni

  • Full Member
  • ***
  • Posts: 49
    • View Profile
Here new version, 2 more lava lamp colors and random music with folder ... you have to set in the layuot :  local TotalSongs = "number of songs you have in the folder music" , and songs must be "1.mp3 ....2,3,4,5 etc.mp3"  ... i would like to show sound.metadata but i dont know how... cheers

https://mega.nz/#!zNAUFSbB!gwCIxo0IZSovBmp58_xs-FiaJORvMjOR-9nAzdvfpFw

bundangdon

  • Sr. Member
  • ****
  • Posts: 212
    • View Profile
bundangdon: here are the PSDD file and the AFter Effects lava lamp file, but, the backgroud picture is not mine, asahendrix sugested me.

https://mega.nz/#!3JxWSCJD!WHGjVItHZYTTjpd0dEDJW4Be0YhXYxyJiyQlkugCdPY

Unfortunately there wasn't much I could do with that .psd file since all of the artwork is merged together in one layer. But thank you for sharing anyways, and it definitely gives me some ideas

Yaron2019

  • Guest
Hombre,

I made some updates to your theme:

- Tidied up the code so it is more readable, especially indentation and removable of excessive empty spaces.

- Added numerous ";" missing at the end of code lines. There is now color emanating from the light of the game video snap on the rest of the graphics (look at the clock and boxes for example) and the TV border is not garbled.

- Replaced all static path names with relative paths.

- Added an option to play either click, random or no sounds when navigating the game list.

- Added an 'objects' folder where the click sound is.

- Added an option to play random background music. It currently supports 4 music tracks. In order to change that just added music#.mp3 files to the music folder (example: music5.mp3, music6.mp3, etc) and change the 'Playlist_length' parameter in the layout.nut script so it is equal to the number of music files. It is currently 4. This requires an optimization in which the script will automatically read the number of files in the music folder but I could not find a way to do it.

- Added a 'music' folder where the music files are and added 3 additional music files - all from Top-Gun's soundtrack!   8)

- Added an option to play a static effect video when game video snap is not found. User can replace this video (called 'static.mp4' in the lava layout folder) with any video he wants, just name it the same.

- Fixed clock font size so it fits the clock.

- Changed the boxart label from flyer to boxart. Boxarts and Flyers are not the same thing. Flyers are pamphlets (ads) not boxes...
If this creates problems, change "boxart" back to "flyer" in the box art section of the script. Example:
From:
'local artworkSombra = fe.add_artwork( "boxart", hor-28, 778, 460, 280);'
To:
'local artworkSombra = fe.add_artwork( "flyer", hor-28, 778, 460, 280);'


Download latest version from here:
http://forum.attractmode.org/index.php?topic=2950.msg21119#msg21119

Download the random list sounds from here and place them at your main Attract folder in a sounds folder:
https://mega.nz/#!gJs0nQ7a!q4nYNGwxIa8Mo1mPJJ5t9HGJF58vkNe13rlNoNfl708


Screenshot of before and after updates:
« Last Edit: July 27, 2019, 01:24:47 AM by Yaron2019 »

asahendrix

  • Full Member
  • ***
  • Posts: 76
    • View Profile
Wow - so much to unpack here. For awhile it was just me and Takoni - and neither of us are coders haha although he is much better than I am.

Thank you so much for helping with the music "shuffle". And thank you for the extra lava lamp colors - I always love extra options! :)

Although it may be copious, I'm working on adding an option for a wheel, vertical wheel, list (the list Takoni has here) as well as a size option for these lists. For instance, it would be an option to select vert_wheel, and the the option to change the size from small, medium or large. This is because I like a small vertical wheel, but I'm using a 60" TV with my Pi - if I moved the Pi to a 32" TV, the small list is going to be tiny. This would also info some "if" statements - if the list size was set at medium or small, then the box art would be centered under the list in front of the NES. If the list was large (normal size) then the box art would cover part of the TV and part of a dinosaur to make room for the list. This would all involve adding an extra user config and even though "if" statements aren't completely foreign to me, I have almost no experience writing them myself. So I might be in over my head haha.

I keep hitting a snag - if I try to just copy over the wheels from OlRoom along with the user config line at the top, then the layout won't work. There must be a call back somewhere that I'm missing - thus making it a broken connection and thus voiding the layout. It's frustrating because I have all of the dimensions for the vertical wheel mapped out already. If anyone can help me out, that'd be great.

Thank you guys SO MUCH for all of the help and ideas!

Yaron2019

  • Guest
Wow - so much to unpack here. For awhile it was just me and Takoni - and neither of us are coders haha although he is much better than I am.

Thank you so much for helping with the music "shuffle". And thank you for the extra lava lamp colors - I always love extra options! :)

Although it may be copious, I'm working on adding an option for a wheel, vertical wheel, list (the list Takoni has here) as well as a size option for these lists. For instance, it would be an option to select vert_wheel, and the the option to change the size from small, medium or large. This is because I like a small vertical wheel, but I'm using a 60" TV with my Pi - if I moved the Pi to a 32" TV, the small list is going to be tiny. This would also info some "if" statements - if the list size was set at medium or small, then the box art would be centered under the list in front of the NES. If the list was large (normal size) then the box art would cover part of the TV and part of a dinosaur to make room for the list. This would all involve adding an extra user config and even though "if" statements aren't completely foreign to me, I have almost no experience writing them myself. So I might be in over my head haha.

I keep hitting a snag - if I try to just copy over the wheels from OlRoom along with the user config line at the top, then the layout won't work. There must be a call back somewhere that I'm missing - thus making it a broken connection and thus voiding the layout. It's frustrating because I have all of the dimensions for the vertical wheel mapped out already. If anyone can help me out, that'd be great.

Thank you guys SO MUCH for all of the help and ideas!

Uncle Yaron2019 is here for the rescue!
I actually added a working wheel to lava and then removed it because I didn't want to barge into your project.
But now... YOU ASKED FOR IT!!!!!!!!!  ;D

Where are you with this coding effort?
« Last Edit: July 18, 2019, 08:15:34 AM by Yaron2019 »

takoni

  • Full Member
  • ***
  • Posts: 49
    • View Profile
Yaron2019: T H A N K S S S S S S S S A LOT!!!!

asahendrix

  • Full Member
  • ***
  • Posts: 76
    • View Profile
Wow - so much to unpack here. For awhile it was just me and Takoni - and neither of us are coders haha although he is much better than I am.

Thank you so much for helping with the music "shuffle". And thank you for the extra lava lamp colors - I always love extra options! :)

Although it may be copious, I'm working on adding an option for a wheel, vertical wheel, list (the list Takoni has here) as well as a size option for these lists. For instance, it would be an option to select vert_wheel, and the the option to change the size from small, medium or large. This is because I like a small vertical wheel, but I'm using a 60" TV with my Pi - if I moved the Pi to a 32" TV, the small list is going to be tiny. This would also info some "if" statements - if the list size was set at medium or small, then the box art would be centered under the list in front of the NES. If the list was large (normal size) then the box art would cover part of the TV and part of a dinosaur to make room for the list. This would all involve adding an extra user config and even though "if" statements aren't completely foreign to me, I have almost no experience writing them myself. So I might be in over my head haha.

I keep hitting a snag - if I try to just copy over the wheels from OlRoom along with the user config line at the top, then the layout won't work. There must be a call back somewhere that I'm missing - thus making it a broken connection and thus voiding the layout. It's frustrating because I have all of the dimensions for the vertical wheel mapped out already. If anyone can help me out, that'd be great.

Thank you guys SO MUCH for all of the help and ideas!

Uncle Yaron2019 is here for the rescue!
I actually added a working wheel to lava and then removed it because I didn't want to barge into your project.
But now... YOU ASKED FOR IT!!!!!!!!!  ;D

Where are you with this coding effort?

Woohoo! Haha - Thank you so much! And I'd like to take credit, but this project is all Takoni. :)

Right now, all I have is all the x, y, h, w coordinates for the vertical wheel (with a wheel total of 6, that is - I'd have to map out more if someone wanted more than 6 wheel entries). I was wanting to substitute the listbox for the list that Takoni created:




Small Vertical List in far left corner:

//This enables vertical art instead of default wheel
if ( my_config["enable_list_type"] == "vert_wheel" )
{
fe.load_module( "conveyor" );
local wheel_x = [ flx*0.85, flx*0.85, -flx*1.465, flx*0.85, -flx*0.31, flx*0.85, flx*0.05, -flx*1.475, flx*0.85, flx*0.85, -flx*1.48, flx*0.85, ];
local wheel_y = [ -fly*0.22, -fly*0.105, -fly*0.2, fly*0.105, fly*0.215, -fly*0.17, fly*0.16, -fly*0.65, fly*0.72, fly*0.05, fly*0.935, fly*0.99, ];
local wheel_w = [ flw*0.09, flw*0.09, flw*0.09, flw*0.09, flw*0.09, flw*0.09, flw*0.14, flw*0.09, flw*0.09, flw*0.09, flw*0.09, flw*0.09, ];
local wheel_a = [  80,  80,  80,  80,  80,  80, 255,  80,  80,  80,  80,  80, ]; //This is opacity
local wheel_h = [  flh*0.05,  flh*0.05,  flh*0.05,  flh*0.05,  flh*0.05,  flh*0.05, flh*0.084,  flh*0.05,  flh*0.05,  flh*0.05,  flh*0.05,  flh*0.05, ]; //This is height, depending on the amont of wheels you select, each entry represents one wheel.
local wheel_r = [  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ];
local num_arts = 6;

class WheelEntry extends ConveyorSlot
{
   constructor()
   {
      base.constructor( ::fe.add_artwork( my_config["orbit_art"] ) );
   }

   function on_progress( progress, var )
   {
      local p = progress / 0.1;
      local slot = p.tointeger();
      p -= slot;
      
      slot++;

      if ( slot < 0 ) slot=0;
      if ( slot >=10 ) slot=10;

      m_obj.x = wheel_x[slot] + p * ( wheel_x[slot+1] - wheel_x[slot] );
      m_obj.y = wheel_y[slot] + p * ( wheel_y[slot+1] - wheel_y[slot] );
      m_obj.width = wheel_w[slot] + p * ( wheel_w[slot+1] - wheel_w[slot] );
      m_obj.height = wheel_h[slot] + p * ( wheel_h[slot+1] - wheel_h[slot] );
      m_obj.rotation = wheel_r[slot] + p * ( wheel_r[slot+1] - wheel_r[slot] );
      m_obj.alpha = wheel_a[slot] + p * ( wheel_a[slot+1] - wheel_a[slot] );
   }
};

local wheel_entries = [];
for ( local i=0; i<num_arts/2; i++ )
   wheel_entries.push( WheelEntry() );

local remaining = num_arts - wheel_entries.len();

// we do it this way so that the last wheelentry created is the middle one showing the current
// selection (putting it at the top of the draw order)
for ( local i=0; i<remaining; i++ )
   wheel_entries.insert( num_arts/2, WheelEntry() );

local conveyor = Conveyor();
conveyor.set_slots( wheel_entries );
conveyor.transition_ms = 0;
try { conveyor.transition_ms = my_config["transition_ms"].tointeger(); } catch ( e ) { }
}
 
***************************************************************************
//Small vertical list in top right corner
if ( my_config["enable_list_type"] == "vert_wheel" )
{
fe.load_module( "conveyor" );
local wheel_x = [ flx*0.85, flx*0.85, flx*0.85, flx*0.85, flx*0.85, flx*0.85, flx*0.83, flx*0.85, flx*0.85, flx*0.85, flx*0.85, flx*0.85, ];
local wheel_y = [ -fly*0.22, -fly*0.105, -fly*0.2, fly*0.105, fly*0.215, -fly*0.17, fly*0.16, -fly*0.65, fly*0.72, fly*0.05, fly*0.935, fly*0.99, ];
local wheel_w = [ flw*0.09, flw*0.09, flw*0.09, flw*0.09, flw*0.09, flw*0.09, flw*0.14, flw*0.09, flw*0.09, flw*0.09, flw*0.09, flw*0.09, ];
local wheel_a = [  80,  80,  80,  80,  80,  80, 255,  80,  80,  80,  80,  80, ]; //This is opacity
local wheel_h = [  flh*0.05,  flh*0.05,  flh*0.05,  flh*0.05,  flh*0.05,  flh*0.05, flh*0.084,  flh*0.05,  flh*0.05,  flh*0.05,  flh*0.05,  flh*0.05, ]; //This is height, depending on the amont of wheels you select, each entry represents one wheel.
local wheel_r = [  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ];
local num_arts = 6;


*****************************************************************************
Full Size Vertical List on the Left:

local wheel_x = [ flx*0.78, flx*0.05, flx*0.78, -flx*0.32, flx*0.78, -flx*1.4255, flx*0.03, -flx*1.4255, flx*0.78, -flx*0.325, flx*0.78, flx*0.78, ];
  local wheel_y = [ -fly*0.22, -fly*0.105, fly*0.0, fly*0.105, fly*0.215, fly*0.325, fly*0.436, fly*0.61, fly*0.72 fly*0.83, fly*0.935, fly*0.99, ];
  local wheel_w = [ flw*0.18, flw*0.18, flw*0.18, flw*0.18, flw*0.18, flw*0.18, flw*0.22, flw*0.18, flw*0.18, flw*0.18, flw*0.18, flw*0.18, ];
  local wheel_a = [  80,  80,  80,  80,  150,  150, 255,  150,  150,  80,  80,  80, ];
  local wheel_h = [  flh*0.11,  flh*0.11,  flh*0.11,  flh*0.11,  flh*0.11,  flh*0.11, flh*0.15,  flh*0.11,  flh*0.11,  flh*0.11,  flh*0.11,  flh*0.11, ];
  local wheel_r = [  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ];
local num_arts = 6;



*****************************************************************************
Full Size Vertical List on the Right:

local wheel_x = [ flx*0.78, flx*0.78, flx*0.78, flx*0.78, flx*0.78, flx*0.78, flx*0.76, flx*0.78, flx*0.78, flx*0.78, flx*0.78, flx*0.78, ];
  local wheel_y = [ -fly*0.22, -fly*0.105, fly*0.0, fly*0.105, fly*0.215, fly*0.325, fly*0.436, fly*0.61, fly*0.72 fly*0.83, fly*0.935, fly*0.99, ];
  local wheel_w = [ flw*0.18, flw*0.18, flw*0.18, flw*0.18, flw*0.18, flw*0.18, flw*0.22, flw*0.18, flw*0.18, flw*0.18, flw*0.18, flw*0.18, ];
  local wheel_a = [  80,  80,  80,  80,  150,  150, 255,  150,  150,  80,  80,  80, ];
  local wheel_h = [  flh*0.11,  flh*0.11,  flh*0.11,  flh*0.11,  flh*0.11,  flh*0.11, flh*0.15,  flh*0.11,  flh*0.11,  flh*0.11,  flh*0.11,  flh*0.11, ];
  local wheel_r = [  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ];
local num_arts = 8;


*******************************************************************************************************
*******************************************************************************************************
*******************************************************************************************************

This is based off the coding from the OlRoom themes by omegaman - so all credit to him. This doesn't include my x, y, h, w coordinates for the vertical wheel:

*******************************************************************************************************
*******************************************************************************************************
*******************************************************************************************************

   </ label="Select listbox, wheel, vert_wheel", help="Select wheel art type", options="listbox, wheel, vert_wheel", order=4 /> enable_list_type="vert_wheel";

.
.
.

//listbox
if ( my_config["enable_list_type"] == "listbox" )
{
local sort_listbox = fe.add_listbox( 176, 96, 45, 202 );
sort_listbox.rows = 13;
sort_listbox.charsize = 10;
sort_listbox.set_rgb( 0, 0, 0 );
sort_listbox.format_string = "[SortValue]";
sort_listbox.bg_alpha=255;
sort_listbox.visible = false;

local listbox = fe.add_listbox(flx*0.56, fly*0.12, flw*0.41, flh*0.8 );
listbox.rows = 13;
listbox.charsize = 18;
listbox.set_rgb( 255, 255, 255 );
listbox.bg_alpha = 90;
listbox.align = Align.Left;
listbox.selbg_alpha = 90;
listbox.sel_red = 255;
listbox.sel_green = 255;
listbox.sel_blue = 0;
}

//This enables vertical art instead of default wheel
if ( my_config["enable_list_type"] == "vert_wheel" )
{
fe.load_module( "conveyor" );
local wheel_x = [ flx*0.76, flx*0.76, flx*0.76, flx*0.76, flx*0.76, flx*0.76, flx*0.71, flx*0.76, flx*0.76, flx*0.76, flx*0.76, flx*0.76, ];
local wheel_y = [ -fly*0.22, -fly*0.105, fly*0.0, fly*0.105, fly*0.215, fly*0.325, fly*0.436, fly*0.61, fly*0.72 fly*0.83, fly*0.935, fly*0.99, ];
local wheel_w = [ flw*0.14, flw*0.14, flw*0.14, flw*0.14, flw*0.14, flw*0.14, flw*0.24, flw*0.14, flw*0.14, flw*0.14, flw*0.14, flw*0.14, ];
local wheel_a = [  80,  80,  80,  80,  80,  80, 255,  80,  80,  80,  80,  80, ];
local wheel_h = [  flh*0.08,  flh*0.08,  flh*0.08,  flh*0.08,  flh*0.08,  flh*0.08, flh*0.128,  flh*0.08,  flh*0.08,  flh*0.08,  flh*0.08,  flh*0.08, ];
local wheel_r = [  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ];
local num_arts = 6;

class WheelEntry extends ConveyorSlot
{
   constructor()
   {
      base.constructor( ::fe.add_artwork( my_config["orbit_art"] ) );
   }

   function on_progress( progress, var )
   {
      local p = progress / 0.1;
      local slot = p.tointeger();
      p -= slot;
      
      slot++;

      if ( slot < 0 ) slot=0;
      if ( slot >=10 ) slot=10;

      m_obj.x = wheel_x[slot] + p * ( wheel_x[slot+1] - wheel_x[slot] );
      m_obj.y = wheel_y[slot] + p * ( wheel_y[slot+1] - wheel_y[slot] );
      m_obj.width = wheel_w[slot] + p * ( wheel_w[slot+1] - wheel_w[slot] );
      m_obj.height = wheel_h[slot] + p * ( wheel_h[slot+1] - wheel_h[slot] );
      m_obj.rotation = wheel_r[slot] + p * ( wheel_r[slot+1] - wheel_r[slot] );
      m_obj.alpha = wheel_a[slot] + p * ( wheel_a[slot+1] - wheel_a[slot] );
   }
};

local wheel_entries = [];
for ( local i=0; i<num_arts/2; i++ )
   wheel_entries.push( WheelEntry() );

local remaining = num_arts - wheel_entries.len();

// we do it this way so that the last wheelentry created is the middle one showing the current
// selection (putting it at the top of the draw order)
for ( local i=0; i<remaining; i++ )
   wheel_entries.insert( num_arts/2, WheelEntry() );

local conveyor = Conveyor();
conveyor.set_slots( wheel_entries );
conveyor.transition_ms = 50;
try { conveyor.transition_ms = my_config["transition_ms"].tointeger(); } catch ( e ) { }
}
 
if ( my_config["enable_list_type"] == "wheel" )
{
fe.load_module( "conveyor" );
local wheel_x = [ flx*0.80, flx*0.795, flx*0.756, flx*0.725, flx*0.70, flx*0.68, flx*0.63, flx*0.68, flx*0.70, flx*0.725, flx*0.756, flx*0.76, ];
local wheel_y = [ -fly*0.22, -fly*0.105, fly*0.0, fly*0.105, fly*0.215, fly*0.325, fly*0.436, fly*0.61, fly*0.72 fly*0.83, fly*0.935, fly*0.99, ];
local wheel_w = [ flw*0.18, flw*0.18, flw*0.18, flw*0.18, flw*0.18, flw*0.18, flw*0.28, flw*0.18, flw*0.18, flw*0.18, flw*0.18, flw*0.18, ];
local wheel_a = [  80,  80,  80,  80,  80,  80, 255,  80,  80,  80,  80,  80, ];
local wheel_h = [  flh*0.11,  flh*0.11,  flh*0.11,  flh*0.11,  flh*0.11,  flh*0.11, flh*0.168,  flh*0.11,  flh*0.11,  flh*0.11,  flh*0.11,  flh*0.11, ];
local wheel_r = [  30,  25,  20,  15,  10,   5,   0, -10, -15, -20, -25, -30, ];
local num_arts = 10;

class WheelEntry extends ConveyorSlot
{
   constructor()
   {
      base.constructor( ::fe.add_artwork( my_config["orbit_art"] ) );
   }

   function on_progress( progress, var )
   {
      local p = progress / 0.1;
      local slot = p.tointeger();
      p -= slot;
      
      slot++;

      if ( slot < 0 ) slot=0;
      if ( slot >=10 ) slot=10;

      m_obj.x = wheel_x[slot] + p * ( wheel_x[slot+1] - wheel_x[slot] );
      m_obj.y = wheel_y[slot] + p * ( wheel_y[slot+1] - wheel_y[slot] );
      m_obj.width = wheel_w[slot] + p * ( wheel_w[slot+1] - wheel_w[slot] );
      m_obj.height = wheel_h[slot] + p * ( wheel_h[slot+1] - wheel_h[slot] );
      m_obj.rotation = wheel_r[slot] + p * ( wheel_r[slot+1] - wheel_r[slot] );
      m_obj.alpha = wheel_a[slot] + p * ( wheel_a[slot+1] - wheel_a[slot] );
   }
};

local wheel_entries = [];
for ( local i=0; i<num_arts/2; i++ )
   wheel_entries.push( WheelEntry() );

local remaining = num_arts - wheel_entries.len();

// we do it this way so that the last wheelentry created is the middle one showing the current
// selection (putting it at the top of the draw order)
for ( local i=0; i<remaining; i++ )
wheel_entries.insert( num_arts/2, WheelEntry() );

local conveyor = Conveyor();
conveyor.set_slots( wheel_entries );
conveyor.transition_ms = 50;
try { conveyor.transition_ms = my_config["transition_ms"].tointeger(); } catch ( e ) { }
}


« Last Edit: July 18, 2019, 08:56:02 AM by asahendrix »

Yaron2019

  • Guest
Yaron2019: T H A N K S S S S S S S S A LOT!!!!

My Pleasure. My coding skills are so rusty I could camouflage myself on mars but I will give you my best shot.

Yaron2019

  • Guest

Woohoo! Haha - Thank you so much! And I'd like to take credit, but this project is all Takoni. :)

Right now, all I have is all the x, y, h, w coordinates for the vertical wheel (with a wheel total of 6, that is - I'd have to map out more if someone wanted more than 6 wheel entries). I was wanting to substitute the listbox for the list that Takoni created:


Ok. I will try to make your code work.
It will take a few days maybe.
« Last Edit: July 18, 2019, 09:21:17 AM by Yaron2019 »

asahendrix

  • Full Member
  • ***
  • Posts: 76
    • View Profile

Woohoo! Haha - Thank you so much! And I'd like to take credit, but this project is all Takoni. :)

Right now, all I have is all the x, y, h, w coordinates for the vertical wheel (with a wheel total of 6, that is - I'd have to map out more if someone wanted more than 6 wheel entries). I was wanting to substitute the listbox for the list that Takoni created:


Ok. I will try to make your code work.
It will take a few days maybe.

Thank you!!!