Rotary switch rotate image

Questions about deployment and use of Air Manager Instruments

Moderators: russ, Ralph

Post Reply
Message
Author
nikyukuu
Posts: 3
Joined: Fri Apr 02, 2021 9:12 pm

Rotary switch rotate image

#1 Post by nikyukuu »

Quick question: Is it possible for a rotary switch to use the same image for all positions with different rotation angles?

User avatar
Ralph
Posts: 7876
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Rotary switch rotate image

#2 Post by Ralph »

No, you'll have to create multiple images.

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Rotary switch rotate image

#3 Post by Keith Baxter »

Hi,

Not possible in the switch_add.
BUT
Yes it can be done. In the switch_add you use a nil for all the switch images.

Then you place your image where the switch is located.

I your logic you can rotate the image.
This is often used to animate slow action switches and buttons.

You can do the same if your switch is a canvas_draw()


Keith
Last edited by Keith Baxter on Sat Apr 03, 2021 1:21 pm, edited 1 time in total.
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Rotary switch rotate image

#4 Post by Sling »

Yes and No i guess is the correct answer. It really depends on the context.

Yes - Do as Keith describes and manage the image rotation yourself with some additional code.

No - Like Ralph posted, you need separate images if you are just using the switch_add() functionality.

Post Reply