XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently May 10th, 2025, 8:54 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 24 posts ] 
Author Message
PostPosted: July 10th, 2014, 1:48 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
I have 9 pngs water drop images, and I would like to make a "swim" full screen widget.
QUESTIONS:
1) Is possible using the "swim" widget's optionto make the drops going only from up to down and in a steady vertical position like in real life..?
2) Can we combine all the 9 images so they will appear randomly..?

Thank you!


Attachments:
drops.zip [34.62 KiB]
Downloaded 346 times

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/
Top
 Profile  
 
PostPosted: July 10th, 2014, 2:22 am 
Offline
User avatar

Joined: March 8th, 2013, 10:27 pm
Posts: 353
I think it will be better to attach them into a slider and make a full screen widget.
I went through the docs, but couldn't find anything about swim direction

_________________
Life is a myriad game... Just play it!


Top
 Profile  
 
PostPosted: July 10th, 2014, 4:42 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Hi DG! Thanks for the quick reply..
The fact is that with the widget->"swim" option as you know the images floating randomly. I'm almost sure that should be a way to control the movement though script, but as it seems from my topic here I don't know how.. :)

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: July 10th, 2014, 11:02 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
jimking wrote:
The fact is that with the widget->"swim" option as you know the images floating randomly.
with [widget>swim], whole widget will floating on screen, not only images;
this means all images get floated together



Quote:
I'm almost sure that should be a way to control the movement though script, but as it seems from my topic here I don't know how.. :)
for [widget>swim], the only option that i found is to control [OnSwimToLeft] event and [OnSwimToRight] event
there is a way to make it possible to swim only one direction for left/right, not up/down


can you explain more how you want the images to be shown?


Top
 Profile  
 
PostPosted: July 10th, 2014, 12:08 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Hi hamid!
If you check my attach file you will see that are 9 different water drop images like this one:
Image

So I was thinking to make a full screen images where the drops will fall from top to bottom like a rain effect on screen!
Imagine like a "swim" widget (without use the "keep on screen" swim option), but the images will move only in a vertical random position.
The best of course is to have also random the start point of the drop. Other will start fall from the top, other from the middle..
Just think a rain effect on the screen.. :)

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: July 10th, 2014, 12:42 pm 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
couldn't imagine this with swim effect
maybe you want it to create wind

but why don't you create a png animation or a gif?


Top
 Profile  
 
PostPosted: July 10th, 2014, 1:27 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
I told you practically I can create 9 animated pngs with the fall animation..
But we can make their appearance ramdom on screen..?
(I was thinking the swim option to give you an idea about how it will look..)
Quote:
couldn't imagine this with swim effect
maybe you want it to create wind

This is the question..If is possible to control their movement though script..

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: July 10th, 2014, 1:38 pm 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
for the fall animation, we can also use progressbar:
Attachment:
raindrop_[test1] [2014.05.07].xwp [41.81 KiB]
Downloaded 372 times

but i think creating animation file is better
maybe it uses less resources

jimking wrote:
I told you practically I can create 9 animated pngs with the fall animation..
But we can make their appearance ramdom on screen..?

if you create animation file for each of the images, then it can be done
randomizing will be done like the broken screen widget


edit1:
Note:
in above attachment i have rotated the images to be used on up-to-down progressbar


============
edit2:
i don't know why i used progressbar for this
we can use image object for this without rotating image:
Attachment:
raindrop_[test2] [2014.05.07].xwp [41.13 KiB]
Downloaded 380 times

but still i think creating animation file will be better


Top
 Profile  
 
PostPosted: July 10th, 2014, 2:38 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Both test files are great!! :)
How about the control of the fall speed...?
Quote:
if you create animation file for each of the images, then it can be done
randomizing will be done like the broken screen widget

It's not so hard but surely requires some time..
I'm really curious to see which of the two modes use less resources..
Since it will cover all the screen's height (x768) and the number of the pngs will be high, maybe the anim png is worst..
But I need to test it first..

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: July 10th, 2014, 4:20 pm 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
here's with more images,
but doesn't added random image
Attachment:
raindrop_[test3] [2014.07.11].xwp [41.47 KiB]
Downloaded 352 times


i think cpu usage is high for it
plz test it


===========
Quote:
How about the control of the fall speed...?

fall speed can be set using:
1. image position increment, ex: image1.Top+=12
2. setTimeout execution time, ex: setTimeout("Rainfall",20)


Top
 Profile  
 
PostPosted: July 10th, 2014, 4:59 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Testing your last file "raindrop_[test3] [2014.07.11].xwp" the cpu usage is 0~2%!! :D
I will make some more tests decreasing the speed and adding the various pngs and I'll reply as soon as possible...

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: July 11th, 2014, 2:12 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
I made some little changes to the script and edited the scale % of some images to be more realistic..
Cpu usage=0%

Next steps:
- Randomize their movement on x-axis? <- ->
- (more complicated) With mouse click appear of a random water drop (like the "Broken Screen")

I try to study the script from the "Broken Screen" widget and copy the function but is a bit confusing for me...


Attachments:
raindrop_[test4].xwp [41.49 KiB]
Downloaded 353 times

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/
Top
 Profile  
 
PostPosted: July 11th, 2014, 5:10 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
Quote:
Cpu usage=0%
Cpu Usage will be different on different PCs
mine is also 0
but you can see usage better on a graph
it's not high, but i think it shouldn't be this for a widget (that will be always running)
can you create a gif or png animation to test it with that?

and why don't you use animation effect (like your rocket_recycle_bin widget)?
i'm not so familiar with animation effects of xwidget, so i can't use it myself


jimking wrote:
- Randomize their movement on x-axis? <- ->
why should it move on x-axis?
their speed make me imagine it as water-drops, not raindrops
are they going to be water-drops?
then why they should move on x-axis?
do you mean zigzag?
can you show the movement in an image?


Quote:
- (more complicated) With mouse click appear of a random water drop (like the "Broken Screen")
1. should it start from click position?
2. do you mean random image files? they are not so different in shape


Top
 Profile  
 
PostPosted: July 11th, 2014, 6:51 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Quote:
why should it move on x-axis?
their speed make me imagine it as water-drops, not raindrops
are they going to be water-drops?
then why they should move on x-axis?
do you mean zigzag?
can you show the movement in an image?

I was thinking more like raindrops.. (But even as a water-drops the water falls randomly..)
I mean that their vertical position will change. They will drop from a random left/right position.
For now, each drop keeps the same x-asis position. (up&down movement in a steady x-asis)

Quote:
1. should it start from click position?
2. do you mean random image files? they are not so different in shape

1. Yes (double click is better)
2. I know.. Not all but maybe 2-3 different images..

Quote:
can you create a gif or png animation to test it with that?
and why don't you use animation effect (like your rocket_recycle_bin widget)?

I can do it but it needs time.. I have to create a transparent image with GIMP with 768 height resolution as my laptop.
Image that I have to start from top, and using the keyboard move it lower and lower, and save each image.. I think that we will need +200png images for each kind of drop!!! :!:
Since is working fine with your own way, the cpu is ~0%, why do all this work...

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: July 11th, 2014, 7:03 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
i just found how to use animation effects of xwidget for images
but really doesn't useful
it uses very high Cpu usage (about 50% of mine)


so using the code is better for now
i have added the code for disable widget when it's hide
this way we could make lower cpu usage when it's hidden


Quote:
I was thinking more like raindrops.. (But even as a water-drops the water falls randomly..)
I mean that their vertical position will change. They will drop from a random left/right position.
For now, each drop keeps the same x-asis position. (up&down movement in a steady x-asis)

1. Yes (double click is better)
2. I know.. Maybe 2-3 different images..

ok, now i'm working on it


Top
 Profile  
 
PostPosted: July 11th, 2014, 7:43 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Ok thanks! I'm waiting for the "test5"... :)

Quote:
i just found how to use animation effects of xwidget for images
but really doesn't useful
it uses very high Cpu usage (about 50% of mine)

Yes I know.. These switch/animations option are almost useless. You need a certain design, size and function to use them with low cpu.
One thing that I wish for the v2.0 of XW is low consumption for the effects..

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: July 11th, 2014, 1:57 pm 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
ok, it's ready:
Attachment:
raindrop_[test5] [2014.07.12].xwp [37.72 KiB]
Downloaded 358 times


=========
Changes:
Added: Disabling/Enabling on Hide/Show to save Cpu Usage when it's Hidden
Added: MenuItem to Clear Screen
Added: MenuItem to Set Number of images
Added: Code to automatically create imageObjects
Added: Code for Random ImageFile Usage
Added: Code for Random Speed, Position for each Object
Added: Widget LockPosition and MouseThrough
Removed: Extra ImageObjects from widget
===========

Note:
-Adding more than 10 ImageObjects will cause cpu usage go high
(for me getting 20-30%)


Top
 Profile  
 
PostPosted: July 11th, 2014, 3:00 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Visualy is reallly GREAT! And your script is rock!
But I can't activate the right click option or click on the widget(move).. :?
Maybe of this "Added: Widget LockPosition and MouseThrough"...?

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: July 11th, 2014, 3:31 pm 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
jimking wrote:
Visualy is reallly GREAT! And your script is rock!
But I can't activate the right click option or click on the widget(move).. :?
Maybe of this "Added: Widget LockPosition and MouseThrough"...?

yes, it' MouseThrough
you can activate widget by pressing Ctrl button
same way as BrokenScreen widget


Note:
also if you add about 100 imgObjects, RightClick Menu of widget and even Click on widget may not work
this is because of high cpu usage


Top
 Profile  
 
PostPosted: July 11th, 2014, 3:35 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Quote:
yes, it' MouseThrough
you can activate widget by pressing Ctrl button
same way as BrokenScreen widget

Yes you're right.. I forgot it!
Quote:
also if you add about 100 imgObjects RightClick Menu and even Click of mouse may not work
this is because of high cpu usage

Yes it's logical. I will keep it in mind..

Excellent work as always bro! ;)

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: July 11th, 2014, 6:17 pm 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
Here's the new version:
Attachment:
raindrop_[test6] [2014.07.12].xwp [37.92 KiB]
Downloaded 337 times


==========
Changes:
Added: Cleaner Code and Menuitem to clean the drops on mouseenter
Added: the Mouse Cursor for Cleaner

fixed: Saveini() have been missed in previous code,
-> i don't know how it works without it, maybe it doesn't require anymore,
-> but i added it for compatibility with old versions
============


Top
 Profile  
 
PostPosted: July 12th, 2014, 12:58 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Quote:
Changes:
Added: Cleaner Code and Menuitem to clean the drops on mouseenter
Added: the Mouse Cursor for Cleaner

Great addition! 8-)
I think is ready now. We're or better YOU did it..!

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: July 12th, 2014, 7:20 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
i have added some additional things
i think this is the final work on this

here's new version:
Attachment:
raindrop_[test7] [2014.07.12].xwp [38.13 KiB]
Downloaded 362 times


==========
Changes:
Added: Enable Counter Menuitem and code to count the number of items
Added: Some Optimization to Code to make it easier to read
Added: Producer Info to the script code's Comment
============


Top
 Profile  
 
PostPosted: July 12th, 2014, 8:40 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Nice!! I will edit the "Widget icon" image and I will post it later..
Thanks a bunch bro!

Posted: :D
viewtopic.php?f=11&t=4745

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 24 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 17 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB® Forum Software © phpBB Group