Shape Maker
How do I make an shape maker?
What is a shape maker? How do you make a shape maker? This script and codes were developed by Gregory Potdevin on 01 October 2022, Saturday.
Shape Maker - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Shape Maker</title>
</head>
<body> <pre id="result"/> <script src="js/index.js"></script>
</body>
</html>
Shape Maker - Script Codes JS Codes
var str = ""
function addPath(name, path){ var minX = 1000000, maxX = 0 var minY = 1000000, maxY = 0 path.forEach(function(p){ if (p[0] < minX) minX = p[0] if (p[0] > maxX) maxX = p[0] if (p[1] < minY) minY = p[1] if (p[1] > maxY) maxY = p[1] }) var width = maxX - minX var height = maxY - minY var midX = (maxX + minX)/2 var midY = (maxY + minY)/2 var ratio = 2 / (Math.max(width, height)) str += "Vec2 path" + name + "[] = {<br />" path.forEach(function (p){ str += " Vec2(" str += Math.round(((p[0] - midX)*ratio)*100)/100 str += ", " str += Math.round(((p[1] - midY)*ratio)*100)/100 str += "),<br />" }) str += "};<br /><br />"
}
addPath("Tree", [ [174, 26], [153, 50], [162, 50], [135, 71], [153, 71], [125, 106], [160, 106], [160, 120], [184, 120], [184, 106], [220, 106], [192, 71], [211, 71], [185, 50], [195, 50],
])
addPath("Gift", [ [291, 504], [270, 484], [251, 494], [255, 511], [272, 523], [228, 523], [228, 641], [352, 641], [352, 523], [311, 523], [330, 513], [338, 496], [327, 482], [305, 485],
])
addPath("Candle", [ [543, 558], [529, 580], [526, 602], [536, 617], [546, 618], [547, 625], [525, 625], [525, 762], [490, 762], [490, 782], [615, 782], [615, 762], [580, 762], [580, 625], [550, 625], [550, 618], [562, 605], [562, 597], [544, 575],
])
addPath("Gingerbread", [ [406, 236], [386, 245], [375, 264], [383, 290], [356, 283], [339, 296], [343, 309], [376, 326], [368, 364], [348, 370], [341, 381], [349, 400], [360, 403], [406, 382], [440, 399], [455, 403], [465, 400], [473, 381], [468, 371], [445, 362], [437, 327], [468, 309], [473, 298], [471, 291], [457, 282], [429, 288], [436, 272], [435, 255], [425, 243],
]) document.getElementById("result").innerHTML = str
Developer | Gregory Potdevin |
Username | GregoryPotdevin |
Uploaded | October 01, 2022 |
Rating | 3 |
Size | 2,056 Kb |
Views | 18,216 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Climb | 3,424 Kb |
CheckboxFilter | 5,749 Kb |
RangeInputFilter | 5,221 Kb |
A Pen by Gregory Potdevin | 2,432 Kb |
Turn | 2,437 Kb |
Guass | 1,605 Kb |
Searchkit 0.8 | 4,227 Kb |
Line | 1,781 Kb |
Control | 2,855 Kb |
RangeFilter | 3,831 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Spinners using Font Icons | Keyamoon | 3,007 Kb |
Flying Bee | Pwsm50 | 3,711 Kb |
A Pen by Miro Olma | Programiro | 2,342 Kb |
Review test | Otro_user_gil | 4,054 Kb |
Canvas Fireworks | Jackrugile | 6,200 Kb |
Basic HTML5 Structure | YuvarajTana | 1,289 Kb |
Nested flexbox layout for library catalog | Boycetrus | 3,271 Kb |
Subscription Newsletter - Before inlining | Bradstrong | 7,526 Kb |
Pagepilling.js | Blossk | 6,554 Kb |
Resize image | Happyhj | 1,892 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!