Page 1 of 2
suggestions for engine control quadrant in pure AM
Posted: Mon Jun 07, 2021 2:12 pm
by Roxus
Re: suggestions for engine control quadrant in pure AM
Posted: Mon Jun 07, 2021 2:55 pm
by JackZ
You can always use canvas functions to add shadows and effects to achieve some 3D effects out of 2D images, but it's gonna be tricky.
For still objects I would suggest you use images done in an imaging software such as Photoshop or Skinman, the later being vector based, so easier to fine tune.
The image can then be used in a slider.
Skinman is free and some very neat effects can be achieved quite easily.
Jacques
Re: suggestions for engine control quadrant in pure AM
Posted: Mon Jun 07, 2021 5:11 pm
by JackZ
Re: suggestions for engine control quadrant in pure AM
Posted: Mon Jun 07, 2021 6:30 pm
by Roxus
Thanks guys, thats exactly what I'm loking for (though I will struggle to make them graphically as nice as these I think, art is not my forte)
JackZ, was that SkinMan as well ?
Re: suggestions for engine control quadrant in pure AM
Posted: Mon Jun 07, 2021 6:45 pm
by JackZ
Yep, roughly one hour of work. You'll have to create the background and the Dial thumb itself separately. My advice is to use nil for the background, as it is easier to adjust the slat of the lever as an image behind the lever.
Re: suggestions for engine control quadrant in pure AM
Posted: Mon Jun 07, 2021 9:29 pm
by JackZ
My suggestion is also to play with the slider position in your code to emulate the different lever notches.
As the lever slider position is varying between 0 and 1.0, one has to include some test to make the image of the lever jump to the three positions allowed as follow:
Code: Select all
-- Background and text
img_add("slider.png",-10, -12, 200,342)
txt_add("OFF", "font: arimo_bold.ttf; size:20; color: white; halign:left;", 140, 30, 100, 200)
txt_add("DIR", "font: arimo_bold.ttf; size:20; color: white; halign:left;", 140, 128, 100, 200)
txt_add("XFD", "font: arimo_bold.ttf; size:20; color: white; halign:left;", 140, 225, 100, 200)
-- Digital value of the slider position for debugging purposes
value=txt_add("0.00", "font:digital-7-mono.ttf; size:30; color: white; halign:left;", 100, 280, 100, 200)
-- Called when user drags slider to certain position
function callback(position)
txt_set(value,string.format("%0.02f",position))
if position>=0.75 then -- Set the slider position to the very end
slider_set_position(slider_id, 1)
elseif position >=0.25 then -- between 0.75 and 0.25 we consider that the center notch is reached
slider_set_position(slider_id, 0.5)
elseif position>=0 then -- below 0.25 we consider that the first notch is reached
slider_set_position(slider_id, 0)
end
end
-- Create a new slider
slider_id = slider_add_ver(nil, 0, 0, 200,320, "thumb.png", 137, 143, callback)
The same technique can be used for a Flaps lever for example.
But animation wise, if you want to emulate a real lever that rotates around a center axis, that will be a different story.
Jacques
Re: suggestions for engine control quadrant in pure AM
Posted: Tue Jun 08, 2021 5:12 pm
by Roxus
Yep, I did similar thing with my Rotor Brake, only doing something with dataref when it was within a certain range.
One thing I'm trying to think about tho, since I've never been a IRL pilot, do these controls FORCE you (in some way) to do the motion in 2 distinct steps, and if so, how might you do that in AM.
Prolly some sort of "time of last activity > 2000ms" to force a paused as you clunk these instruments from one notch to the next.
Might be overthinking way too much, and prolly wandering OT for "Instrument Graphics Help"
Re: suggestions for engine control quadrant in pure AM
Posted: Tue Jun 08, 2021 6:27 pm
by JackZ
In fact this is not needed in that case, as here you’ll physically move the mouse quite a bit until the lever jumps to the next notch.
If you intend to use a touchscreen the feedback loop might be different, though.
Jacques
Re: suggestions for engine control quadrant in pure AM
Posted: Tue Jun 08, 2021 6:59 pm
by Roxus
Yes, doing touchscreen, and I do expect to use the code to make it "jump" to the middle notch. I was more thinking about how I stop myself from just keeping on sliding passed the notch, and having to do it in 2 phases, like I imagine RL is with these controls. But IDK
Re: suggestions for engine control quadrant in pure AM
Posted: Tue Jun 08, 2021 10:43 pm
by JackZ
Maybe by using the pressed and released properties of the dial.