Author Topic: [SOLVED] How to Put a generic images if its not find in artwork.  (Read 126 times)

wildpumpk1n

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Hello guys,

I come to you to find some help.

I made a layout with image, snap, etc and a conveyor wheel with images.

I used flyer of the games as images and it works no problem.

I would like to put a generic flyer for the games who missing it.

I did this :
Code: [Select]
if ( my_config["enable_flyer"] == "yes" )
{
local my_strip = SimpleArtStrip( "flyer", 5, 0, fe.layout.height/1.37, fe.layout.width/1, fe.layout.height/4.6, 5 );
}
 else
 {
 local clogos = fe.add_image("Splashscreen_lite.png", 0, fly*0.708, flw, flh*0.02 );
 clogos.trigger = Transition.EndNavigation;
 }

If you have any idea whats wrong with my code it could be awesome :)

Regards,
Wild.
« Last Edit: April 11, 2019, 02:37:47 AM by wildpumpk1n »

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 863
    • View Profile
Re: How to Put a generic images if its not find in artwork.
« Reply #1 on: April 10, 2019, 11:20:13 AM »
You are using an if statement referencing a config option. I think that is why you dont see it. You could try adding an image to your snap path called snap.png?

wildpumpk1n

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: How to Put a generic images if its not find in artwork.
« Reply #2 on: April 10, 2019, 01:46:36 PM »
You are using an if statement referencing a config option. I think that is why you dont see it. You could try adding an image to your snap path called snap.png?

Hey, thanks for your answer.

Maybe if i put all the part code it could be more easy to understand

Code: [Select]
class SimpleArtStrip extends Conveyor
{
   m_x=0; m_y=0; m_width=0; m_height=0; m_x_span=0; m_y_span=0;

   constructor( artwork_label, num_objs, x, y, width, height, pad=0 )
   {
      base.constructor();
      local my_list = [];
      for ( local i=0; i<num_objs; i++ )
         my_list.push( SimpleArtStripSlot(this,artwork_label) );
      set_slots( my_list );

      m_x=x+pad/2; m_y=y+pad/2;
      if ( width < height )
      {
         m_x_span=0;
         m_y_span=height;
         m_width=width-pad;
         m_height=height/m_objs.len()-pad;
      }
      else
      {
         m_x_span=width;
         m_y_span=0;
         m_width=width/m_objs.len()-pad;
         m_height=height-pad;
      }

      reset_progress();
   }
};


if ( my_config["enable_flyer"] == "yes" )
{
local my_strip = SimpleArtStrip( "flyer", 5, 0, fe.layout.height/1.37, fe.layout.width/1, fe.layout.height/4.6, 5 );
}
 else
 {
local my_strip = fe.add_artwork("snap.png", 0, fe.layout.height/1.37, fe.layout.width/1, fe.layout.height/4.6 );
}

But maybe its not the best way to do that.
I just copy and arrange some code i found, i'm not a dev' to be specific.


keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 863
    • View Profile
Re: How to Put a generic images if its not find in artwork.
« Reply #3 on: April 10, 2019, 03:43:38 PM »
Are you trying to use the class with snap.png as a param? Check your if statement.

jedione

  • Hero Member
  • *****
  • Posts: 631
  • punktoe
    • View Profile
Re: How to Put a generic images if its not find in artwork.
« Reply #4 on: April 10, 2019, 08:36:13 PM »
simply put just drop your .png  .jpg  in the layout file
and call them what they are ie: snap,  marquee, video,  ext...
help a friend....

wildpumpk1n

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: How to Put a generic images if its not find in artwork.
« Reply #5 on: April 11, 2019, 12:40:36 AM »
Are you trying to use the class with snap.png as a param? Check your if statement.

simply put just drop your .png  .jpg  in the layout file
and call them what they are ie: snap,  marquee, video,  ext...

Thanks to you guys... I complicated the thing and it was just under my eyes :D
Thanks again, just put a flyer.png in layout folder and remove all my mess.