Author Topic: Continuous sliding image like as SNES Mini background  (Read 4981 times)

kent79

  • Hero Member
  • *****
  • Posts: 842
    • View Profile
Continuous sliding image like as SNES Mini background
« on: October 09, 2017, 04:38:23 PM »
Dear All,

Anyone know how to make a continuous sliding image like as SNES Mini background. Thanks. 

https://www.youtube.com/watch?v=roo077srwOk

 :)
« Last Edit: October 09, 2017, 06:46:02 PM by kent79 »

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1167
    • View Profile
Re: Continuous sliding image like as SNES Mini background
« Reply #1 on: October 09, 2017, 07:31:11 PM »
I am sure there is more than one way to do this.

My approach would be to use an app to take your image, animate it, and export it as a movie file. Photoshop can create animated gifs, but I think it can also export as quicktime movie. Move one object off the screen while having a duplicate layer replace the others position.

kent79

  • Hero Member
  • *****
  • Posts: 842
    • View Profile
Re: Continuous sliding image like as SNES Mini background
« Reply #2 on: October 09, 2017, 08:00:34 PM »
I am sure there is more than one way to do this.

My approach would be to use an app to take your image, animate it, and export it as a movie file. Photoshop can create animated gifs, but I think it can also export as quicktime movie. Move one object off the screen while having a duplicate layer replace the others position.

Make a movie or gif file is not the best way. I expect using a code. I can see "Mugen" system can do it. So, hope someone expert to write a module to do it.  :)   

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1167
    • View Profile
Re: Continuous sliding image like as SNES Mini background
« Reply #3 on: October 09, 2017, 08:16:09 PM »
I am sure there is more than one way to do this.

My approach would be to use an app to take your image, animate it, and export it as a movie file. Photoshop can create animated gifs, but I think it can also export as quicktime movie. Move one object off the screen while having a duplicate layer replace the others position.

Make a movie or gif file is not the best way. I expect using a code. I can see "Mugen" system can do it. So, hope someone expert to write a module to do it.  :)   

I didn't say it was the best way. The amount of time it would take *myself* to have code/animation do this would be a lot. The same effect could be had in minutes by making a movie file. Might be quicker to code for some one really familiar with animations in attractmode. I assume you would need an object, duplicate it, and have both animating. When one finished it repositions and starts animating again.

BadFurDay

  • Full Member
  • ***
  • Posts: 82
    • View Profile
Re: Continuous sliding image like as SNES Mini background
« Reply #4 on: October 10, 2017, 03:09:06 AM »
A lot of robospin themes I've played about with had a panscan option in them, just copy the code and put the image you want to scan in the layout folder as "flyer.png" that or change the name in the code:

local bgart = PanAndScanArt( "flyer", 0, 0, flw, flh);
bgart.trigger = Transition.EndNavigation;
bgart.preserve_aspect_ratio = false;
bgart.set_fit_or_fill("fill");
bgart.set_anchor(::Anchor.Center);
bgart.set_zoom(4.5, 0.00008);
bgart.set_animate(::AnimateType.Bounce, 0.50, 0.50)
bgart.set_randomize_on_transition(true);
bgart.set_start_scale(1.1);
 local alpha_cfg = {
    when = Transition.ToNewSelection,
    property = "alpha",
    start = 0,
    end = 200,
    time = 3000
}
animation.add( PropertyAnimation( bgart, alpha_cfg ) );

kent79

  • Hero Member
  • *****
  • Posts: 842
    • View Profile
Re: Continuous sliding image like as SNES Mini background
« Reply #5 on: October 10, 2017, 06:52:46 AM »
Below is code, it can do it, but it is some lag (low performance) when navigating system or game.

I don't know exactly reason. The issue does not related of machine hardware. I suspect that it is AM animation function issue. It may be not optimized  :-[

https://youtu.be/aNulntecNx4

Code: [Select]
local bgArt = fe.add_image("bg.jpg", 0, 0, 1280, 720 );
local bgArt2 = fe.add_image("bg.jpg", 0, 0, 1280, 720 );

local move_bgArt1 = {
    when = Transition.ToNewList, property = "x", start = 0, end = -1280, time = 24000, loop=true
 }

local move_bgArt2 = {
    when = Transition.ToNewList, property = "x", start = 1280, end = 0, time = 24000, loop=true
 }

animation.add( PropertyAnimation( bgArt, move_bgArt1 ) );
animation.add( PropertyAnimation( bgArt2, move_bgArt2 ) );

« Last Edit: October 10, 2017, 08:35:42 AM by kent79 »

qqplayer

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
Re: Continuous sliding image like as SNES Mini background
« Reply #6 on: October 11, 2017, 05:58:42 AM »
Below is code, it can do it, but it is some lag (low performance) when navigating system or game.

I don't know exactly reason. The issue does not related of machine hardware. I suspect that it is AM animation function issue. It may be not optimized  :-[

https://youtu.be/aNulntecNx4

Code: [Select]
local bgArt = fe.add_image("bg.jpg", 0, 0, 1280, 720 );
local bgArt2 = fe.add_image("bg.jpg", 0, 0, 1280, 720 );

local move_bgArt1 = {
    when = Transition.ToNewList, property = "x", start = 0, end = -1280, time = 24000, loop=true
 }

local move_bgArt2 = {
    when = Transition.ToNewList, property = "x", start = 1280, end = 0, time = 24000, loop=true
 }

animation.add( PropertyAnimation( bgArt, move_bgArt1 ) );
animation.add( PropertyAnimation( bgArt2, move_bgArt2 ) );

Sometimes I just position the object outside the layout and move then into it "when = Start.Layout,"
I think I have some example on my MachiRoomNesScroll Layout.
Or just adding a little alpha transition.

Code: [Select]
local title_alpha_cfg_on_load = {
    when = When.StartLayout,
    property = "alpha",
    start = 0,
    end = 255,
    time = 1000
}

animation.add( PropertyAnimation( title, title_alpha_cfg_on_load ) );

Maybe this can help.

kent79

  • Hero Member
  • *****
  • Posts: 842
    • View Profile
Re: Continuous sliding image like as SNES Mini background
« Reply #7 on: October 12, 2017, 06:53:30 AM »
Thank you qqplayer reply, but not working. Anyway, I will release a new version of Grid Pro Theme soon. You may try to update. Thanks.  :)

caminiti45

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Continuous sliding image like as SNES Mini background
« Reply #8 on: October 15, 2017, 04:49:15 PM »
no luck getting these scripts to work either :/ I have a theme or background image that is just small borders at the top and bottom and transparent in the middle. All I get is black in the transparent area of the theme. Any suggestions?