Author Topic: [Solved] I need some help with this, please ...  (Read 5014 times)

bjose2345

  • Sr. Member
  • ****
  • Posts: 107
    • View Profile
[Solved] I need some help with this, please ...
« on: March 01, 2017, 05:29:17 PM »
Thanks for stopping to read my question, to avoid delays I will go straight to the point :

As you can see in the attached picture, i need to know what is the name of the effect where the image is not covered when putting the blue frame on top, any idea where i can start, im trying to search around, but im very new in AM and still there a lot of things i need to learn.

again thanks for your time and stopping by  :D

hmmm.. maybe chaging the set_rgb of the container making it a bit darker in the Transition?  ???
« Last Edit: March 02, 2017, 02:36:39 AM by bjose2345 »

liquid8d

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 442
    • View Profile
Re: I need some help with this, please ...
« Reply #1 on: March 01, 2017, 05:49:40 PM »
I'm not sure what you are asking - do you just want to make the blue frame 'invisible'? You could set the alpha to 0 to make it not visible and set it to 255 to make it visible.

bjose2345

  • Sr. Member
  • ****
  • Posts: 107
    • View Profile
Re: I need some help with this, please ...
« Reply #2 on: March 01, 2017, 06:01:07 PM »
Thanks for the reply liquid8d, and i feel terrible sorry, my english its no the best to be able to explain what I need :'(

What I am looking for is how to put an image always on TOP of any other (in this case the boxart) even if i move the blue frame over it ...

Thanks again for the reply
« Last Edit: March 01, 2017, 06:24:11 PM by bjose2345 »

bjose2345

  • Sr. Member
  • ****
  • Posts: 107
    • View Profile
Re: I need some help with this, please ...
« Reply #3 on: March 01, 2017, 06:38:48 PM »
Ok i think i have it, it has something to do with the zorder property of fe.image class

this could be OK?

m_art= fe.add_artwork( "flyer", 0, 0,width, height );
m_art.zorder.set(9999);

Thanks  ;D

liquid8d

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 442
    • View Profile
Re: I need some help with this, please ...
« Reply #4 on: March 01, 2017, 07:46:19 PM »
No problem! Yes, you can use zorder now I believe also, but just the order you draw your objects will place the last object on top. So create the artwork object, then create the border image, it will be on top :)

bjose2345

  • Sr. Member
  • ****
  • Posts: 107
    • View Profile
Re: I need some help with this, please ...
« Reply #5 on: March 02, 2017, 01:33:34 AM »
Thanks liquid8d, yeah you are right, the zorder doesnt work  :'(

it goes by the draw order, i create first the the artwork object, then later i create the frame image, so the frame its always on top ...

there is a way that i can pass to the conveyor an image in the constructor?

for example im using the grid theme as reference for this...

for ( local i=0; i<rows*cols; i++ )
   my_array.push( MySlot( i ) ); --> here we create the slot tha are show in the conveyor

then i create the frame

gridc.frame=fe.add_image( "frame.png", width , height , width , height );


i can pass later to MySlot class an image? any idea please ...

somehting like (sorry im pretty new with squirrel and I do not know very well the syntax)

foreach(a in my_array)
   a.m_wheels = fe.add_artwork( "flyer", 0, 0, width, height);


thanks again  ;D
« Last Edit: March 02, 2017, 02:09:25 AM by bjose2345 »

verion

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 861
    • View Profile
    • new projects
Re: I need some help with this, please ...
« Reply #6 on: March 02, 2017, 01:54:56 AM »
If you want to put a blue frame on top of game tile without covering the game artwork - simply make that blue frame as transparent PNG image with the cutout (window) so you can see the game artwork through that cutout.

bjose2345

  • Sr. Member
  • ****
  • Posts: 107
    • View Profile
Re: I need some help with this, please ...
« Reply #7 on: March 02, 2017, 02:30:25 AM »
Thanks verion, I already made it work, the cutout window has a problem, not all images follow a default size,

But It worked doing what I said before, after creating the Slot array (im place a surface inside the class) and made a foreach to fill that surface with the fe.add_artwork

here is the code snip

Code: [Select]
for ( local i=0; i<rows*cols; i++ )
my_array.push( MySlot( i ) );  //here we push create the slot class inside the array and draw only the container

gridc.frame=fe.add_image( "frame2.png", width * 2, height * 2, width - 5, fe.layout.height / 3 ); //here we draw the blue frame

foreach(val in my_array){
val.m_wheels = fe.add_artwork( "flyer", 0, 0, width - 8*PAD, height - 24*PAD); // here we fill the container with the flyer or boxart
val.m_wheels.preserve_aspect_ratio = true;
}

many thanks guys, each day i love more coding in AM  ;D
« Last Edit: March 02, 2017, 02:35:56 AM by bjose2345 »

liquid8d

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 442
    • View Profile
Re: [Solved] I need some help with this, please ...
« Reply #8 on: March 02, 2017, 04:32:22 PM »
I know zorder was added more recently, but I think it should work - I just haven't messed with it.

Hey FYI, if the images are different sizes, you can try using the PreserveArt module, which can fill the space and preserve the aspect.. which can work nicely for flyers and boxart and such..

bjose2345

  • Sr. Member
  • ****
  • Posts: 107
    • View Profile
Re: [Solved] I need some help with this, please ...
« Reply #9 on: March 03, 2017, 10:03:45 AM »
Thanks liquid8d, in this particular case doesnt work for me (the zorder) maybe it work in another situation and yes preserve_aspect_ratio its pretty awesome.