Page 1 of 1

How to use Moviesetter plugin

Posted: Thu Apr 07, 2022 8:21 am
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

Re: How to use Moviesetter plugin

Posted: Thu Apr 07, 2022 5:47 pm
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

Re: How to use Moviesetter plugin

Posted: Fri Apr 08, 2022 8:32 am
by matty47
Thanks for the quick response. I knew it would be something simple that I had overlooked.