XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently May 10th, 2025, 7:02 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 62 posts ] 
Author Message
 Post subject: Rotate Object?
PostPosted: September 8th, 2014, 3:17 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Hamid, how can I rotate an image object 30° that is in a slidepanel after slideout...?

To be more clear:
I have a slidepanel and inside an image. I would like to have a rotation of the image 30° with the slide-out and back to 0° with slide-in..
Thanks

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


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 9th, 2014, 5:26 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
Code:
//Script Author: Hamid

var s1,s2;

function rotateforward()
{
  if(image1.RotateAngle<30)
  {
     image1.RotateAngle+=1
  }
  s1=setTimeout("rotateforward",50)
}


function rotatebackward()
{
  if(image1.RotateAngle>0)
  {
     image1.RotateAngle-=1
  }
  s2=setTimeout("rotatebackward",50)
}


i didn't tested the code, but it should work ok,

you should call functions when the slidepanel going to change,
to do this:
1. if you know when it going to happens, you can call it after that event,
2. if you don't know when it happens, then you should add a timercore to check the state of the slidepanel


edit:
also better to use cleartimeout() before calling another function to prevent collision,
use the code below before the line where you're going to call [rotateforward()] and [rotatebackward()] functions:
Code:
clearTimeout(s1)
clearTimeout(s2)



edit2:
you should change the image1 in the code with the name of your image object


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 9th, 2014, 6:07 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
The slide movement will be activated with a single "double click" function, so I will need these "clearTimeout" part..?
There will be 2 slidepanels with one image, one left one right, and with a double click the panels will slideout and the image inside will rotate 30o.
The inverse movement will be with the double click again..

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


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 9th, 2014, 6:33 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
then you should also add this code,
it will do cleartomout() at first and then check the state of slidepanel to decide which function to be called and it will also do the sliding,

so you just need to do these:
1. change the image1 and sildepanel1 and slidepanel2 in the code with the name of your objects
2. add the [slideit] function name to the [OnDblClick] event of what is going to get the doubleclick

Code:
function slideit()
{
   clearTimeout(s1)
   clearTimeout(s2)
   if(slidepanel1.Slided)
   {
      slidepanel1.Slided=0
      slidepanel2.Slided=0
      rotatebackward()
   }
   else
   {
      slidepanel1.Slided=1
      slidepanel2.Slided=1
      rotateforward()
   }
}




edit:
1. i forget that there are 2 slidepanels, so i edited the code to work for both,

Quote:
2. add the [slideit] function name to the [OnDblClick] event of both slidepanels

2. you should add the [slideit] function name to the [OnDblClick] event of what is going to get the doubleclick, not the slidepanels


Last edited by hamid on September 9th, 2014, 6:53 am, edited 3 times in total.

Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 9th, 2014, 6:42 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
I'll test it soon and I will reply..
The project has a lot of slidepanels but fortunately I need the script only for two.
It calls "Optimus Robot Clock", an idea from an Android lockscreen theme and will work like this:
BEFORE and AFTER the double click:

If you want I can send you the .xwp to check it..


Attachments:
preview_1.jpg
preview_1.jpg [ 271.81 KiB | Viewed 551428 times ]
preview_2.jpg
preview_2.jpg [ 277.61 KiB | Viewed 551428 times ]

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/
Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 9th, 2014, 6:52 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
i have edited above post,
don't forget to check it again


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 9th, 2014, 6:53 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
hamid wrote:
i have edited above post,
don't forget to check it again

Ok thanks! :)
I will reply as soon as possible..

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


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 9th, 2014, 7:29 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Hey man, I'm a little confused.. :(
I added the script but I'm missing something stupid..
I think that it will better if you take alook from the inside than bother you with "stupid" questions..
Surely you know much more than me.. :)
Just concentrate on the slidepanels "12" and "13".
The rest have 0 values so they don't work yet..


Attachments:
optimus_robot_clock.xwp [1.52 MiB]
Downloaded 599 times

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/
Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 9th, 2014, 9:54 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
i have connection problems, uploading files larger than 1MB is hard for me,
so i only add the codes for it:
Code:
//Script Author: Hamid



var s1,s2;



function slideit(Sender)
{
   clearTimeout(s1)
   clearTimeout(s2)
   if(slidepanel12.Slided)
   {
      slidepanel12.Slided=0
      slidepanel13.Slided=0
      setTimeout("rotatebackward",200)
   }
   else
   {
      slidepanel12.Slided=1
      slidepanel13.Slided=1
      setTimeout("rotateforward",200)
   }
}




function rotateforward()
{
  if(slidepanel13.image17.RotateAngle<30)
  {
     slidepanel12.image17.RotateAngle-=1
     slidepanel13.image17.RotateAngle+=1
  }
  s1=setTimeout("rotateforward",50)
}


function rotatebackward()
{
  if(slidepanel13.image17.RotateAngle>0)
  {
     slidepanel12.image17.RotateAngle+=1
     slidepanel13.image17.RotateAngle-=1
  }
  s2=setTimeout("rotatebackward",50)
}


just note that you have duplicate object names in your widget,
i don't know if it would make any problem, but designer doesn't allow to use duplicate name by default when renaming objects,

i also found that i can access child objects from its parent in code (ex: slidepanel13.image17),
so in this case, we can manage the duplicate object names in different parents from code,

but still not sure if having duplicate object names is a right way, so decide yourself,

===========
for now:
1. maybe the rotate speed needs to be adjusted
2. i don't know if the sliding should go first or rotation or both together


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 9th, 2014, 11:45 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Ok, I will use this script.

The designer when you copy an object accepts the double names. Only when you create a new one with the same name comes up with the "error".
In this case I have to rename them all, having all different names..?

About the movement, I think that if we can make both animations at the same time it will be great..

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


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 9th, 2014, 7:35 pm 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
jimking wrote:
The designer when you copy an object accepts the double names. Only when you create a new one with the same name comes up with the "error".

i know this


Quote:
In this case I have to rename them all, having all different names..?

i don't know, maybe better to ask Tony about it, to make sure about compatibility in the future


Quote:
About the movement, I think that if we can make both animations at the same time it will be great..
do you mean by both, sliding and rotating?


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 10th, 2014, 12:30 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Quote:
In this case I have to rename them all, having all different names..?
i don't know, maybe better to ask Tony about it, to make sure about compatibility in the future

I mean if I need to edit the names for this widget. But since your script works ok, and the rest are just slidepanels with simple in/out function, I think it's not necessary..

Quote:
About the movement, I think that if we can make both animations at the same time it will be great..
do you mean by both, sliding and rotating?[/quote]
Yes, sliding and rotating in the same time..

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


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 10th, 2014, 1:48 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
using the animation effect of Xwidget and script code for movement together is hard to sync, or maybe can't be sync, because Xwidget's animation effect will go its own timeline and couldn't be controlled by code,

here's a code example for using both at the same time:
Code:
//Script Author: Hamid



var s1,s2;



function slideit(Sender)
{
   clearTimeout(s1)
   clearTimeout(s2)
   if(slidepanel12.Slided)
   {
      slidepanel12.Slided=0
      slidepanel13.Slided=0
      setTimeout("rotatebackward",10)
      //rotatebackward()

   }
   else
   {
      slidepanel12.Slided=1
      slidepanel13.Slided=1
      setTimeout("rotateforward",10)
      //rotateforward()
   }
}




function rotateforward()
{
  if(slidepanel13.image17.RotateAngle<30)
  {
     slidepanel12.image17.RotateAngle-=1
     slidepanel13.image17.RotateAngle+=1
  }
  s1=setTimeout("rotateforward",50)
}


function rotatebackward()
{
  if(slidepanel13.image17.RotateAngle>0)
  {
     slidepanel12.image17.RotateAngle+=1
     slidepanel13.image17.RotateAngle-=1
  }
  s2=setTimeout("rotatebackward",50)
}


i think it's better to do one of them first and then do the other, instead of working on syncing of both...


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 10th, 2014, 3:02 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Ok thanks man! Don't worry. This animation is good enough! For the rest of the slidepanels I will play with the duration values of the "Switch Animation", and changing a bit the setTimeout value, I'll try to make the animations more similar possible..

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


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 10th, 2014, 3:53 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Question:
You think that is possible to have more control of the slide movement though script than the simple:
"slidepanel1.slided = !slidepanel1.slided;" ?
I wοuld like to avoid if is possible the "switch animation" for less cpu usage during the animation..
Like you did with the 2 slidepanels...

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


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 10th, 2014, 5:36 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
it can be done as a movement,
but maybe it will not have the same effect (as Quadratic effect)


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 10th, 2014, 6:29 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
here is the code for it:
Code:
//Script Author: Hamid



var s1,s2,state;



function slideit(Sender)
{
   clearTimeout(s1)
   clearTimeout(s2)
   if(state)
   {
      state=false
      setTimeout("rotatebackward",10)
      //rotatebackward()

   }
   else
   {
      state=true
      setTimeout("rotateforward",10)
      //rotateforward()
   }
}




function rotateforward()
{
  if(slidepanel13.image17.RotateAngle<30)
  {
     slidepanel12.image17.RotateAngle-=1
     slidepanel13.image17.RotateAngle+=1
     slidepanel12.Left-=1
     slidepanel13.Left+=1
     slidepanel12.Top-=1
     slidepanel13.Top-=1
  }
  s1=setTimeout("rotateforward",50)
}


function rotatebackward()
{
  if(slidepanel13.image17.RotateAngle>0)
  {
     slidepanel12.image17.RotateAngle+=1
     slidepanel13.image17.RotateAngle-=1
     slidepanel12.Left+=1
     slidepanel13.Left-=1
     slidepanel12.Top+=1
     slidepanel13.Top+=1
  }
  s2=setTimeout("rotatebackward",50)
}


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 10th, 2014, 6:52 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
i have edited the above code to move in the direction you specified,
the previous one move in 45 degree and needs readjusting in the code for other degrees,
this one will be adjusted easier, since it will move the image object in the direction of slidepanel's angle

here it is:
Code:
//Script Author: Hamid



var s1,s2,state;



function slideit(Sender)
{
   clearTimeout(s1)
   clearTimeout(s2)
   if(state)
   {
      state=false
      setTimeout("rotatebackward",50)

   }
   else
   {
      state=true
      setTimeout("rotateforward",50)
   }
}




function rotateforward()
{
  if(slidepanel13.image17.RotateAngle<30)
  {
     slidepanel12.image17.RotateAngle-=1
     slidepanel13.image17.RotateAngle+=1
     slidepanel12.image17.Left-=1
     slidepanel13.image17.Left+=1
  }
  s1=setTimeout("rotateforward",50)
}


function rotatebackward()
{
  if(slidepanel13.image17.RotateAngle>0)
  {
     slidepanel12.image17.RotateAngle+=1
     slidepanel13.image17.RotateAngle-=1
     slidepanel12.image17.Left+=1
     slidepanel13.image17.Left-=1
  }
  s2=setTimeout("rotatebackward",50)
}


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 10th, 2014, 7:03 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
The last animation/script is better. Thanks!
And it's smooth or even better than the designer's option.

Code:
//Script Author: Hamid

var s1,s2,state;

function slideit(Sender)
{
   clearTimeout(s1)
   clearTimeout(s2)
   if(state)
   {
      state=false
      setTimeout("rotatebackward",10)
      //rotatebackward()

   }
   else
   {
      state=true
      setTimeout("rotateforward",10)
      //rotateforward()
   }
{
   slidepanel10.slided = !slidepanel10.slided;
   slidepanel11.slided = !slidepanel11.slided;
   slidepanel1.slided = !slidepanel1.slided;
   slidepanel2.slided = !slidepanel2.slided;
   slidepanel3.slided = !slidepanel3.slided;
   slidepanel5.slided = !slidepanel5.slided;
   widget.cmd("!ShowHideObj=image10");
   slidepanel4.slided = !slidepanel4.slided;
   widget.cmd("!ShowHideObj=image11");

}
}




function rotateforward()
{
  if(slidepanel13.image17.RotateAngle<30)
  {
     slidepanel12.image17.RotateAngle-=1
     slidepanel13.image17.RotateAngle+=1
     slidepanel12.Left-=1
     slidepanel13.Left+=1
     slidepanel12.Top-=1
     slidepanel13.Top-=1
  }
  s1=setTimeout("rotateforward",3)
}


function rotatebackward()
{
  if(slidepanel13.image17.RotateAngle>0)
  {
     slidepanel12.image17.RotateAngle+=1
     slidepanel13.image17.RotateAngle-=1
     slidepanel12.Left+=1
     slidepanel13.Left-=1
     slidepanel12.Top+=1
     slidepanel13.Top+=1
  }
  s2=setTimeout("rotatebackward",3)
}

My question was for the rest sliders though.. (I still need to fix some more sliders)
Using the "slidepanel1xxx.slided = !slidepanel1xxx.slided;" for the other sliders I need to activate and increase the "switch animation" value, so more cpu during animation.. Also the movement is not smooth and the system can't handle it well..
Can we pass it using similar script for the rest sliders..? :?
CHECK THE ANIMATIONS: (some sliders are not activated yet)


Attachments:
optimus_robot_clock(2).xwp [1.52 MiB]
Downloaded 595 times

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/
Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 10th, 2014, 7:17 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
the above code will not use the animation effect anymore,
even it doesn't need slidepanel to be slided,
it will do all the movements by itself,
you can even replace slidepanels with layer objects (but it's not necessary)

for the others, it's simple,
just i should know:
1. how far it should move?
2. to what degree the images should rotate?


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 10th, 2014, 7:31 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Quote:
the above code will not use the animation effect anymore,
even it doesn't need slidepanel to be slided.

In the latest script the animation for the sliders 12/13 (doors) don't have any slide movement, only rotate. But it's OK and BETTER! So leave it like this.

Quote:
for the others, it's simple,
just i should know:
2. to what degree the images should rotate?

All the rest sliders are moving with the simple in/out animation (up-down,left-right) WITHOUT rotate. So are simple!
Quote:
1. how far it should move?

I have to add the "Slide Offset value" for the rest sliders and then you will be able to see the distance..
Just download my last attach .xwp to see what I mean...

So give me time to complete it and I will post the final version with all the sliders in movement, ok?

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


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 10th, 2014, 7:53 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
Quote:
In the latest script the animation for the sliders 12/13 (doors) don't have any slide movement, only rotate. But it's OK and BETTER! So leave it like this.

it's moving, but it only move for 30pixel,
because i have added it inside rotate function,
you can increase/decrease it by changing the moving step
ex: slidepanel13.image17.Left+=4


here's a code example with increased movement:
Code:
//Script Author: Hamid



var s1,s2,state;



function slideit(Sender)
{
   clearTimeout(s1)
   clearTimeout(s2)
   if(state)
   {
      state=false
      setTimeout("rotatebackward",50)

   }
   else
   {
      state=true
      setTimeout("rotateforward",50)
   }
}




function rotateforward()
{
  if(slidepanel13.image17.RotateAngle<30)
  {
     slidepanel12.image17.RotateAngle-=1
     slidepanel13.image17.RotateAngle+=1
     slidepanel12.image17.Left-=4
     slidepanel13.image17.Left+=4
  }
  s1=setTimeout("rotateforward",50)
}


function rotatebackward()
{
  if(slidepanel13.image17.RotateAngle>0)
  {
     slidepanel12.image17.RotateAngle+=1
     slidepanel13.image17.RotateAngle-=1
     slidepanel12.image17.Left+=4
     slidepanel13.image17.Left-=4
  }
  s2=setTimeout("rotatebackward",50)
}


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 10th, 2014, 8:41 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
As I told you is better like this.. Increasing the "X" value here "slidepanel13.image17.Left+=X ", even only +1 the panels go too high so I leave it with value "1".
Here is the completed widget with all the animations activated. Only the speed of the sliders 12/13 need edit to match with the rest..


Attachments:
optimus_robot_clock.xwp [1.51 MiB]
Downloaded 602 times

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/
Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 10th, 2014, 9:31 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
is there any reason you added 14,16,17 slided 2times?
also why the left red slider is going different from right red slider?

edit:
Quote:
is there any reason you added 14,16,17 slided 2times?

i was wrong, only the 4 is used 2times, that should be 14

Quote:
also why the left red slider is going different from right red slider?

the right one was had slided enabled,
so i fixed it myself


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 10th, 2014, 11:03 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Quote:
i was wrong, only the 4 is used 2times, that should be 14

I check hamid but the num4 is not used 2 times! The numb4 is the mirror of the num5. And there is already the num14 that is totally different. All the sliders are x2. There are many slidepanels and you confused..! :lol:

I fixed the position of some sliders and since there is a difference in speed with your script,the sliders 12/13 and the rest, I deleted the script and I made a trick rotating the slidepanel and the image inside to give a diagonal movement simplifying the things!
If you can find a way to reduce the cpu usage during the animation will be great! If not I will keep it with the current configuration..
Thanks for your precious help!
Here is the final version:


Attachments:
optimus_robot_clock.xwp [1.57 MiB]
Downloaded 569 times

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/
Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 10th, 2014, 11:23 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
when i said that, i don't mean slidepanel4 itself, i mean it's sliding command in code,
also you didn't fixed it in the last version,
don't you notice that the above slidepanels didn't go upward?
so don't do any editing,
i will fix them in the next test file


edit:
also you didn't do any rotation in the last version,
it's just simply sliding up and down as first version (before starting coding),


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 10th, 2014, 12:32 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Quote:
don't you notice that the above slidepanels didn't go upward?

Oh now I understand what do you mean! :)
I can fix it easily though script by myself..
Quote:
also you didn't do any rotation in the last version,

I know hamid! As I wrote you in my prev comment:
"since there was a difference in speed between the sliders 12/13 and the rest with your script, I deleted the script and I made a trick rotating the slidepanel and the image inside to give a diagonal movement simplifying the things!"
So I remove the rotate function and I think is not necessary any more!

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


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 10th, 2014, 12:36 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Here is my FINAL full working version:
If you can find a way to reduce the cpu usage during the animation it will be ok! But really mate, since you need to write a new script and the objects are many, no need to spend more time on this. I think it's perfect..! ;)
Ok, the cpu increases a lot during the animations, but we can have it all, right?
Maybe I had to do some more tests before bother you with this..

One last thing that maybe I'll change is replace the "double click" function with the "mouse over", so the animation will start when the mouse goes over the clock panel..


Attachments:
optimus_robot_clock.xwp [1.57 MiB]
Downloaded 543 times

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/
Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 10th, 2014, 10:30 pm 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
Quote:
One last thing that maybe I'll change is replace the "double click" function with the "mouse over", so the animation will start when the mouse goes over the clock panel..

no problem, it's not related to the code
you should just add function name to the other event, instead of DblClick

=============


[test1:]
i have edited the final version to fix your code,
your code was had a problem when you do 2xdoubleClick(4Clicks),


note:
1. this is based on last version you have posted
2. i have removed images to lower the size (add them yourself again)
3. i have renamed some Objects to simplify the code
4. this is the version without rotation Code
Attachment:
optimus_robot_clock_[test] [2014.09.11][10.29].xwp [2.46 KiB]
Downloaded 559 times


================

[test2:]
and here is another version,
this is based on previous version,
i have edited this before you post the last version,
so don't know if you had changed anything in that version

note:
1. this is based on old version you have posted
2. i have removed images to lower the size (add them yourself again)
3. i have renamed some Objects to simplify the code
4. this is the version with rotation Code
Attachment:
optimus_robot_clock_[test2] [2014.09.11][10.32].xwp [2.62 KiB]
Downloaded 533 times


============


try both of them, and choose which you think better,


i have some idea:
how about having light on the eyes of robot?
so the lights get on when robot gets in front


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 11th, 2014, 12:41 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Thanks for your work hamid!!! I will test them both as soon possible.
About the light in the eyes, I will see if and where can this be placed..

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


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 11th, 2014, 2:14 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Your first test/script is pretty good because uses the diagonal animation, so I think that I will choose this one!
Quote:
how about having light on the eyes of robot?
so the lights get on when robot gets in front

You mean behind the glass doors, when the robot opens? (after the double click)
Since is a truck is difficult to see them as its eyes! :lol:
I have to put the light images that I used and I don't know if will look good..
I'll give a try and I will send you the file and you if you like you can keep it like this. :)

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


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 11th, 2014, 3:01 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
i'm just giving my ideas,
this is your project,
so at last you should decide,

i thought of it because the robot couldn't be seen well,
also it seems that it doesn't have any eyes

i like these kind of robots, but it's coloring or contrast doesn't attract me,
it seems a little mixed up to me,
anyway, it's too much for a free widget ;)


edit:
also you can try red eyes (like Terminator :D )


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 11th, 2014, 5:25 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
The robot couldn't be seen well because as I notice, all the images that I used are actually the body of the "Optimus Prime", and the head is missing from the design! :)
I added the two lights and I'm search the right position.. Maybe I will post it without them but I would like to send you a "separate" version with eyes.. ;)

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


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 11th, 2014, 6:02 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
if you're going to do this only for me, don't do it,
because i don't use widgets too much, i just like scripting,

when i told i like these robots, i mean its tv-series,
i mean the character of robots that change to the cars,
it was a attractive character that a robot converts to the car,
i don't remember the name of the animation-series,

also i knew a game that the person at the end of each mission convert to robot and fight with the enemy robot, but also don't remember its name,
i have never found it again
i always like to collect my old played games :D


edit:
i have searched for this in google and found that its eyes in most of the images are blue


Last edited by hamid on September 11th, 2014, 6:14 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 11th, 2014, 6:11 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
I added the eyes before I read your last comments.. :lol:

Just check it and if you want you can keep it. It's more like a robot now. I create dark blue eyes to match with the design, but using the "Colorization" option you can transform them to any color you like..
Cheers


Attachments:
optimus_robot_clock.xwp [1.59 MiB]
Downloaded 587 times

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/
Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 11th, 2014, 6:36 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Second version with different style of eyes!
I created another main background image opening to "holes" and move the lights behind..
Choose your favourite! :)

At the end I decided to post it like this one last and I added a right click option for who want these extra eyes or not.


Topic closed I think!


Attachments:
optimus_robot_clock(1).xwp [1.97 MiB]
Downloaded 543 times

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/
Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 11th, 2014, 7:17 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
[this is for previous version:]
i think you have placed the eyes wrong,
i have edited it,
also i have fixed the code for it,

the eyes' shape still needs to be adjusted
i think it's better to remove bright line from its top and bottom

as ever, i have removed images, so add it yourself
Attachment:
optimus_robot_clock_[test4] [2014.09.11][19.36].xwp [2.58 KiB]
Downloaded 569 times



==========
for the correct position of eyes, look at this:

also you can find more by searching for it


Attachments:
2.jpg
2.jpg [ 2.15 MiB | Viewed 551313 times ]
1.jpg
1.jpg [ 102.6 KiB | Viewed 551313 times ]
Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 11th, 2014, 7:45 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
I edited the eyes' shape according your suggestion and the size, but personally I prefer the old position of the eyes. In this place, the head of the robot seems too small.. Also I like the more "aggressive" eye style. But this is my personal taste!
I think that we see two different robots there! :lol:

Thanks for the script. Here is my final version and I will upload it now..


Attachments:
optimus_robot_clock.xwp [1.59 MiB]
Downloaded 584 times

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/
Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 11th, 2014, 7:58 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Quote:
for the correct position of eyes, look at this:

I have already checked mate!!! But maybe you need to notice that in my design there is NO head like the original! :lol:
Only the body. So I had to "create" a custom position of the eyes...
...and if you check closer, my position of the lights are more similar to the original.. Trust me! ;)

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


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 11th, 2014, 8:06 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
sorry again JimKing,
your menuitem Code doesn't work correctly,
plz wait until i add correct one here



Quote:
I have already checked mate!!! But maybe you need to notice that in my design there is NO head like the original! :lol:
Only the body. So I had to "create" a custom position of the eyes...

but what is that head behind the glasses?
i mean shouldn't the thing behind the glasses be the head?


Last edited by hamid on September 11th, 2014, 8:10 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 11th, 2014, 8:09 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
hamid wrote:
sorry again JimKing,
your menuitem Code doesn't work correctly,
plz wait until i add correct one here

You mean the right click option for the eyes on/off?
I added again and works fine... :?

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


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 11th, 2014, 8:12 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
You want to go one step further??
Check these...!
..and if we can add a head? :mrgreen:


Attachments:
optimus-prime-mask-psd25566.png
optimus-prime-mask-psd25566.png [ 226.78 KiB | Viewed 551312 times ]
Optimus_Prime_Helmet.png
Optimus_Prime_Helmet.png [ 219.06 KiB | Viewed 551312 times ]

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/
Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 11th, 2014, 8:16 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
jimking wrote:
hamid wrote:
sorry again JimKing,
your menuitem Code doesn't work correctly,
plz wait until i add correct one here

You mean the right click option for the eyes on/off?
I added again and works fine... :?

but it will get on/off when dblClick again,
so what will it do?
only on/off for one dblclick?

do you want it to be this way or fully disable/enable lighteyes?


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 11th, 2014, 8:21 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
jimking wrote:
You want to go one step further??
Check these...!
..and if we can add a head? :mrgreen:

no thanks,
just wanted to bring the head more front by adding the eyes,
but if you like i would help as ever ;)


edit:
isn't this widget port of another one?
so how is the original one?

edit2:
ok, i just found it in some above post


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 11th, 2014, 8:37 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Quote:
but it will get on/off when dblClick again,
so what will it do?
only on/off for one dblclick?

do you want it to be this way or fully disable/enable lighteyes?

The addition of the right click option is for who prefer to have the eyes on/off in general.
So I want it the way it is now:
1) Double click robot open/show eyes - Double click robot close/hide eyes
OR
2) Double click robot open/close - no eyes
That's why I told you that the right click/script is ok.

Now for the head is just an idea.. Maybe I will give a try, but it's all about designing, so I think I'll not bother you more with it :)

EDIT:
I took the idea from a locker theme for Android. So the original actually has nothing to do with a widget..! ;)

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


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 11th, 2014, 8:43 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
about the menuitem,
are you sure that is working as you specified?
when you use menuitem, it only hide eyes for that moment, and after dblclick, it will do lighting again
just to make sure, do you wanted it this way?


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 11th, 2014, 8:56 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
hamid wrote:
about the menuitem,
are you sure that is working as you specified?
when you use menuitem, it only hide eyes for that moment, and after dblclick, it will do lighting again
just to make sure, do you wanted it this way?

Yes, I'm testing right now and you're right.
With my addition of the script doesn't work like I wanted.. :(
Could you pls give me a hand with this last part..? :roll:

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


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 11th, 2014, 9:17 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
replace the code with this one:

[removed] plz wait...


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 11th, 2014, 9:23 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
hamid wrote:
replace the code with this one:

[removed] plz wait...

Just keep all as now and add only the function/selection to completely off the eyes..

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


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 11th, 2014, 9:29 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
replace the code with this one:

Code:
//Script Author: Hamid



var state;



function widgetOnLoad()
{
   menuitem4.Checked=GetIni("lighteye",1)
}




function slideit(Sender)
{
   if(state)
   {
      for(var i=1;i<=17;i++)
      {
         eval("slidepanel"+i).Slided=0
      }
      slidepanel30.Slided=slidepanel31.Slided=1
      image10.Visible=1
      image11.Visible=1
      layer2.Visible=1
      layer6.Visible=1
      if(menuitem4.Checked)
      {
         lightr.FadeToVisible(0,0.5)
         lightl.FadeToVisible(0,0.5)
      }
      state=false
   }
   else
   {

      for(var i=1;i<=17;i++)
      {
         eval("slidepanel"+i).Slided=1
      }
      slidepanel30.Slided=slidepanel31.Slided=0
      image10.Visible=0
      image11.Visible=0
      layer2.Visible=0
      layer6.Visible=0
      if(menuitem4.Checked)
      {
         lightr.FadeToVisible(1,0.5)
         lightl.FadeToVisible(1,0.5)
      }
      state=true
   }


}


function menuitem4OnClick(Sender)
{
   menuitem4.Checked=!menuitem4.Checked
   SetIni("lighteye",menuitem4.Checked)
   SaveIni()
   if(state)
   {
      if(menuitem4.Checked)
      {
         lightr.FadeToVisible(1,0.5)
         lightl.FadeToVisible(1,0.5)
      }
      else
      {
         lightr.FadeToVisible(0,0.5)
         lightl.FadeToVisible(0,0.5)
      }
   }
}





edit:
don't forget to add [widgetOnLoad] to [widgetonload] Event


Last edited by hamid on September 11th, 2014, 9:33 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 11th, 2014, 9:32 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
OK! Give time to try...
I will show what I did the last mins... ;)

Edit: Your last script works great! :D

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


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 11th, 2014, 10:14 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
thanks, ;)

i just compared the original image with the widget,
http://bbs.xwidget.com/viewtopic.php?f=8&p=9779#p9697

did you noticed the slidepanel2 & slidepanel3 goes up in the original image?


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 11th, 2014, 10:24 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Quote:
i just compared the original image with the widget,
did you noticed the slidepanel2 & slidepanel3 goes up in the original image

I think that both go left/right.. I open both images with Gimp side to side and with fast switch I think that this is the movement..
But even I'm wrong, it's ok!!!
Now...take a look here... 8-)
You will notice that the "eyes" are now the Optimus core light and many more..... ! :D


Attachments:
optimus_robot_clock.xwp [1.74 MiB]
Downloaded 591 times

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/
Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 11th, 2014, 10:49 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
it's really better than original :D
where did you found that image?
it really match the widget


i think it's better to upload them as 2 separate versions,
since both are fine


as i see now, the menuitem is not necessary



as a suggestion, how about head being behind glass and from there goes up,
but i'm not sure, just suggesting


and how about the slidepanels i noted,
did you have any plans for them or leaving it that way?


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 11th, 2014, 10:59 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Quote:
where did you found that image?
it really match the widget

I just searched for "optimus prime png" on google images!
Quote:
i think it's better to upload them as 2 separate versions,
since both are fine

I agree..
Quote:
as i see now, the menuitem is not necessary

The core light is an extra cool visual, so why not have it..
Quote:
as a suggestion, how about head being behind glass and from there goes up,
but i'm not sure, just suggesting

I know what do you mean, but I think the better position is the current.
Quote:
and how about the slidepanels i noted,
did you have any plans for them or leaving it that way?

I''ll keep then as now. Extra stress really is not necessary..

THANKS FOR ALL HAMID! :)

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


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 11th, 2014, 11:21 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Quote:
as a suggestion, how about head being behind glass and from there goes up,
but i'm not sure, just suggesting

I will need to do some not easy steps that require time..
- Edit the main image with GIMP and "extract" the center part where the head will go, and create a new image with this little part.
The head image should be placed between the main backgound image, and this little new image, that it will be placed on bottom..
Because when the head will come up, I need it like a background..
- And the thing that maybe causes lag on movement is that the slidepanel will be much more long, the image will have to go further, so more memory..
Too much headache! :lol:
Quote:
i think it's better to upload them as 2 separate versions,
since both are fine

I will upload them both later as two separate topics..
Thanks again

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


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 11th, 2014, 11:28 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
i'm a little confused...
how does the core light works?

the "lightl" object is linked to "eye.png" and it's a blue circle...
but it doesn't showing anywhere

but there is a white lights fill the body,
that i don't know where are their source

it gets a little mysterious :D
can you tell me how it works?


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 11th, 2014, 12:36 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Haha! Look:
- The "lightl" is linked to "eye.png".
- In this version with the head I use only ONE light image (the above) and I deleted the "lightr" as image/object .
- So the light image is actually one, scale 140% and with "Colorization" option enable, with full brightness, I made it white.
- At the end I kept your script deleting only all the lines with the commands for the "lightr".
Thats all! :)

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


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 11th, 2014, 10:11 pm 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
i have noticed colorization part, maybe i have reseted that by mistake before checking its effect,
so i didn't find it



and about final version:
you didn't add this part:
Quote:
edit:
don't forget to add [widgetOnLoad] to [widgetonload] Event

so it doesn't reload on/off selection on start of widget


edit:
and if it's not late, as a suggestion,
isn't it better to bring slidepanel13 down, so it will be fully hidden behind the car


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 12th, 2014, 12:15 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
I will edit the widgetonload part and reupload..
Thanks!
Instead the slidepanel13 should be like this...

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


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 13th, 2014, 1:14 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
did you edited the widgetonload for both of them?

Quote:
Instead the slidepanel13 should be like this...

and what do you mean by this?


Top
 Profile  
 
 Post subject: Re: Rotate Object?
PostPosted: September 13th, 2014, 2:22 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Quote:
did you edited the widgetonload for both of them?

Yeap! ;)

Quote:
Instead the slidepanel13 should be like this...and what do you mean by this?

I mean that the design it's ok now. No need extra modifications..

_________________
...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  [ 62 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 12 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