The Official Blog of Patcoola

Im just a dude watching over my parents,
and trying to make cartoons and video games from home.

Project Knob

Important!

Dear visitors,

This blog and the Tigarus.com network will be changing our website software in May (2024). There will be some down time and there will be a change to the webpage addresses.

We will also be removing the Anime blogs. The Rocksmith Songs website will be unavailable of a few weeks or months while I move the database to the new software.

At the moment we are running on Wordpress, the new software is an in-house project which is 57 times faster. It will also provide more freedom for development.

Thank you for understanding.

, By Patcoola

Project Title: Knob
Programming Language: JavaScript
Date Created: 2022-08-28

Purpose: To provide a behavior class for a knob user interface component.

Description: The knob is a user interface behavior class for providing a rotational alternative to a value slider. Knobs are commonly used in musically applications, and can occupy less space than a value slider.

The knob works by dragging the handle in the circular motion or by click-and-drag from the center of the knob along an x/y axis. The knob auto detects your axis of choice.

Advertisement

Donate Now!

This might not be the best time, but making a blog is not easy. Would you consider donating?


Methods:

knob_class()

The knob class

class.target

Define the element to target, takes an element

class.decimals(int)

Function to format the decimal range of the value

class.setValue(num)

Function to change the current value of the knob

class.getValue()

Function to fetch the value from the knob

class.setMin(num)

Function to define the minimum number range of the value

class.setMax(num)

Function to define the maximum number range of the value

class.setRange(str[“dial”, “axis”], int)

Function to change the dial or axis range. Dial to limit the degrees the knob can rotate. Axis to define how far the x/y range

class.setDeadzone(int)

Function to manually define the dead zone from the center the user’s mouse can not rotate the knob if the mouse if inside the dead zone

class.onchange

Define with a user created function to execute your own event

class.start()

Function to run the behavior

class.stop()

Function to stop the behavior

Style Notes:

The following class names are required to assign the knob behavior.

.knob

.knob-handle

 

Advertisement

Donate Now!

Hey buddy, it takes a lot to make a blog. How about a donation?


 

Post Meta

Share Post

 

Comments: Write Comment

Be the first to write a comment.


Leave a Comment


All comments are reviewed before publishing. Comments must be related to the page topic, must not be spam, and must comply with the criminal code of Canada.