LambBrainz [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=62600 Slider Bar <p> <table><tr><td> <a href="/bbs/?pid=105793#p"> <img src="/bbs/thumbs/pico8_sliderbar-3.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=105793#p"> sliderbar</a><br><br> by <a href="/bbs/?uid=62600"> LambBrainz</a> <br><br><br> <a href="/bbs/?pid=105793#p"> [Click to Play]</a> </td></tr></table> <br /> I wanted my game to have a slider bar and tried to do it myself from scratch. I couldn't find any examples where someone had made something like this (I could also suck at googling) so I figured I'd post my rough version so that people could improve upon it if they wish.</p> <p>The code is still a bit of a work in progress, but all the main functionality works quite well:</p> <ul> <li>Color changes at set points to add some dynamism (points are roughly hard-coded into fifths)</li> <li>Tick marks show you where the color changes (just a little flair to make it look prettier)</li> <li>One variable is used to keep track of where to put the slider sprite on the X axis as well as how far to fill the bar (you can access this to modify stuff, for example)</li> <li>Minimum and maximum values so the slider sprite stays locked inside the bar</li> </ul> <p>I took some of the mouse code from here: <a href="https://www.lexaloffle.com/bbs/?tid=43344">https://www.lexaloffle.com/bbs/?tid=43344</a><br /> I removed the parts about hovering on stuff as I didn't need that.</p> <p>Let me know what you think! This is my first time posting something so I hope you like it and look forward to some constructive criticism</p> https://www.lexaloffle.com/bbs/?tid=46343 https://www.lexaloffle.com/bbs/?tid=46343 Fri, 28 Jan 2022 03:16:27 UTC