Skip to content

Comments

Add map to scale function#45

Open
KINGTUT10101 wants to merge 3 commits intorxi:masterfrom
KINGTUT10101:master
Open

Add map to scale function#45
KINGTUT10101 wants to merge 3 commits intorxi:masterfrom
KINGTUT10101:master

Conversation

@KINGTUT10101
Copy link

The map to scale function converts a number from one scale to another. A common use case is converting a value between 0 and 1 to another scale, such as 0 to 255. I have found myself using this function quite a bit while working on my games and thought it would be a great addition to this library.

The maptoscale function converts a value from one scale to another.  

Ex: print (lume.maptoscale (1/3, 0, 1, 0, 15)) -- Prints 5.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant