playMaker

Author Topic: How do you find out a slider's float value when clicking with a mouse?  (Read 1575 times)

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
So I have a pause menu set up.  In it is a slider for volume control.  When I use a mouse to click on it, I have a master audio sound effect play (via component script).  However, it only detects if the value changes and not if it was more or less.  This means the sound played is always the same.  I want to be able to play a higher sound when increasing the sound and a lower sound when decreasing the volume.  2 different sound files.

So I was wondering:  Can you determine the float variable of the mouse click?  if so, I could store it in a variable and compare the 2.  Also, I need to know how to detect the changed event.  That way I can look for the mouse click, compare the 2 floats and play the right sound.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: How do you find out a slider's float value when clicking with a mouse?
« Reply #1 on: February 02, 2015, 04:41:39 PM »
Why not adjust the volume of the sound you play based on the slider?
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
Re: How do you find out a slider's float value when clicking with a mouse?
« Reply #2 on: February 02, 2015, 05:16:22 PM »
I can adjust the volume no problem.   It works.  What I want is a clicking noise to play.  1 noise when the volume goes up and 1 noise when the volume goes down.  Using a joystick, I can compare the last and current float and it works.  The issue is that using the mouse, it only says if the slider changed.  It does not say if it is more or less than before. 

So what I need is a way to determine the slider value and when it changed.  That way I can play 1 or 2 sounds.