A simple program needed, please.

Find quick help here to get you started with Hollywood
Jan
Posts: 26
Joined: Sun Sep 17, 2017 10:28 am
Location: Slovakia
Contact:

A simple program needed, please.

Post by Jan »

Hello Hollywood users/programmers!

I am looking for someone willing to create a simple Hollywood program for my new AmiKit 12. It's a very simple program and I believe I could manage it by myself, but I would rather invest my time and energy into AmiKit itself rather than learning Hollywood, you know.

The program should open a window on Amiga desktop, display a short video, and then around 5-6 static images moving back and forth on mouse click, until the window is closed by the user.

Thank you!
Jan
Jan
Posts: 26
Joined: Sun Sep 17, 2017 10:28 am
Location: Slovakia
Contact:

Re: A simple program needed, please.

Post by Jan »

Btw. to make it clear I have all the graphics, I just need the script.
plouf
Posts: 467
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: A simple program needed, please.

Post by plouf »

the basic of waht you want is somethink like this

Code: Select all

; LOAD AND PLAY INTRO VIDEO
OpenVideo(1, "intro.CDXL")
SetVideoSize(1,640,480)
PlayVideo(1)

While IsVideoPlaying(1)	
	Wait(1)
Wend
CloseVideo(1)

;LOAD FIRST IMAGE
LoadBrush(1,"img.png")
DisplayBrush(1, 0, 0, {Width = 640, Height = 480})

Wait(200)

;SECOND 
LoadBrush(2,"img2.png")
DisplayBrush(2, 0, 0, {Width = 640, Height = 480})

; NOW WAIT MOUSE CLICK
Repeat
WaitEvent 
Until 1
Christos
Jan
Posts: 26
Joined: Sun Sep 17, 2017 10:28 am
Location: Slovakia
Contact:

Re: A simple program needed, please.

Post by Jan »

Ooo, thank you Christos for your fast reply. I will try that out!
Jan
Posts: 26
Joined: Sun Sep 17, 2017 10:28 am
Location: Slovakia
Contact:

Re: A simple program needed, please.

Post by Jan »

Hey Christos, now I have this and it's working fine. Thanks! :D
Now, if the last image is shown, how I can loop it so the first image is shown again?
Also, a "click" sound would be nice if mouse button is pressed. Can you advise?

Btw. greetings to Athens, I just got back from there there yesterday. Beautiful! 8-)

Code: Select all

@DISPLAY {Width = 960, Height = 540, Color = #WHITE, Borderless = False, Title = "Welcome to AmiKit 12"}
@REQUIRE "avcodec", {Link = True}

; LOAD AND PLAY INTRO VIDEO
OpenVideo(1, "intro.mov")
SetVideoSize(1,960,540)
PlayVideo(1)

While IsVideoPlaying(1)	
	Wait(1)
Wend
CloseVideo(1)

;LOAD FIRST IMAGE
LoadBrush(1,"img1.png")
DisplayBrush(1, 0, 0, {Width = 960, Height = 540})

; NOW WAIT FOR LEFT MOUSE CLICK
Repeat
  Wait(2)
Until IsLeftMouse() = True

;SECOND 
LoadBrush(2,"img2.png")
DisplayBrush(2, 0, 0, {Width = 960, Height = 540})

; NOW WAIT FOR LEFT MOUSE CLICK
Repeat
  Wait(2)
Until IsLeftMouse() = True

;THIRD 
LoadBrush(3,"img3.png")
DisplayBrush(3, 0, 0, {Width = 960, Height = 540})

; NOW WAIT FOR LEFT MOUSE CLICK
Repeat
  Wait(2)
Until IsLeftMouse() = True

;FOURRTH 
LoadBrush(4,"img4.png")
DisplayBrush(4, 0, 0, {Width = 960, Height = 540})

; NOW WAIT FOR LEFT MOUSE CLICK
Repeat
  Wait(2)
Until IsLeftMouse() = True

;FIFTH 
LoadBrush(5,"img5.png")
DisplayBrush(5, 0, 0, {Width = 960, Height = 540})

; NOW WAIT FOR LEFT MOUSE CLICK
Repeat
  Wait(2)
Until IsLeftMouse() = True

;SIXT 
LoadBrush(6,"img6.png")
DisplayBrush(6, 0, 0, {Width = 960, Height = 540})

; NOW WAIT FOR LEFT MOUSE CLICK
Repeat
  Wait(2)
Until IsLeftMouse() = True
Jan
Posts: 26
Joined: Sun Sep 17, 2017 10:28 am
Location: Slovakia
Contact:

Re: A simple program needed, please.

Post by Jan »

Okay, I got it! :D
If I would like to make it really neat, how to slide the new images from right to left?
Thank you in advance.

Code: Select all

@DISPLAY {Width = 960, Height = 540, Color = #WHITE, Borderless = False, Title = "Welcome to AmiKit 12"}
@REQUIRE "avcodec", {Link = True}

; LOAD AND PLAY INTRO VIDEO
OpenVideo(1, "intro.mov")
SetVideoSize(1,960,540)
PlayVideo(1)

While IsVideoPlaying(1)	
	Wait(1)
Wend
CloseVideo(1)


; LOAD AND PLAY INTRO VIDEO
LoadSample(1, "click.aiff")

Repeat

;LOAD FIRST IMAGE
LoadBrush(1,"img1.png")
DisplayBrush(1, 0, 0, {Width = 960, Height = 540})

WaitLeftMouse
PlaySample(1)
Repeat
  Wait(2)
Until IsSamplePlaying(1) = False

;SECOND 
LoadBrush(2,"img2.png")
DisplayBrush(2, 0, 0, {Width = 960, Height = 540})

WaitLeftMouse
PlaySample(1)
Repeat
  Wait(2)
Until IsSamplePlaying(1) = False

;THIRD 
LoadBrush(3,"img3.png")
DisplayBrush(3, 0, 0, {Width = 960, Height = 540})

WaitLeftMouse
PlaySample(1)
Repeat
  Wait(2)
Until IsSamplePlaying(1) = False

;FOURTH 
LoadBrush(4,"img4.png")
DisplayBrush(4, 0, 0, {Width = 960, Height = 540})

WaitLeftMouse
PlaySample(1)
Repeat
  Wait(2)
Until IsSamplePlaying(1) = False

;FIFTH 
LoadBrush(5,"img5.png")
DisplayBrush(5, 0, 0, {Width = 960, Height = 540})

WaitLeftMouse
PlaySample(1)
Repeat
  Wait(2)
Until IsSamplePlaying(1) = False

;SIXT 
LoadBrush(6,"img6.png")
DisplayBrush(6, 0, 0, {Width = 960, Height = 540})

WaitLeftMouse
PlaySample(1)
Repeat
  Wait(2)
Until IsSamplePlaying(1) = False

Forever
Bugala
Posts: 1178
Joined: Sun Feb 14, 2010 7:11 pm

Re: A simple program needed, please.

Post by Bugala »

You can change DisplayBrush into DisplayBrushFX(), that one gives you options like making it come from right:
[codeDisplayBrushFX(id, x, y, {type=#REVEALRIGHT, speed=1})][/code]

for speed you can, instead of using number, also use: #SLOWSPEED, #NORMALSPEED, #FASTSPEED

I am not sure #REVEALRIGHT actually means coming from right (I actually think it is not), but here is full list of possible effects:

#RANDOMEFFECT

– Horizontal stripes: #HSTRIPES2, #HSTRIPES4, #HSTRIPES16, #HSTRIPES32
– Vertical stripes: #VSTRIPES2, #VSTRIPES8, #VSTRIPES16, #VSTRIPES32
– Fast horizontal blinds: #HBLINDS8, #HBLINDS16, #HBLINDS32, #HBLINDS64, #HBLINDS128
– Fast vertical blinds: #VBBLINDS8, #VBLINDS16, #VBLINDS32, #VBLINDS64, #VBLINDS128
– Horizontal curtain: #HOPENCURTAIN, #HCLOSECURTAIN
– Vertical curtain: #VOPENCURTAIN, #VCLOSECURTAIN
– Horizontal lines: #HLINES, #HLINES2
– Vertical lines: #VLINES, #VLINES2
– Reveal: #REVEALLEFT, #REVEALRIGHT, #REVEALTOP, #REVEALBOTTOM
– Bars: #BARS
– Quarters: #QUARTERS
– Crossfade: #CROSSFADE
– Fade: #FADE; optional argument specifies color to use
– Blend: #BLEND; optional argument specifies color to use for blending
Starting with Hollywood 1.5 there are some new effects:


– Rectangle zoom in: #RECTCENTER, #RECTNORTH, #RECTNORTHEAST, #RECTEAST, #RECTSOUTHEAST, #RECTSOUTH, #RECTSOUTHWEST, #RECTWEST, #RECTNORTHWEST
– Rectangle zoom out: #RECTBACKCENTER, #RECTBACKNORTH, #RECTBACKNORTHEAST, #RECTBACKEAST, #RECTBACKSOUTHEAST, #RECTBACKSOUTH, #RECTBACKSOUTHWEST, #RECTBACKWEST, #RECTBACKNORTHWEST
– Scroll in: #SCROLLLEFT, #SCROLLRIGHT, #SCROLLTOP, #SCROLLBOTTOM (optional argument specifies a special effect to apply to the scroll process, you can use the same effects here like in MoveBrush())
– Stretch image in: #STRETCHLEFT, #STRETCHRIGHT, #STRETCHTOP, #STRETCHBOTTOM, #HSTRETCHCENTER, #VSTRETCHCENTER
– Zoom image in: #ZOOMCENTER, #ZOOMNORTH, #ZOOMNORTHEAST, #ZOOMEAST, #ZOOMSOUTHEAST, #ZOOMSOUTH, #ZOOMSOUTHWEST, #ZOOMWEST, #ZOOMNORTHWEST
– Flow: #HFLOWTOP, #HFLOWBOTTOM, #VFLOWLEFT, #VFLOWRIGHT
– Gates: #HOPENGATE, #HCLOSEGATE, #VOPENGATE, #VCLOSEGATE (B)
– Pushes: #PUSHLEFT, #PUSHRIGHT, #PUSHTOP, #PUSHBOTTOM (B)
– Puzzle: #PUZZLE
– Diagonal: #DIAGONAL
– Roll on: #ROLLTOP
– Wallpaper: #WALLPAPERTOP
– General vertical stripes: #VSTRIPES; optional argument specifies the number of stripes to display
– General horizontal stripes: #HSTRIPES; optional argument specifies the number of stripes to display
Starting with Hollywood 1.9 there are a number of new effects:


– Scroll image in: #SCROLLNORTHEAST, #SCROLLSOUTHEAST, #SCROLLSOUTHWEST, #SCROLLNORTHWEST (optional argument specifies a special effect to apply to the scroll process, you can use the same effects here like in MoveBrush())
– Reveal clock wise: #CLOCKWIPE
– Star zoom in: #STAR
– Strange pushes: #HSTRANGEPUSH, #VSTRANGEPUSH (B)
– Slide projector: #SLIDELEFT, #SLIDERIGHT, #SLIDETOP, #SLIDEBOTTOM (B)
– Spiral reveal: #SPIRAL
– Swiss cross effect: #SWISS
– Quad rectangles: #QUADRECT
– Split effects: #HSPLIT, #VSPLIT
– Up'n'down: #UPNDOWN
– Register card effect: #CARDTOP, #CARDBOTTOM (B)
– Sun zoom in: #SUN
– Water ripples: #WATER1, #WATER2, #WATER3, #WATER4 (!)
– Strudel effect: #STRUDEL (!)
– Dissolve picture: #DISSOLVE
– Zoom to pixels: #PIXELZOOM1
– Zoom to pixels 2: #PIXELZOOM2 (B)
– Large zoom effects: #ZOOMIN, #ZOOMOUT (B)
– Crush effects: #CRUSHLEFT, #CRUSHRIGHT, #CRUSHTOP, #CRUSHBOTTOM (B)
– Flip coins: #VFLIPCOIN, #VLOWFLIPCOIN, #HFLIPCOIN, #HLOWFLIPCOIN (B)
– Turn down picture effect: #TURNDOWNTOP, #TURNDOWNBOTTOM, #TURNDOWNLEFT, #TURNDOWNRIGHT (B)
– Type writer effect: #TYPEWRITER (T) [no longer supported since V3.1]
– Wallpaper: #WALLPAPERLEFT (!)
– Roll on: #ROLLLEFT


Then there is also option of using MoveBrush():

MoveBrush(id, xa, ya, xb, by, {speed=10])

Speed:
Defines the number of pixels that the brush will be moved per draw. Therefore a higher number means higher speed. You can also specify a constant for the speed argument (#SLOWSPEED, #NORMALSPEED or #FASTSPEED).

FX:
Specifies a special effect that shall be applied to the move. The following effects are currently possible:

#BOUNCE:
Bounces the object at move end

#DAMPED:
Damps the object at move end

#SMOOTHOUT:
Decreases object move speed towards the move end

#SINE:
Displays the object on a sine wave (*)

#BIGSINE:
Displays the object on a big sine wave (*)

#LOWERCURVE:
Moves the object on a curve below the move line (*)

#UPPERCURVE:
Moves the object on a curve above the move line (*)
Effects marked with an asterisk are only possible with horizontal moves, which means that ya and yb coordinates must be equal!




Or MoveLayer():
MoveLayer(id, xa, ya, xb, yb[, table])
MoveLayer(id, x, y)

MoveLayer(5, #LEFTOUT, #CENTER, #RIGHTOUT, #CENTER)
MoveLayer(4, #USELAYERPOSITION, #USELAYERPOSITION, #LEFTOUT, #CENTER)
MoveLayer(5, #CENTER, #CENTER)
Jan
Posts: 26
Joined: Sun Sep 17, 2017 10:28 am
Location: Slovakia
Contact:

Re: A simple program needed, please.

Post by Jan »

Wow, so many options! Thank you, Bugala, for your detailed answer. I will try it out.
User avatar
Juan Carlos
Posts: 887
Joined: Mon Sep 06, 2010 1:02 pm

Re: A simple program needed, please.

Post by Juan Carlos »

You must think that some visual effects are slow with a 680xx CPU, even with a fast emulation, also you don't forget add the command @REQUIRE for the plugins format in the case to use videos.
Other important point the Layers also will run slow with the 680xx CPU and some visual effects will be impossible to wait the time to show.
plouf
Posts: 467
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: A simple program needed, please.

Post by plouf »

dont forget that AmiKit by definition runs in modern usually 4/8cores x64 computers....

@jan ... you visit Athens at WRONG time.. the CORRECT time to visit us will be 25-26 feb where Amiga meeting willl take place -> https://amicamp.gr/ ;-)
Christos
Post Reply