volume bar

This forum is currently in read-only mode.
  • how can i make a volume bar?

    i mean i want to have in my game in options slider, where i can control sound volume

  • Depends what plugin you're using.

    In XAudio2 I used this forumla to set master volume:

    -40 + ([SOUND VOLUME PERCENTAGE] / 100) * 40)

  • thanks,

    what i need to know is how to make control bar.

    i mean some object (line) with some cursor - and i want this cursor slide from left to right or from right to left and volume will change.

    my biggest problem is that i dont know how to make an object (cursor), which i will drag only in specific location (which behavior?, how to setup it?).

  • Just build one with graphics and events. Here's an example to help you get started: slider.cap

  • thanks, this is great!

    i looked at it. what exactly is "clamp" ?

    there are some many things like this in scirra and i dont know how to use them...

  • I recommend reading the wiki. This is the page explaining the system expressions: scroll down to "Math"

    clamp is just one of many functions that are common to most programming languages. The best practice is to read about them, look for descriptions/examples on the net and try for yourself. Then you are aware of them in case you need them.

    Math functions you will almost always need somewhere somehow:

    sin(), cos(), min(), max(), clamp(), ceil(), floor(), round(), abs(), lerp()

  • thanks, it looks really great.

    but still there are many many things i dont understant (i am not programmer).

    so if there is for example "lerp"- linear interpolation etc... but for me it is very hard to understand what for it really is and how can i use it...

    do you have some link for beginners? i am really bad with it and i really want to learn how to use construct as best as possible (and not only construct, but i want to understand game programming generally).

    or maybe some good book to learn it?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I'm sorry, I can't propose any beginner's guide. I never used one. When I started learning those things, there wasn't any literature for beginners. Normally I suggest to just use those functions (expressions in CC) and learn from analyzing the result (that's the way I did it way back in the early 80s^^)

    However, if you can learn better from being tought, there might be some help. I remember lucid once posted a link to some math site, that made extensive explanations.

    And although I'm no friend of such advices, in this case google might help too ;)

  • ok tulamide :)

    i also learn this way now, but it is soo slow :)

    thanks ;)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)