Decidetto [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=45346 Classic Solitaire <p>Since we've already got classic Minesweeper by <a href="https://www.lexaloffle.com/bbs/?uid=92079"> @TeamPuzel</a> (and because someone in the thread very specifically suggested it) I felt like starting on Solitaire to add to the classic Windows games collection!</p> <img style="margin-bottom:16px" border=0 src="/media/45346/Picotron solitaire 1.png" alt="" /> <p>It's mostly just graphics for now and a little bit of UI work to get it in a window. I'm still working on the Queen and King card graphics, but wanted to get this out there for perhaps some feedback on the trajectory I'm on.</p> <p>No promises about when it'll be done--I'm mostly into doing graphics but am looking forward to tackling the challenge of getting it functional too.</p> <p>I hope I've managed to strike the right balance between authenticity and low-res adaptation in a softer, more &quot;Picotron&quot; colour palette!</p> https://www.lexaloffle.com/bbs/?tid=140844 https://www.lexaloffle.com/bbs/?tid=140844 Mon, 18 Mar 2024 02:53:42 UTC How to deal with variable character width? <p>I'm writing a simple toy program to get familiar with the API. </p> <p>I have a string, &quot;Hello World!&quot;, that I am intending to print centred horizontally and vertically, adapting to window dimensions on the fly.<br /> In the top line in the screenshot I am printing it in one go, in the bottom line I am printing it letter by letter to enable a &quot;rainbow&quot; effect.</p> <img style="margin-bottom:16px" border=0 src="/media/45346/15_charwidth.png" alt="" /> <p>I noticed the two strings are spaced differently, and I realised Picotron in fact uses a variable-width font. I was allotting 5 pixels for each character in my printing routine, but as it turns out the lowercase &quot;l&quot; is one pixel narrower, while the uppercase &quot;W&quot; is one pixel wider.</p> <p>How do I deal with the variable width of characters for printing and layout work? Is there an API function to get the exact dimensions of a character?</p> <p>My code:<br /> <div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"></p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>---[[ Comment/uncomment to run fullscreen/windowed window{ width = 240, height = 120+32, title = &quot;Tester&quot; } --]] text=&quot;Hello World!&quot; function _draw() local width = get_display():width() local height = get_display():height() local align = width/2-((string.len(text)-1)*5/2) -- Assuming char width 5 cls() --Print all text in one go print(text, align, height/2-8, 9) --Print text letter by letter for i = 1,string.len(text) do print(string.sub(text,i,i),align+5*(i-1),height/2+4,i) -- Assuming char width 5 end --Print CPU usage print(stat(1), width-48, height-7) end function _update() end</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p></div></div></div></p> <p>Incidentally, is there a more compact method of accessing individual characters in a string like was added in PICO-8 (<code>string[i]</code>), or are we expected to purely use the Lua method in Picotron (<code>string.sub(string,i,i)</code>)?</p> https://www.lexaloffle.com/bbs/?tid=140683 https://www.lexaloffle.com/bbs/?tid=140683 Fri, 15 Mar 2024 15:40:12 UTC RESOLVED! (No 'Lexaloffle Account Activation' for Picotron yet?) <p>EDIT: The issue has been resolved! You can find your Lexaloffle key at the top of the Humble purchase page!</p> <p>=================</p> <p>Congrats on the release, <a href="https://www.lexaloffle.com/bbs/?uid=1"> @zep</a>! Just purchased Picotron. I've been watching its development with an excited glimmer in my eyes over the years! It really looks like the perfect mix of specs (really excited about the wavetable sound in particular!) and I'm excited to start exploring my creativity with it.</p> <p>I've been looking at how to add the product to my Lexaloffle account following the instructions on this page <a href="https://www.lexaloffle.com/account.php?page=activate">https://www.lexaloffle.com/account.php?page=activate</a>, but have not had any luck with it. Is it correct that the Humble purchases page for Picotron simply does not have the 'Lexaloffle Account Activation' button yet?</p> https://www.lexaloffle.com/bbs/?tid=140649 https://www.lexaloffle.com/bbs/?tid=140649 Thu, 14 Mar 2024 20:37:58 UTC