Can users rotate an object

Feb 19, 2015

I want to create a graphic that users can rotate on an iPad, then when they release and a certain point it triggers slide change.

 

Anyone know how to do this please?

 

David

8 Replies
Steven Sowell

Hello Michael Hinze, and all,

In the link you provided http://dev.keypointlearn.com/xcl73_SL2/Sliders/V1/story.html, the 5th example is exactly what I'm looking for (rotating a "Packeteer" network device). I see that each image is probably a "state", but hoping someone has the source file I could look at to see exactly how this was done?

Michael Hinze
Steven Sowell

Hello Michael Hinze, and all,

In the link you provided http://dev.keypointlearn.com/xcl73_SL2/Sliders/V1/story.html, the 5th example is exactly what I'm looking for (rotating a "Packeteer" network device). I see that each image is probably a "state", but hoping someone has the source file I could look at to see exactly how this was done?

Correct, the device is an image object with many custom states that each show the device at a slightly different angle. As the slider is moved, a variable changes. Based on that changing variable, the corresponding state of the image object is shown, creating the illusion of rotation

Steven Sowell

thanks! Due to customer requirement, I had to change the slider to a more complex "left arrow/right arrow" buttons, but used only 45 degree rotate increments, so there's only 8 values between 0 and 360 degrees. This led me to discover what I feel is a minor flaw in SL2's Boolean logic (maybe not). long story(line) short, here was my solution, if anyone needs to use arrows instead of a slider:

  • Declare %Rotate% = 0
  • Trigger "Right Arrow": Add 45 to %Rotate% when user clicks; IF %Rotate% < 406
    • Trigger: Set %Rotate% = 45 when %Rotate% == 405
  • Trigger "Left Arrow: Subtract 45 from %Rotate% when user clicks; IF %Rotate% > -44
    • Trigger: Set %Rotate% = 315 when %Rotate% == -45

Thus, you can click left arrow or right arrow and %Rotate% will always show the correct value (which can then translate into the correct state for the image).

Whew! If anyone can simplify my logic to accomplish this, that would be cool. But this works!

Mr. Hinze, THANK YOU  for the example!! As for displaying states based on a variable, did you use a separate trigger for each state? Or, is there a way to ensure that the variable's value is the same as the state name, and then simply have one single trigger that says:

Change state of "object" to == %variable% (wouldn't that be cool?)

Michael Hinze
Steven Sowell

thanks! Due to customer requirement, I had to change the slider to a more complex "left arrow/right arrow" buttons, but used only 45 degree rotate increments, so there's only 8 values between 0 and 360 degrees. This led me to discover what I feel is a minor flaw in SL2's Boolean logic (maybe not). long story(line) short, here was my solution, if anyone needs to use arrows instead of a slider:

  • Declare %Rotate% = 0
  • Trigger "Right Arrow": Add 45 to %Rotate% when user clicks; IF %Rotate% < 406
    • Trigger: Set %Rotate% = 45 when %Rotate% == 405
  • Trigger "Left Arrow: Subtract 45 from %Rotate% when user clicks; IF %Rotate% > -44
    • Trigger: Set %Rotate% = 315 when %Rotate% == -45

Thus, you can click left arrow or right arrow and %Rotate% will always show the correct value (which can then translate into the correct state for the image).

Whew! If anyone can simplify my logic to accomplish this, that would be cool. But this works!

Mr. Hinze, THANK YOU  for the example!! As for displaying states based on a variable, did you use a separate trigger for each state? Or, is there a way to ensure that the variable's value is the same as the state name, and then simply have one single trigger that says:

Change state of "object" to == %variable% (wouldn't that be cool?)

Yes, it would be cool to refer to state names based on a variable value, but that's not possible. You need a trigger for each state.

This discussion is closed. You can start a new discussion or contact Articulate Support.