Page 1 of 1

Slideshow

Posted: Sun Sep 24, 2017 3:53 pm
by rbytes
I had an idea about creating a dynamic slideshow. The wipes are working as programmed. Unfortunately they are too jittery to be effective. But if they worked smoothly, it would look great. The screenshots show the halfway points of the wipes, as one image stretches horizontally while the other is squashed.

Mr. K, any suggestions?

Code: Select all

''
Slideshow by rbytes
September 2017
''

#.scrview(#.normal)
x,y = #.scrsize()
marg = 140
i = #.image  ' image template
i.width = 1000
i.height = 750
i.x = marg
i.y = 20
i.stretch = 1
a = i
a.source = "Jen trike by Mira.jpg"
b = i
b.source = "Miss P.jpg"
#.delay(1)
#.show(a)
#.scroff()

' slide 1 expand from left
> t,1..1000,2
  a.width = t
  #.scr()
<
#.delay(1)

' slide 2 expand from right, squashing slide 1 off
#.show(b)
> t,1..1000,2
  a.width = 1000 - t
  b.width = t
  b.x = 1000 + marg - t
  #.scr()
<
#.delay(1)

' slide 3 expand from left, squashing slide 2 off
a.source = "Elbow.jpg"
> t,1..1000,2
  ? a.width = 500, #.delay(5)
  b.width = 1000 - t
  b.x = marg + t
  a.width = t
  #.scr()
<

#.delay(5)

Re: Slideshow

Posted: Sun Sep 24, 2017 5:16 pm
by Mr. Kibernetik
Very good test. In version 0.0.20 flickering will be removed.
I will publish version 0.0.20 right now.

Also, when using #.image objects there is no need to update screen using #.scr function, because #.image interface objects are not graphics objects and they are not affected or updated by graphics functions.

Also,

Code: Select all

? a.width = 500, #.delay(5)
should never happen because a.width is never 500 because a.width = t and t is 1,3,5,...

Re: Slideshow

Posted: Sun Sep 24, 2017 6:15 pm
by rbytes
You have solved that mystery for me. :?

Re: Slideshow

Posted: Sun Sep 24, 2017 6:28 pm
by rbytes
I just ran the corrected script with version 20. The flickering is gone, but the speed is quite reduced. I don't think it is a practical way to create screen transitions. I will likely have to wait for sprites to get that kind of drawing speed.

Re: Slideshow

Posted: Sun Sep 24, 2017 6:42 pm
by Mr. Kibernetik
Well, #.image object is for static image display. But you can make images smaller (in pixels) to get better speed.
If photos are, say, 3000x2000 pixels their fast changes can be slow. But if they are, say, 800x800 pixels their changes can be much faster.

Re: Slideshow

Posted: Sun Sep 24, 2017 7:11 pm
by rbytes
I will think about where to best use that idea.