XWidgetSoft Forum
https://www.bbs.xwidget.com/

Animated record player
https://www.bbs.xwidget.com/viewtopic.php?f=8&t=5646
Page 1 of 1

Author:  djpete1959 [ April 24th, 2015, 9:18 pm ]
Post subject:  Animated record player

I have animated my record player with a small bit of animated gif. Pretty proud of myself. But is it possible to have a switch on the turntable that would stop/start the animation. That would be real cool.
:-)

Author:  djpete1959 [ April 24th, 2015, 10:19 pm ]
Post subject:  Re: Animated record player

here is a bad quality video of my record player. lol
https://youtu.be/37qvlQiAu_4

Author:  Jimking [ April 26th, 2015, 2:20 am ]
Post subject:  Re: Animated record player

I have no time to test it but try if this script works:
Quote:
function playercontrolcore1OnUpdate(Sender)
{
if(playercontrolcore1.get("%IsPlaying")=="true")
{
disc.Play=1
}
else
{
disc.Play=0
}
}


This script is a copy from other widget, so you will need to match it with yours. The "disc" should be replaced with the name of your gif file. And don't forget to assign the tag to playercontrolcore1-OnUpdate.

Author:  djpete1959 [ April 26th, 2015, 4:58 am ]
Post subject:  Re: Animated record player

went into editor hit widget and added this code
function playercontrolcore1OnUpdate(Sender)
{
if(playercontrolcore1.get("%IsPlaying")=="true")
{
gif1.Play=1
}
else
{
gif1.Play=0
}
}

But doesn't stop unfortunately.
Did I place it in the right spot. There was no other code there.
It did highlight the right gif, so that looked correct

Author:  Jimking [ April 26th, 2015, 5:07 am ]
Post subject:  Re: Animated record player

Attach your widget here... (.xwp)

Author:  djpete1959 [ April 26th, 2015, 5:21 am ]
Post subject:  Re: Animated record player

Appreciated

Attachments:
turntable(1).xwp [1.39 MiB]
Downloaded 359 times

Author:  Dagedee [ April 26th, 2015, 9:52 am ]
Post subject:  Re: Animated record player

Hi,
I think you have to do this:
1. bind the .gif-image to the playercontrolcore
2. "activate" the playercontrolecore (to use script) by double clicking into the white editing box
3. change this line of script from:
if(playercontrolcore1.get("%IsPlaying")=="true") to:
if(playercontrolcore1.isplaying)

For me it works well now.

Attachment:
binding_core.jpg
binding_core.jpg [ 430.64 KiB | Viewed 13743 times ]
Attachment:
playercontrolcore.jpg
playercontrolcore.jpg [ 189.4 KiB | Viewed 13743 times ]

Attachment:
turntable_update.rar [1.29 MiB]
Downloaded 464 times

Author:  djpete1959 [ April 26th, 2015, 2:36 pm ]
Post subject:  Re: Animated record player

Many thank Dagedee!!!
Works perfectly!!
What can't Xwidget do?
:-)
:-)
Ripper, thanks all for the help and time.

If anyone wants to finish this widget properly and post for others, please do.
Maybe credit me for the idea only?
Also I stole the image from the internet so not sure how that goes for copyright.
:-(

Author:  djpete1959 [ April 26th, 2015, 7:38 pm ]
Post subject:  Re: Animated record player

so why cant I get this to do the same thing?
It doesn't stop animating..

Attachments:
old_school_record_player.xwp [947.71 KiB]
Downloaded 421 times

Author:  Jimking [ April 27th, 2015, 4:16 am ]
Post subject:  Re: Animated record player

Nice BUT be careful at the CPU usage of the animated widgets.. To check it, after press "Debug" to test the widget, open the pc task manager and check the "xwtest.exe" and "XWDesigner.exe" to see the cpu %.
Good widgets must give 0~2% cpu...

Author:  djpete1959 [ April 27th, 2015, 5:34 am ]
Post subject:  Re: Animated record player

I went mad. Will upload a youtube video. Lol. And you're right when I have everything switched on it's a bit of a hog. Vid uploading now but in a long queue

Author:  djpete1959 [ April 27th, 2015, 5:54 am ]
Post subject:  Re: Animated record player

https://www.youtube.com/watch?v=-I22kMQPVeY

Author:  Jimking [ April 27th, 2015, 9:06 am ]
Post subject:  Re: Animated record player

Hey! What is this "Dancing little girl"..? :D
It's cool.

Author:  djpete1959 [ April 27th, 2015, 1:30 pm ]
Post subject:  Re: Animated record player

It's just another animated gif. :-)

Author:  digigamer [ May 11th, 2015, 1:15 am ]
Post subject:  Re: Animated record player

Cool!!
You could always PNGAnimate for high quality animations (look out for size!!)

Author:  djpete1959 [ May 11th, 2015, 3:28 am ]
Post subject:  Re: Animated record player

It works ok on cpu with everything running but there is a little load.
I would not know how to make a png animate. This was all made from ani gifs I found and it the platters case just cropped it to suit.

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/