How to use Moviesetter plugin

Discuss about plugins that don't have a dedicated forum
Post Reply
matty47
Posts: 18
Joined: Fri May 21, 2021 10:28 am

How to use Moviesetter plugin

Post by matty47 »

I cannot figure out how to use the Moviesetter plugin. Could not find a help file or example so have used an example from the RapaGUI help manual - an animation player.

Code: Select all

@REQUIRE "RapaGUI"
@REQUIRE "moviesetter"

@ANIM 1, "Pogo",{Loader = "moviesetter|inbuilt"}
@DISPLAY {Width = 320, Height = 200}

Function p_AnimFunc()
	Local numframes = GetAttribute(#ANIM, 1, #ATTRNUMFRAMES)
	curframe = Wrap(curframe +1 , 1, numframes +1)
	DisplayAnimFrame(1,0,0,curframe)
EndFunction

Function p_EventFunc(msg)
	Switch msg.Class
	Case "Button":
		Switch msg.Attribute
		Case "Pressed":
			Switch msg.ID
			Case "play":
				SetInterval(1,p_AnimFunc,50)
			Case "stop":
				ClearInterval(1)
			EndSwitch
		EndSwitch
	EndSwitch
EndFunction

InstallEventHandler({RapaGUI = p_EventFunc})
moai.CreateApp(FileToString("GUI.xml"))

Repeat
	WaitEvent
Forever
This is my code. The "Pogo" file is in the same dir as the source and has been extracted from the archive (generously) provided by airsoftwair.
When trying to run the code I get an

Code: Select all

Error in line 4 (AnimViewer.hws): Animation file "Pogo" is in an unknown/unsupported format!
error so obviously I'm doing something wrong. The xml file worked fine when loading a .anim file. I am on Win11 64 bit using 64 bit plugin.
Thanks for any guidance
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: How to use Moviesetter plugin

Post by airsoftsoftwair »

Since Moviesetter files contain graphics and audio, you can't load them with the @ANIM preprocessor command. You need to load them as videos using @VIDEO or OpenVideo() etc., e.g.

Code: Select all

OpenVideo(1, "pogo")
PlayVideo(1, 0, 0)
WaitLeftMouse
matty47
Posts: 18
Joined: Fri May 21, 2021 10:28 am

Re: How to use Moviesetter plugin

Post by matty47 »

Thanks for the quick response. I knew it would be something simple that I had overlooked.
Post Reply