Slideshow

Post Reply
User avatar
rbytes
Posts: 1338
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Slideshow

Post 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)
Attachments
Screenshot (62).png
Screenshot (62).png (3.76 MiB) Viewed 3397 times
Screenshot (63).png
Screenshot (63).png (3.74 MiB) Viewed 3397 times
The only thing that gets me down is gravity...

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Slideshow

Post 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,...

User avatar
rbytes
Posts: 1338
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: Slideshow

Post by rbytes »

You have solved that mystery for me. :?
The only thing that gets me down is gravity...

User avatar
rbytes
Posts: 1338
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: Slideshow

Post 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.
The only thing that gets me down is gravity...

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Slideshow

Post 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.

User avatar
rbytes
Posts: 1338
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: Slideshow

Post by rbytes »

I will think about where to best use that idea.
The only thing that gets me down is gravity...

Post Reply