no hand icon to grab slider

Questions about deployment and use of Air Manager Instruments

Moderators: Ralph, russ

Post Reply
Message
Author
Roxus
Posts: 57
Joined: Wed Sep 02, 2020 7:30 pm

no hand icon to grab slider

#1 Post by Roxus » Mon Jun 07, 2021 2:07 am

I'm not getting the hand icon when I hover over a slider, and I am unable to slide it (touch or mouse) with AM4.0.1
  1. function callback(position)
  2.  
  3. log(position)
  4.  
  5.     slider_set_position(slider_id, position)
  6.  
  7.     if (position > 0.9 or position < 0.1) then
  8.  
  9.         xpl_dataref_write("sim/cockpit2/switches/rotor_brake","INT",fif(position > 0.9,1,0))
  10.  
  11.     end
  12.  
  13. end
  14.  
  15. slider_id = slider_add_ver(nil, 0, 0, 0, 1000, "handle.png", 70, 150, callback)
  16.  
  17. xpl_dataref_subscribe("sim/cockpit2/switches/rotor_brake", "INT", callback)
I'm only getting logging when XP11 dataref changes, and then the slider moves. But from XP, its a binary on/off, so all it gets is either end
What am I missing ?

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

Re: no hand icon to grab slider

#2 Post by Sling » Mon Jun 07, 2021 7:11 am

Hi Roxus,

That's because you have the width set to 0. Try increasing to 70 or more. i.e. the same or a bit larger than the thumb image width.

Tony

Roxus
Posts: 57
Joined: Wed Sep 02, 2020 7:30 pm

Re: no hand icon to grab slider

#3 Post by Roxus » Mon Jun 07, 2021 1:25 pm

That was it, thank Tony

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests