Hey folks,
Is there a Lua or Corona-built-in way to scale a table of values?
I have a table of vertices that I will use with display.newPolygon.
This table is normalized so that all values are between 0 and 1.
I’ll give you an example of a normalized set of vertices that make a star.
local vertices = { 0.5, 0, 0.63, 0.36, 1, 0.4, 0.73, 0.6, 0.81, 1, 0.5, 0.8, 0.19, 1, 0.27, 0.6, 0, 0.4, 0.37, 0.36 }
This set can now have it’s values multiplied by a given scalar (such as the width or height of a frame) so that it is set to that size.
How should I go about multiplying these values?