<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
  xmlns:atom="http://www.w3.org/2005/Atom"
  xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Tym17&#39;s blog</title>
    <link>http://Tym17.com/</link>
    <atom:link href="/feed.xml" rel="self" type="application/rss+xml"/>
    
    <description>I like creating and discovering stuff.</description>
    <pubDate>Mon, 11 May 2020 19:11:08 GMT</pubDate>
    <generator>http://hexo.io/</generator>
    
    <item>
      <title>Code Libre #2</title>
      <link>http://Tym17.com/2018/09/17/002-code-libre-2/</link>
      <guid>http://Tym17.com/2018/09/17/002-code-libre-2/</guid>
      <pubDate>Mon, 17 Sep 2018 20:47:18 GMT</pubDate>
      <description>
      
        
        
          
          
            &lt;h2 id=&quot;Code-Libre&quot;&gt;&lt;a href=&quot;#Code-Libre&quot; class=&quot;headerlink&quot; title=&quot;Code Libre&quot;&gt;&lt;/a&gt;Code Libre&lt;/h2&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Welcome on this 2nd edition of my monthly blogging challenge, Code Libre! You can check the &lt;a href=&quot;/2018/08/17/code-libre-1/&quot;&gt;previous post&lt;/a&gt; if you think you missed anything or just want a recap of what this serie of blog posts. Here’s a quick recap: Code Libre is a short list of cool open-source projects I’ve found while browsing the Internet. Sometimes I do test them, sometimes I don’t.&lt;/p&gt;
&lt;h2 id=&quot;Electron-wallpaper&quot;&gt;&lt;a href=&quot;#Electron-wallpaper&quot; class=&quot;headerlink&quot; title=&quot;Electron-wallpaper&quot;&gt;&lt;/a&gt;Electron-wallpaper&lt;/h2&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;I’ve always been a fan of conky and rainmeter but when I used them, they required specific scripting tools and language to use them and build with them. In fact, the most advanced setup I had with conky years ago was showing the date with a custom font. Now with this node module, you can use an &lt;a href=&quot;https://electronjs.org/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Electron&lt;/a&gt; window instead. That means that instead of using lua code or xml config files to customize your fancy dynamic wallpaper, you now only need to know HTML, JS and CSS. It also means that the code you write for your animated dashboard could potentially be cross-platform. I did not however find or look into any equivalent for Linux node modules, so this is Windows only.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/robinwassen/electron-wallpaper&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Project’s repository&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;Phalcon&quot;&gt;&lt;a href=&quot;#Phalcon&quot; class=&quot;headerlink&quot; title=&quot;Phalcon&quot;&gt;&lt;/a&gt;Phalcon&lt;/h2&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Since PHP is a scripting language that can take extensions made in C, we can imagine that maybe some day, someone will actually use this ability to write quicker PHP applications. And this is just what this framework does. It leverages the speed of C and allows PHP developers to keep using a language they already know while taking advantage of a much faster framework. I still think I would stick to Symfony for PHP applications, but this is still a very interesting technology!&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://phalconphp.com/en/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Project’s website&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/phalcon/cphalcon&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Project’s repository&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;Mastodon&quot;&gt;&lt;a href=&quot;#Mastodon&quot; class=&quot;headerlink&quot; title=&quot;Mastodon&quot;&gt;&lt;/a&gt;Mastodon&lt;/h2&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;A decentralized social media platform. Anyone can setup a Mastodon instance and monitor it as they please but the best part is that each Mastodon instances can communicate to each other. In a way, this could be social medias going back to mail servers where everything was decentralized and mail servers used to send mails back and forth each others. This is not only great because with this solution, one can speak freely without fear of censorship and because the network of instances should be able to standup and still work if another instance is taken down.&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;This isn’t the first time I’ve seen open-source social media alternatives however this one seems to have a significant community and this is very good! When comparing to a similar open-source project that I’ve discovered years before: &lt;a href=&quot;http://pump.io/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;pump.io&lt;/a&gt;, Mastodon have almost 10 times the number of Forks and Stars on Github. I love this idea of social media platform where each instance of the platform can pull and push data from another instance. I wish more people would turn to open-source alternative as this would - I think - free us from issues we have with the giants.&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;I’ve also heard of a blogging system named &lt;a href=&quot;https://github.com/Plume-org/Plume&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Plume&lt;/a&gt; that could potentially plug into Mastodon as well as work in a similar fashion. Yet another interesting decentralized media!&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://joinmastodon.org/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Project’s website&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;Open-source-Rover&quot;&gt;&lt;a href=&quot;#Open-source-Rover&quot; class=&quot;headerlink&quot; title=&quot;Open-source Rover&quot;&gt;&lt;/a&gt;Open-source Rover&lt;/h2&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Last but not least, the JPL Open Source Rover project! NASA recently open-sourced a 6-wheel rover based on the one that is on Mars. This version of the rover is also designed to be accessible to everyone and “inspire the next generation of scientists, engineers and roboticists”. They give most of the details required to build the robot, going from the parts to the steps to actually build it!&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/nasa-jpl/open-source-rover&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Project’s repository&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;That’s-it&quot;&gt;&lt;a href=&quot;#That’s-it&quot; class=&quot;headerlink&quot; title=&quot;That’s it&quot;&gt;&lt;/a&gt;That’s it&lt;/h2&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;I hope you enjoyed this post! I decided to not use any kind of analytic software to track the readers so having feedback means a lot! So how about you, do you &lt;em&gt;explore&lt;/em&gt; Github too sometimes? Have you found any interesting stuff? I would love to hear your opinion and/or your feedback! I’ll see you next time
          
        
      
      </description>
      
      <content:encoded><![CDATA[<h2 id="Code-Libre"><a href="#Code-Libre" class="headerlink" title="Code Libre"></a>Code Libre</h2><p>&nbsp;&nbsp;&nbsp;Welcome on this 2nd edition of my monthly blogging challenge, Code Libre! You can check the <a href="/2018/08/17/code-libre-1/">previous post</a> if you think you missed anything or just want a recap of what this serie of blog posts. Here’s a quick recap: Code Libre is a short list of cool open-source projects I’ve found while browsing the Internet. Sometimes I do test them, sometimes I don’t.</p><h2 id="Electron-wallpaper"><a href="#Electron-wallpaper" class="headerlink" title="Electron-wallpaper"></a>Electron-wallpaper</h2><p>&nbsp;&nbsp;&nbsp;I’ve always been a fan of conky and rainmeter but when I used them, they required specific scripting tools and language to use them and build with them. In fact, the most advanced setup I had with conky years ago was showing the date with a custom font. Now with this node module, you can use an <a href="https://electronjs.org/" target="_blank" rel="noopener">Electron</a> window instead. That means that instead of using lua code or xml config files to customize your fancy dynamic wallpaper, you now only need to know HTML, JS and CSS. It also means that the code you write for your animated dashboard could potentially be cross-platform. I did not however find or look into any equivalent for Linux node modules, so this is Windows only.</p><ul><li><a href="https://github.com/robinwassen/electron-wallpaper" target="_blank" rel="noopener">Project’s repository</a></li></ul><h2 id="Phalcon"><a href="#Phalcon" class="headerlink" title="Phalcon"></a>Phalcon</h2><p>&nbsp;&nbsp;&nbsp;Since PHP is a scripting language that can take extensions made in C, we can imagine that maybe some day, someone will actually use this ability to write quicker PHP applications. And this is just what this framework does. It leverages the speed of C and allows PHP developers to keep using a language they already know while taking advantage of a much faster framework. I still think I would stick to Symfony for PHP applications, but this is still a very interesting technology!</p><ul><li><a href="https://phalconphp.com/en/" target="_blank" rel="noopener">Project’s website</a></li><li><a href="https://github.com/phalcon/cphalcon" target="_blank" rel="noopener">Project’s repository</a></li></ul><h2 id="Mastodon"><a href="#Mastodon" class="headerlink" title="Mastodon"></a>Mastodon</h2><p>&nbsp;&nbsp;&nbsp;A decentralized social media platform. Anyone can setup a Mastodon instance and monitor it as they please but the best part is that each Mastodon instances can communicate to each other. In a way, this could be social medias going back to mail servers where everything was decentralized and mail servers used to send mails back and forth each others. This is not only great because with this solution, one can speak freely without fear of censorship and because the network of instances should be able to standup and still work if another instance is taken down.<br>&nbsp;&nbsp;&nbsp;This isn’t the first time I’ve seen open-source social media alternatives however this one seems to have a significant community and this is very good! When comparing to a similar open-source project that I’ve discovered years before: <a href="http://pump.io/" target="_blank" rel="noopener">pump.io</a>, Mastodon have almost 10 times the number of Forks and Stars on Github. I love this idea of social media platform where each instance of the platform can pull and push data from another instance. I wish more people would turn to open-source alternative as this would - I think - free us from issues we have with the giants.<br>&nbsp;&nbsp;&nbsp;I’ve also heard of a blogging system named <a href="https://github.com/Plume-org/Plume" target="_blank" rel="noopener">Plume</a> that could potentially plug into Mastodon as well as work in a similar fashion. Yet another interesting decentralized media!</p><ul><li><a href="https://joinmastodon.org/" target="_blank" rel="noopener">Project’s website</a></li></ul><h2 id="Open-source-Rover"><a href="#Open-source-Rover" class="headerlink" title="Open-source Rover"></a>Open-source Rover</h2><p>&nbsp;&nbsp;&nbsp;Last but not least, the JPL Open Source Rover project! NASA recently open-sourced a 6-wheel rover based on the one that is on Mars. This version of the rover is also designed to be accessible to everyone and “inspire the next generation of scientists, engineers and roboticists”. They give most of the details required to build the robot, going from the parts to the steps to actually build it!</p><ul><li><a href="https://github.com/nasa-jpl/open-source-rover" target="_blank" rel="noopener">Project’s repository</a></li></ul><h2 id="That’s-it"><a href="#That’s-it" class="headerlink" title="That’s it"></a>That’s it</h2><p>&nbsp;&nbsp;&nbsp;I hope you enjoyed this post! I decided to not use any kind of analytic software to track the readers so having feedback means a lot! So how about you, do you <em>explore</em> Github too sometimes? Have you found any interesting stuff? I would love to hear your opinion and/or your feedback! I’ll see you next time :).</p><p>-Tym</p>]]></content:encoded>
      
      <comments>http://Tym17.com/2018/09/17/002-code-libre-2/#disqus_thread</comments>
    </item>
    
    <item>
      <title>MyGUI #2: Advanced behaviours &amp; limitations</title>
      <link>http://Tym17.com/2018/08/18/001-my-gui-engine-pt2/</link>
      <guid>http://Tym17.com/2018/08/18/001-my-gui-engine-pt2/</guid>
      <pubDate>Sat, 18 Aug 2018 15:25:18 GMT</pubDate>
      <description>
      
        
        
          
          
            &lt;h2 id=&quot;Previously-on-MyGUI&quot;&gt;&lt;a href=&quot;#Previously-on-MyGUI&quot; class=&quot;headerlink&quot; title=&quot;Previously on MyGUI&quot;&gt;&lt;/a&gt;Previously on MyGUI&lt;/h2&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;I presented the system of dynamic anchors that allowed an element of the GUI to use positions or sizes based either on a percentage of the window either on a fixed pixel size. I also explained a bit how it works under the hood. You can check the whole post &lt;a href=&quot;/2018/07/01/gui-engine-pt1/&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;Dynamic-Anchors&quot;&gt;&lt;a href=&quot;#Dynamic-Anchors&quot; class=&quot;headerlink&quot; title=&quot;Dynamic Anchors&quot;&gt;&lt;/a&gt;Dynamic Anchors&lt;/h2&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;That system to represent the sizes and positions allowed me to create a dependence on the position of another anchor. An anchor can now depend on another’s position. This allows the user to create a unified widget out of multiple different components such as a modal with a line of text and a button. In order to do this, I implemented a system of observers in the Anchor class so when the window is resized or the anchors are changed, they will notify their observers so they can make the change too. This is particularly useful when you want to make a widget that can be moved with his inner components together.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/assets/mygui/relativeposti.gif&quot; alt&gt; &lt;em&gt;The red Debug text has its anchors relative to the cyan rectangle.&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;Responsive-Skinning&quot;&gt;&lt;a href=&quot;#Responsive-Skinning&quot; class=&quot;headerlink&quot; title=&quot;Responsive Skinning&quot;&gt;&lt;/a&gt;Responsive Skinning&lt;/h2&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Since the GUI is supposed to be adaptable to any window size, the skinning of the GUI elements should be able to stretch without loosing its look. My solution to this is similar to the way the Unity Engine handles its GUI components. It takes a texture and then splits the texture in 9 different parts. Each part is used at a different place of the element. The sprite is split in a way that a pixel is left at the middle of each part. That way when the middle parts are stretched it will not look different because it is only one pixel. Here is an example with a sprite having a letter in each corner.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/assets/mygui/skinnable.gif&quot; alt&gt; &lt;em&gt;Regardless of the size of the window, the letters in the corners stays the same size.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;While this is pretty handy to have components with responsive styles, this comes at a cost. For some components like a button it requires 3 different skins, one for the basic state, one for the hover state and the other one for when the user is actually clicking on the button. &lt;/p&gt;
&lt;h2 id=&quot;Current-limitations&quot;&gt;&lt;a href=&quot;#Current-limitations&quot; class=&quot;headerlink&quot; title=&quot;Current limitations&quot;&gt;&lt;/a&gt;Current limitations&lt;/h2&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;The Anchor system is way too complicated and requires a factory to complete all the parameters in a simple and quick manner. An other issue is the number of parameters a component requires. A simple button requires 4 anchors, 3 skins, 3 colors and more…&lt;/p&gt;
&lt;figure class=&quot;highlight c++&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;2&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;3&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;4&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;5&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;6&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;7&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;8&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;ActionButton(sf::RenderWindow &amp;amp;, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;built_in&quot;&gt;std&lt;/span&gt;::function&amp;lt;&lt;span class=&quot;keyword&quot;&gt;void&lt;/span&gt;()&amp;gt;,&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;	&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;built_in&quot;&gt;std&lt;/span&gt;::&lt;span class=&quot;built_in&quot;&gt;string&lt;/span&gt; &amp;amp;txt, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; sf::Font &amp;amp;font,&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;	Anchor pX, Anchor pY, Anchor sX, Anchor sY,&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;	&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; Skin &amp;amp;off, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; Skin &amp;amp;on, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; Skin &amp;amp;hovered,&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;	&lt;span class=&quot;keyword&quot;&gt;int&lt;/span&gt; charSize = &lt;span class=&quot;number&quot;&gt;16&lt;/span&gt;, sf::Color textColor = sf::Color::Red,&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;	sf::Color hoverColor = sf::Color::Red,&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;	sf::Color triggerColor = sf::Color::Red,&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;	&lt;span class=&quot;keyword&quot;&gt;bool&lt;/span&gt; show = &lt;span class=&quot;literal&quot;&gt;true&lt;/span&gt;);&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;It’s not that good, it makes the process of creating the elements way too complicated. The same goes for the component interface that every component is supposed to have. Some components require being able to react specifically to some events so more methods are added to the interface but that only creates more methods that aren’t used in already existing component or simple ones. Here is what this interface looks like at the moment this post is published: &lt;/p&gt;
&lt;figure class=&quot;highlight c++&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;2&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;3&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;4&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;5&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;6&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;7&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;8&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;9&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;10&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;11&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;12&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;13&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;14&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;15&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;16&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;17&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;18&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;19&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;20&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;21&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;22&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;23&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;24&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;25&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;26&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;27&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;28&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;29&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;30&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;31&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;class&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;title&quot;&gt;IComponent&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;class&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    &lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt;:&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; ~IComponent() &amp;#123;&amp;#125;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        &lt;span class=&quot;comment&quot;&gt;/**&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;comment&quot;&gt;        * @return true if has to be drawn&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;comment&quot;&gt;        */&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        &lt;span class=&quot;function&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;bool&lt;/span&gt; &lt;span class=&quot;title&quot;&gt;isVisible&lt;/span&gt;&lt;span class=&quot;params&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;/span&gt;= &lt;span class=&quot;number&quot;&gt;0&lt;/span&gt;;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        &lt;span class=&quot;function&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;title&quot;&gt;setVisible&lt;/span&gt;&lt;span class=&quot;params&quot;&gt;(&lt;span class=&quot;keyword&quot;&gt;bool&lt;/span&gt;)&lt;/span&gt; &lt;/span&gt;= &lt;span class=&quot;number&quot;&gt;0&lt;/span&gt;;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        &lt;span class=&quot;comment&quot;&gt;/**&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;comment&quot;&gt;        * @return true if mouse is in hot zone&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;comment&quot;&gt;        */&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        &lt;span class=&quot;function&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;bool&lt;/span&gt; &lt;span class=&quot;title&quot;&gt;isIn&lt;/span&gt;&lt;span class=&quot;params&quot;&gt;(&lt;span class=&quot;keyword&quot;&gt;float&lt;/span&gt; x, &lt;span class=&quot;keyword&quot;&gt;float&lt;/span&gt; y)&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;/span&gt;= &lt;span class=&quot;number&quot;&gt;0&lt;/span&gt;;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        &lt;span class=&quot;function&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;title&quot;&gt;trigger&lt;/span&gt;&lt;span class=&quot;params&quot;&gt;()&lt;/span&gt; &lt;/span&gt;= &lt;span class=&quot;number&quot;&gt;0&lt;/span&gt;;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        &lt;span class=&quot;function&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;title&quot;&gt;unTrigger&lt;/span&gt;&lt;span class=&quot;params&quot;&gt;()&lt;/span&gt; &lt;/span&gt;= &lt;span class=&quot;number&quot;&gt;0&lt;/span&gt;;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        &lt;span class=&quot;function&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;title&quot;&gt;hover&lt;/span&gt;&lt;span class=&quot;params&quot;&gt;(&lt;span class=&quot;keyword&quot;&gt;float&lt;/span&gt; elapsed)&lt;/span&gt; &lt;/span&gt;= &lt;span class=&quot;number&quot;&gt;0&lt;/span&gt;;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        &lt;span class=&quot;function&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;bool&lt;/span&gt; &lt;span class=&quot;title&quot;&gt;isHover&lt;/span&gt;&lt;span class=&quot;params&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;/span&gt;= &lt;span class=&quot;number&quot;&gt;0&lt;/span&gt;;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        &lt;span class=&quot;function&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;title&quot;&gt;unHover&lt;/span&gt;&lt;span class=&quot;params&quot;&gt;()&lt;/span&gt; &lt;/span&gt;= &lt;span class=&quot;number&quot;&gt;0&lt;/span&gt;;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        &lt;span class=&quot;function&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;bool&lt;/span&gt; &lt;span class=&quot;title&quot;&gt;isActive&lt;/span&gt;&lt;span class=&quot;params&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;/span&gt;= &lt;span class=&quot;number&quot;&gt;0&lt;/span&gt;;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        &lt;span class=&quot;function&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;title&quot;&gt;setActive&lt;/span&gt;&lt;span class=&quot;params&quot;&gt;(&lt;span class=&quot;keyword&quot;&gt;bool&lt;/span&gt;)&lt;/span&gt; &lt;/span&gt;= &lt;span class=&quot;number&quot;&gt;0&lt;/span&gt;;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        &lt;span class=&quot;function&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;title&quot;&gt;triggerKey&lt;/span&gt;&lt;span class=&quot;params&quot;&gt;(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; sf::Event &amp;amp;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;function&quot;&gt;&lt;span class=&quot;params&quot;&gt;                                &lt;span class=&quot;keyword&quot;&gt;float&lt;/span&gt; elapsed)&lt;/span&gt; &lt;/span&gt;= &lt;span class=&quot;number&quot;&gt;0&lt;/span&gt;;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        &lt;span class=&quot;function&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;title&quot;&gt;update&lt;/span&gt;&lt;span class=&quot;params&quot;&gt;(&lt;span class=&quot;keyword&quot;&gt;float&lt;/span&gt; elapsed)&lt;/span&gt; &lt;/span&gt;= &lt;span class=&quot;number&quot;&gt;0&lt;/span&gt;;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        &lt;span class=&quot;function&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;title&quot;&gt;draw&lt;/span&gt;&lt;span class=&quot;params&quot;&gt;(&lt;span class=&quot;keyword&quot;&gt;float&lt;/span&gt; elapsed)&lt;/span&gt; &lt;/span&gt;= &lt;span class=&quot;number&quot;&gt;0&lt;/span&gt;;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        &lt;span class=&quot;comment&quot;&gt;/*       /!\         /!\         /!\         /!\&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;comment&quot;&gt;        ** if creating a new component, don&#39;t forget to add &lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;comment&quot;&gt;        ** observers to Anchors in the component&#39;s constructor&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;comment&quot;&gt;        */&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        &lt;span class=&quot;function&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;title&quot;&gt;resize&lt;/span&gt;&lt;span class=&quot;params&quot;&gt;(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; sf::Window &amp;amp;)&lt;/span&gt; &lt;/span&gt;= &lt;span class=&quot;number&quot;&gt;0&lt;/span&gt;;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        &lt;span class=&quot;function&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;bool&lt;/span&gt; &lt;span class=&quot;title&quot;&gt;propagateAfter&lt;/span&gt;&lt;span class=&quot;params&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;/span&gt;= &lt;span class=&quot;number&quot;&gt;0&lt;/span&gt;;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&amp;#125;;&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Adding to the cost of having to handle so many parameters or so many useless methods when creating a new UI component, the developer has to store and handle the Skin objects and carry them everywhere he wants to create a new component or widget. This also prevents the creation of a default look for the GUI. Some application might not require such advanced behaviour regarding the skinning of the GUI elements.&lt;/p&gt;
&lt;h2 id=&quot;Takeaway&quot;&gt;&lt;a href=&quot;#Takeaway&quot; class=&quot;headerlink&quot; title=&quot;Takeaway&quot;&gt;&lt;/a&gt;Takeaway&lt;/h2&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;I am not satisfied with the result of this GUI engine and I’ll probably start over a third time but like the last time, I learned a lot while doing so. I am not sure yet if I’ll make this attempt open-source or not, but I probably will in some time. Here are the things I’ll try to avoid when creating the next iteration of my GUI engine:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Way too many methods in the component interface.&lt;/li&gt;
&lt;li&gt;Creating a simple component is too complex.&lt;/li&gt;
&lt;li&gt;Lack of default theme.&lt;/li&gt;
&lt;li&gt;Using Visual Studio as only build reference for the project.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;An other thing I would like to keep in mind for the next version is the ability to use the GUI engine in a simple SFML project without requiring the states system I started with. That way, anyone could use this GUI library without as much restrictions. I hope you enjoyed this post
          
        
      
      </description>
      
      <content:encoded><![CDATA[<h2 id="Previously-on-MyGUI"><a href="#Previously-on-MyGUI" class="headerlink" title="Previously on MyGUI"></a>Previously on MyGUI</h2><p>&nbsp;&nbsp;&nbsp;I presented the system of dynamic anchors that allowed an element of the GUI to use positions or sizes based either on a percentage of the window either on a fixed pixel size. I also explained a bit how it works under the hood. You can check the whole post <a href="/2018/07/01/gui-engine-pt1/">here</a>.</p><h2 id="Dynamic-Anchors"><a href="#Dynamic-Anchors" class="headerlink" title="Dynamic Anchors"></a>Dynamic Anchors</h2><p>&nbsp;&nbsp;&nbsp;That system to represent the sizes and positions allowed me to create a dependence on the position of another anchor. An anchor can now depend on another’s position. This allows the user to create a unified widget out of multiple different components such as a modal with a line of text and a button. In order to do this, I implemented a system of observers in the Anchor class so when the window is resized or the anchors are changed, they will notify their observers so they can make the change too. This is particularly useful when you want to make a widget that can be moved with his inner components together.</p><p><img src="/assets/mygui/relativeposti.gif" alt> <em>The red Debug text has its anchors relative to the cyan rectangle.</em></p><h2 id="Responsive-Skinning"><a href="#Responsive-Skinning" class="headerlink" title="Responsive Skinning"></a>Responsive Skinning</h2><p>&nbsp;&nbsp;&nbsp;Since the GUI is supposed to be adaptable to any window size, the skinning of the GUI elements should be able to stretch without loosing its look. My solution to this is similar to the way the Unity Engine handles its GUI components. It takes a texture and then splits the texture in 9 different parts. Each part is used at a different place of the element. The sprite is split in a way that a pixel is left at the middle of each part. That way when the middle parts are stretched it will not look different because it is only one pixel. Here is an example with a sprite having a letter in each corner.</p><p><img src="/assets/mygui/skinnable.gif" alt> <em>Regardless of the size of the window, the letters in the corners stays the same size.</em></p><p>&nbsp;&nbsp;&nbsp;While this is pretty handy to have components with responsive styles, this comes at a cost. For some components like a button it requires 3 different skins, one for the basic state, one for the hover state and the other one for when the user is actually clicking on the button. </p><h2 id="Current-limitations"><a href="#Current-limitations" class="headerlink" title="Current limitations"></a>Current limitations</h2><p>&nbsp;&nbsp;&nbsp;The Anchor system is way too complicated and requires a factory to complete all the parameters in a simple and quick manner. An other issue is the number of parameters a component requires. A simple button requires 4 anchors, 3 skins, 3 colors and more…</p><figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">ActionButton(sf::RenderWindow &amp;, <span class="keyword">const</span> <span class="built_in">std</span>::function&lt;<span class="keyword">void</span>()&gt;,</span><br><span class="line"><span class="keyword">const</span> <span class="built_in">std</span>::<span class="built_in">string</span> &amp;txt, <span class="keyword">const</span> sf::Font &amp;font,</span><br><span class="line">Anchor pX, Anchor pY, Anchor sX, Anchor sY,</span><br><span class="line"><span class="keyword">const</span> Skin &amp;off, <span class="keyword">const</span> Skin &amp;on, <span class="keyword">const</span> Skin &amp;hovered,</span><br><span class="line"><span class="keyword">int</span> charSize = <span class="number">16</span>, sf::Color textColor = sf::Color::Red,</span><br><span class="line">sf::Color hoverColor = sf::Color::Red,</span><br><span class="line">sf::Color triggerColor = sf::Color::Red,</span><br><span class="line"><span class="keyword">bool</span> show = <span class="literal">true</span>);</span><br></pre></td></tr></table></figure><p>&nbsp;&nbsp;&nbsp;It’s not that good, it makes the process of creating the elements way too complicated. The same goes for the component interface that every component is supposed to have. Some components require being able to react specifically to some events so more methods are added to the interface but that only creates more methods that aren’t used in already existing component or simple ones. Here is what this interface looks like at the moment this post is published: </p><figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">IComponent</span></span></span><br><span class="line"><span class="class">&#123;</span></span><br><span class="line">    <span class="keyword">public</span>:</span><br><span class="line">        <span class="keyword">virtual</span> ~IComponent() &#123;&#125;</span><br><span class="line">        <span class="comment">/**</span></span><br><span class="line"><span class="comment">        * @return true if has to be drawn</span></span><br><span class="line"><span class="comment">        */</span></span><br><span class="line">        <span class="function"><span class="keyword">virtual</span> <span class="keyword">bool</span> <span class="title">isVisible</span><span class="params">()</span> <span class="keyword">const</span> </span>= <span class="number">0</span>;</span><br><span class="line">        <span class="function"><span class="keyword">virtual</span> <span class="keyword">void</span> <span class="title">setVisible</span><span class="params">(<span class="keyword">bool</span>)</span> </span>= <span class="number">0</span>;</span><br><span class="line">        <span class="comment">/**</span></span><br><span class="line"><span class="comment">        * @return true if mouse is in hot zone</span></span><br><span class="line"><span class="comment">        */</span></span><br><span class="line">        <span class="function"><span class="keyword">virtual</span> <span class="keyword">bool</span> <span class="title">isIn</span><span class="params">(<span class="keyword">float</span> x, <span class="keyword">float</span> y)</span> <span class="keyword">const</span> </span>= <span class="number">0</span>;</span><br><span class="line">        <span class="function"><span class="keyword">virtual</span> <span class="keyword">void</span> <span class="title">trigger</span><span class="params">()</span> </span>= <span class="number">0</span>;</span><br><span class="line">        <span class="function"><span class="keyword">virtual</span> <span class="keyword">void</span> <span class="title">unTrigger</span><span class="params">()</span> </span>= <span class="number">0</span>;</span><br><span class="line">        <span class="function"><span class="keyword">virtual</span> <span class="keyword">void</span> <span class="title">hover</span><span class="params">(<span class="keyword">float</span> elapsed)</span> </span>= <span class="number">0</span>;</span><br><span class="line">        <span class="function"><span class="keyword">virtual</span> <span class="keyword">bool</span> <span class="title">isHover</span><span class="params">()</span> <span class="keyword">const</span> </span>= <span class="number">0</span>;</span><br><span class="line">        <span class="function"><span class="keyword">virtual</span> <span class="keyword">void</span> <span class="title">unHover</span><span class="params">()</span> </span>= <span class="number">0</span>;</span><br><span class="line">        <span class="function"><span class="keyword">virtual</span> <span class="keyword">bool</span> <span class="title">isActive</span><span class="params">()</span> <span class="keyword">const</span> </span>= <span class="number">0</span>;</span><br><span class="line">        <span class="function"><span class="keyword">virtual</span> <span class="keyword">void</span> <span class="title">setActive</span><span class="params">(<span class="keyword">bool</span>)</span> </span>= <span class="number">0</span>;</span><br><span class="line">        <span class="function"><span class="keyword">virtual</span> <span class="keyword">void</span> <span class="title">triggerKey</span><span class="params">(<span class="keyword">const</span> sf::Event &amp;,</span></span></span><br><span class="line"><span class="function"><span class="params">                                <span class="keyword">float</span> elapsed)</span> </span>= <span class="number">0</span>;</span><br><span class="line">        <span class="function"><span class="keyword">virtual</span> <span class="keyword">void</span> <span class="title">update</span><span class="params">(<span class="keyword">float</span> elapsed)</span> </span>= <span class="number">0</span>;</span><br><span class="line">        <span class="function"><span class="keyword">virtual</span> <span class="keyword">void</span> <span class="title">draw</span><span class="params">(<span class="keyword">float</span> elapsed)</span> </span>= <span class="number">0</span>;</span><br><span class="line">        <span class="comment">/*       /!\         /!\         /!\         /!\</span></span><br><span class="line"><span class="comment">        ** if creating a new component, don't forget to add </span></span><br><span class="line"><span class="comment">        ** observers to Anchors in the component's constructor</span></span><br><span class="line"><span class="comment">        */</span></span><br><span class="line">        <span class="function"><span class="keyword">virtual</span> <span class="keyword">void</span> <span class="title">resize</span><span class="params">(<span class="keyword">const</span> sf::Window &amp;)</span> </span>= <span class="number">0</span>;</span><br><span class="line">        <span class="function"><span class="keyword">virtual</span> <span class="keyword">bool</span> <span class="title">propagateAfter</span><span class="params">()</span> <span class="keyword">const</span> </span>= <span class="number">0</span>;</span><br><span class="line">&#125;;</span><br></pre></td></tr></table></figure><p>&nbsp;&nbsp;&nbsp;Adding to the cost of having to handle so many parameters or so many useless methods when creating a new UI component, the developer has to store and handle the Skin objects and carry them everywhere he wants to create a new component or widget. This also prevents the creation of a default look for the GUI. Some application might not require such advanced behaviour regarding the skinning of the GUI elements.</p><h2 id="Takeaway"><a href="#Takeaway" class="headerlink" title="Takeaway"></a>Takeaway</h2><p>&nbsp;&nbsp;&nbsp;I am not satisfied with the result of this GUI engine and I’ll probably start over a third time but like the last time, I learned a lot while doing so. I am not sure yet if I’ll make this attempt open-source or not, but I probably will in some time. Here are the things I’ll try to avoid when creating the next iteration of my GUI engine:</p><ul><li>Way too many methods in the component interface.</li><li>Creating a simple component is too complex.</li><li>Lack of default theme.</li><li>Using Visual Studio as only build reference for the project.</li></ul><p>&nbsp;&nbsp;&nbsp;An other thing I would like to keep in mind for the next version is the ability to use the GUI engine in a simple SFML project without requiring the states system I started with. That way, anyone could use this GUI library without as much restrictions. I hope you enjoyed this post :).</p><p>-Tym</p>]]></content:encoded>
      
      <comments>http://Tym17.com/2018/08/18/001-my-gui-engine-pt2/#disqus_thread</comments>
    </item>
    
    <item>
      <title>Code Libre #1</title>
      <link>http://Tym17.com/2018/08/17/code-libre-1/</link>
      <guid>http://Tym17.com/2018/08/17/code-libre-1/</guid>
      <pubDate>Fri, 17 Aug 2018 20:57:18 GMT</pubDate>
      <description>
      
        
        
          
          
            &lt;h2 id=&quot;Code-Libre&quot;&gt;&lt;a href=&quot;#Code-Libre&quot; class=&quot;headerlink&quot; title=&quot;Code Libre&quot;&gt;&lt;/a&gt;Code Libre&lt;/h2&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;So as I explained in the last post, I browse Github a lot and sometimes I find very interesting stuff. A friend of mine once asked if I would do a quick summary of my findings on my blog even if I don’t particularly test them so here it is! It’s named &lt;em&gt;Code Libre&lt;/em&gt;, pronounced like the &lt;a href=&quot;https://en.wikipedia.org/wiki/Rum_and_Coke&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;cocktail&lt;/a&gt; but with Code instead of Cuba. I wanted some kind of fancy name because I plan to do this often and it could be considered as a serie of posts I guess. So without further ado, let’s dive in.&lt;/p&gt;
&lt;h2 id=&quot;Ninja&quot;&gt;&lt;a href=&quot;#Ninja&quot; class=&quot;headerlink&quot; title=&quot;Ninja&quot;&gt;&lt;/a&gt;Ninja&lt;/h2&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Did you ever wish you could become a ninja? Well sadly this tool won’t make you one but it might make you feel like you are compiling like a ninja. It’s a small build system focused on speed.&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;If your C/C++ project already has a CMakeLists.txt file, you only need to run &lt;code&gt;cmake -GNinja&lt;/code&gt; and it will generate a Ninja Makefile! Once this is done, type &lt;code&gt;ninja&lt;/code&gt; and &lt;em&gt;boom&lt;/em&gt; your code is compiling (at least if your C++ can compile).&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;I’ve actually tried this tool to build a specific branch of the &lt;a href=&quot;https://www.sfml-dev.org/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;SFML Library&lt;/a&gt; and it went so fast I thought something went wrong and I didn’t setup the library correctly! This tool seems very interesting however I still need to look into how it works to debug code built using this system on Visual Studio as I love it’s debug tools.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/ninja-build/ninja&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Project’s repository&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;CppSharp&quot;&gt;&lt;a href=&quot;#CppSharp&quot; class=&quot;headerlink&quot; title=&quot;CppSharp&quot;&gt;&lt;/a&gt;CppSharp&lt;/h2&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;If you want to use C# but your favorite library is in C/C++, this tool might be useful for you. &lt;a href=&quot;https://github.com/mono/CppSharp/blob/master/README.md&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;According to the project’s README.md&lt;/a&gt;, it seems to be a tool and set of libraries that could bind C/C++ libraries to C#. Some parts of this tool are based on Clang, the C/C++ compiler. It is also part of the Mono project so it should be compatible on multiple platforms.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/mono/CppSharp&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Project’s repository&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;Utterances&quot;&gt;&lt;a href=&quot;#Utterances&quot; class=&quot;headerlink&quot; title=&quot;Utterances&quot;&gt;&lt;/a&gt;Utterances&lt;/h2&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Recently, I changed the comment system of my blog and switched over to Github issues. I made the style and the API calls to Github by myself. Few days later, I stumble uppon this project which seems to do exactly that and seems to have even more features. So if you are interested in doing something similar for your blog or website, this might be worth looking to. It is even used on the &lt;a href=&quot;https://haxe.org/manual/introduction.html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Haxe documentation&lt;/a&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/utterance/utterances&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Project’s repository&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;Forgelin&quot;&gt;&lt;a href=&quot;#Forgelin&quot; class=&quot;headerlink&quot; title=&quot;Forgelin&quot;&gt;&lt;/a&gt;Forgelin&lt;/h2&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;https://kotlinlang.org/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Kotlin&lt;/a&gt; has been spiking my interest for some time and when I found this project, it made me want to play Minecraft. I always dreamed about creating my own mods on this game but never took the time to make something as complex as I imagined. This project seems to allow the creation of Minecraft mods in Kotlin. It kind of make sense since Minecraft and its mods are in Java, Kotlin should work too since it operates on the JVM.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/Emberwalker/Forgelin&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Project’s repository&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;That’s-it&quot;&gt;&lt;a href=&quot;#That’s-it&quot; class=&quot;headerlink&quot; title=&quot;That’s it&quot;&gt;&lt;/a&gt;That’s it&lt;/h2&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;I hope you enjoyed this post! To my surprise someone actually commented on my blog yesterday and I would like to thank him again for this. I decided to not use any kind of analytic software to track the readers so having feedback means a lot! So how about you, do you &lt;em&gt;explore&lt;/em&gt; Github too sometimes? Have you found any interesting stuff? I would love to hear your opinion and/or your feedback! I’ll see you next time
          
        
      
      </description>
      
      <content:encoded><![CDATA[<h2 id="Code-Libre"><a href="#Code-Libre" class="headerlink" title="Code Libre"></a>Code Libre</h2><p>&nbsp;&nbsp;&nbsp;So as I explained in the last post, I browse Github a lot and sometimes I find very interesting stuff. A friend of mine once asked if I would do a quick summary of my findings on my blog even if I don’t particularly test them so here it is! It’s named <em>Code Libre</em>, pronounced like the <a href="https://en.wikipedia.org/wiki/Rum_and_Coke" target="_blank" rel="noopener">cocktail</a> but with Code instead of Cuba. I wanted some kind of fancy name because I plan to do this often and it could be considered as a serie of posts I guess. So without further ado, let’s dive in.</p><h2 id="Ninja"><a href="#Ninja" class="headerlink" title="Ninja"></a>Ninja</h2><p>&nbsp;&nbsp;&nbsp;Did you ever wish you could become a ninja? Well sadly this tool won’t make you one but it might make you feel like you are compiling like a ninja. It’s a small build system focused on speed.<br>&nbsp;&nbsp;&nbsp;If your C/C++ project already has a CMakeLists.txt file, you only need to run <code>cmake -GNinja</code> and it will generate a Ninja Makefile! Once this is done, type <code>ninja</code> and <em>boom</em> your code is compiling (at least if your C++ can compile).<br>&nbsp;&nbsp;&nbsp;I’ve actually tried this tool to build a specific branch of the <a href="https://www.sfml-dev.org/" target="_blank" rel="noopener">SFML Library</a> and it went so fast I thought something went wrong and I didn’t setup the library correctly! This tool seems very interesting however I still need to look into how it works to debug code built using this system on Visual Studio as I love it’s debug tools.</p><ul><li><a href="https://github.com/ninja-build/ninja" target="_blank" rel="noopener">Project’s repository</a></li></ul><h2 id="CppSharp"><a href="#CppSharp" class="headerlink" title="CppSharp"></a>CppSharp</h2><p>&nbsp;&nbsp;&nbsp;If you want to use C# but your favorite library is in C/C++, this tool might be useful for you. <a href="https://github.com/mono/CppSharp/blob/master/README.md" target="_blank" rel="noopener">According to the project’s README.md</a>, it seems to be a tool and set of libraries that could bind C/C++ libraries to C#. Some parts of this tool are based on Clang, the C/C++ compiler. It is also part of the Mono project so it should be compatible on multiple platforms.</p><ul><li><a href="https://github.com/mono/CppSharp" target="_blank" rel="noopener">Project’s repository</a></li></ul><h2 id="Utterances"><a href="#Utterances" class="headerlink" title="Utterances"></a>Utterances</h2><p>&nbsp;&nbsp;&nbsp;Recently, I changed the comment system of my blog and switched over to Github issues. I made the style and the API calls to Github by myself. Few days later, I stumble uppon this project which seems to do exactly that and seems to have even more features. So if you are interested in doing something similar for your blog or website, this might be worth looking to. It is even used on the <a href="https://haxe.org/manual/introduction.html" target="_blank" rel="noopener">Haxe documentation</a>.</p><ul><li><a href="https://github.com/utterance/utterances" target="_blank" rel="noopener">Project’s repository</a></li></ul><h2 id="Forgelin"><a href="#Forgelin" class="headerlink" title="Forgelin"></a>Forgelin</h2><p>&nbsp;&nbsp;&nbsp;<a href="https://kotlinlang.org/" target="_blank" rel="noopener">Kotlin</a> has been spiking my interest for some time and when I found this project, it made me want to play Minecraft. I always dreamed about creating my own mods on this game but never took the time to make something as complex as I imagined. This project seems to allow the creation of Minecraft mods in Kotlin. It kind of make sense since Minecraft and its mods are in Java, Kotlin should work too since it operates on the JVM.</p><ul><li><a href="https://github.com/Emberwalker/Forgelin" target="_blank" rel="noopener">Project’s repository</a></li></ul><h2 id="That’s-it"><a href="#That’s-it" class="headerlink" title="That’s it"></a>That’s it</h2><p>&nbsp;&nbsp;&nbsp;I hope you enjoyed this post! To my surprise someone actually commented on my blog yesterday and I would like to thank him again for this. I decided to not use any kind of analytic software to track the readers so having feedback means a lot! So how about you, do you <em>explore</em> Github too sometimes? Have you found any interesting stuff? I would love to hear your opinion and/or your feedback! I’ll see you next time :).</p><p>-Tym</p>]]></content:encoded>
      
      <comments>http://Tym17.com/2018/08/17/code-libre-1/#disqus_thread</comments>
    </item>
    
    <item>
      <title>Blog revamp</title>
      <link>http://Tym17.com/2018/08/11/blog-revamp/</link>
      <guid>http://Tym17.com/2018/08/11/blog-revamp/</guid>
      <pubDate>Sat, 11 Aug 2018 10:07:18 GMT</pubDate>
      <description>
      
        
        
          
          
            &lt;h2 id=&quot;New-blog-theme&quot;&gt;&lt;a href=&quot;#New-blog-theme&quot; class=&quot;headerlink&quot; title=&quot;New blog theme&quot;&gt;&lt;/a&gt;New blog theme&lt;/h2&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Welcome to my blog &lt;del&gt;Again&lt;/del&gt;! I initially picked a theme named &lt;a href=&quot;https://github.com/probberechts/hexo-theme-cactus&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Cactus Dark&lt;/a&gt; that I found on the Hex website that looked nice and had some kind of programmer feel to it. However, I wasn’t really happy with how the theme behaved on a large screen such as a desktop one. So I went ahead and made some small changes for displays that are large enough to fit the entire menus.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;There is now a side menu for the navigation.&lt;/li&gt;
&lt;li&gt;Post related navigation &amp;amp; buttons are a side menu too  (I love side menus).&lt;/li&gt;
&lt;li&gt;There is now a progress bar on post pages that progresses as the user scrolls down the page.&lt;/li&gt;
&lt;li&gt;I changed the color of few things so the color accent is more present.&lt;/li&gt;
&lt;li&gt;New comment system that I’ll explain later in this post.&lt;/li&gt;
&lt;li&gt;RSS Feed now &lt;a href=&quot;/feed.xml&quot;&gt;works&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;New download page layout.&lt;/li&gt;
&lt;li&gt;A &lt;a href=&quot;/tags&quot;&gt;working tag page&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;Github-as-a-comment-platform&quot;&gt;&lt;a href=&quot;#Github-as-a-comment-platform&quot; class=&quot;headerlink&quot; title=&quot;Github as a comment platform&quot;&gt;&lt;/a&gt;Github as a comment platform&lt;/h2&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Since the beginning of the transition of this blog to &lt;a href=&quot;https://hexo.io/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Hexo&lt;/a&gt;, the comment system was run using Disqus. On one hand, it allows me to keep a statically hosted website (which is free) and have dynamic comments that do no require people making an account &lt;em&gt;just&lt;/em&gt; for my blog. On the other hand, I have to include their scripts which after reading &lt;a href=&quot;http://donw.io/post/github-comments/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;some&lt;/a&gt; &lt;a href=&quot;https://shadowfacts.net/meta/2017/04/23/comments-powered-by-github/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;articles&lt;/a&gt; led me to think again about it since I care about privacy. So I took the same route as both of those blogs took and switched to Github for comments while making the few changes I wanted on the theme. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;There are few upsides and downsides to this but I’ll begin with Disqus before listing the ups and downs of using Github as a comment system. While Disqus is pretty handy (you only have to configure the already embedded Hexo plugin and &lt;em&gt;poof&lt;/em&gt; it works), it means that users are also required to have a Disqus account to comment on your blog. The way it is designed also requires me to check on it regularly to moderate/approve pending comments, which make yet another thing to check when booting the computer. Comments sections were also automatically created and made available to the Disqus’ thread of the blog when developing locally, creating a new Disqus thread per dummy/draft/test posts that would not even be of any use and would come as duplicates of final post threads.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Meanwhile Github was not really intended for this, I had to do some work to get it working as I wanted. Since Github is one of those websites I browse almost constantly during my free time this also remove that one more place to check when I boot up my computer. Regarding privacy, I trust Github more than Disqus and the way the comment section is now done is just a single Github API call to get an issue’s comments. From my point of view, all of this has many advantages and makes managing comments easier &lt;del&gt;(even if there are none yet)&lt;/del&gt;.&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Regarding the user’s perspective, I could imagine arguments that could be seen as assets or drawbacks. The most positive asset is that now, if someone is interested in this blog, they can subscribe to the Github’s repository containing all the issues to get it included in their Github’s feed. As an example, a long time ago a friend told me that he was waiting for me to deliver a mailing list to update him on the blog posts I would make, however, I did not have a proper marketing email setup ready and the mailing list was filled with mail addresses that were most likely inserted by bots scouting for Wordpress installations. Now he can subscribe to the Github repository and have notifications when a new post is released. Users are no longer required to have a Disqus account but they are required to have a Github one if they wish to comment. Since I’m mostly talking about software and programming in my blog, I assume it is more likely that someone will have a Github account than a Disqus one (even if I may be wrong). Looking at the comments of one of those articles that led me to it also made me notice that once a user comments on an issue he will automatically watch the issue and receive emails when some one else comments or mentions him. I can see why this could be annoying but this also means that the user will be notified if someone responds to his comment.&lt;/p&gt;
&lt;h2 id=&quot;More-details&quot;&gt;&lt;a href=&quot;#More-details&quot; class=&quot;headerlink&quot; title=&quot;More details&quot;&gt;&lt;/a&gt;More details&lt;/h2&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;If you like the new version of this theme, you can find it on Github at &lt;a href=&quot;https://github.com/Tym17/KosmoKot&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Tym17/KosmoKot&lt;/a&gt;, it’s mainly some kind of fork from the original theme but when it was at version 2.0, so the version of the theme about 7 months ago from the time this post is released. This gave me an occasion to practice my front end skills as well as learn new techs: Stylus and EJS. And I had a lot of fun doing it. I was also surprised that when looking for an alternative in Javascript to the PHP templating engine Twig, I never found EJS.&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;The main things I modified were the features I mentioned at the top of this post. I am very happy of how I made the comment section as the required javascript code to load the comment engine is only included in the pages that requires it.&lt;/p&gt;
&lt;h2 id=&quot;What’s-next&quot;&gt;&lt;a href=&quot;#What’s-next&quot; class=&quot;headerlink&quot; title=&quot;What’s next&quot;&gt;&lt;/a&gt;What’s next&lt;/h2&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;I don’t know yet. I have a lot of ideas for blog posts but I need to take the time to write them and if they contain pseudo code, test them. A friend of mine was also interested in some kind of condensed form of my open-source findings (I accumulated about 1.3k Starred repositories on Github at the time this post is released), so I might as well finally start doing this, may it be on random occurrences or monthly. If there is anything you may be interested in, do not hesitate to comment below and I’ll look into
          
        
      
      </description>
      
      <content:encoded><![CDATA[<h2 id="New-blog-theme"><a href="#New-blog-theme" class="headerlink" title="New blog theme"></a>New blog theme</h2><p>&nbsp;&nbsp;&nbsp;Welcome to my blog <del>Again</del>! I initially picked a theme named <a href="https://github.com/probberechts/hexo-theme-cactus" target="_blank" rel="noopener">Cactus Dark</a> that I found on the Hex website that looked nice and had some kind of programmer feel to it. However, I wasn’t really happy with how the theme behaved on a large screen such as a desktop one. So I went ahead and made some small changes for displays that are large enough to fit the entire menus.</p><ul><li>There is now a side menu for the navigation.</li><li>Post related navigation &amp; buttons are a side menu too  (I love side menus).</li><li>There is now a progress bar on post pages that progresses as the user scrolls down the page.</li><li>I changed the color of few things so the color accent is more present.</li><li>New comment system that I’ll explain later in this post.</li><li>RSS Feed now <a href="/feed.xml">works</a>.</li><li>New download page layout.</li><li>A <a href="/tags">working tag page</a></li></ul><h2 id="Github-as-a-comment-platform"><a href="#Github-as-a-comment-platform" class="headerlink" title="Github as a comment platform"></a>Github as a comment platform</h2><p>&nbsp;&nbsp;&nbsp;Since the beginning of the transition of this blog to <a href="https://hexo.io/" target="_blank" rel="noopener">Hexo</a>, the comment system was run using Disqus. On one hand, it allows me to keep a statically hosted website (which is free) and have dynamic comments that do no require people making an account <em>just</em> for my blog. On the other hand, I have to include their scripts which after reading <a href="http://donw.io/post/github-comments/" target="_blank" rel="noopener">some</a> <a href="https://shadowfacts.net/meta/2017/04/23/comments-powered-by-github/" target="_blank" rel="noopener">articles</a> led me to think again about it since I care about privacy. So I took the same route as both of those blogs took and switched to Github for comments while making the few changes I wanted on the theme. </p><p>&nbsp;&nbsp;&nbsp;There are few upsides and downsides to this but I’ll begin with Disqus before listing the ups and downs of using Github as a comment system. While Disqus is pretty handy (you only have to configure the already embedded Hexo plugin and <em>poof</em> it works), it means that users are also required to have a Disqus account to comment on your blog. The way it is designed also requires me to check on it regularly to moderate/approve pending comments, which make yet another thing to check when booting the computer. Comments sections were also automatically created and made available to the Disqus’ thread of the blog when developing locally, creating a new Disqus thread per dummy/draft/test posts that would not even be of any use and would come as duplicates of final post threads.</p><p>&nbsp;&nbsp;&nbsp;Meanwhile Github was not really intended for this, I had to do some work to get it working as I wanted. Since Github is one of those websites I browse almost constantly during my free time this also remove that one more place to check when I boot up my computer. Regarding privacy, I trust Github more than Disqus and the way the comment section is now done is just a single Github API call to get an issue’s comments. From my point of view, all of this has many advantages and makes managing comments easier <del>(even if there are none yet)</del>.<br>&nbsp;&nbsp;&nbsp;Regarding the user’s perspective, I could imagine arguments that could be seen as assets or drawbacks. The most positive asset is that now, if someone is interested in this blog, they can subscribe to the Github’s repository containing all the issues to get it included in their Github’s feed. As an example, a long time ago a friend told me that he was waiting for me to deliver a mailing list to update him on the blog posts I would make, however, I did not have a proper marketing email setup ready and the mailing list was filled with mail addresses that were most likely inserted by bots scouting for Wordpress installations. Now he can subscribe to the Github repository and have notifications when a new post is released. Users are no longer required to have a Disqus account but they are required to have a Github one if they wish to comment. Since I’m mostly talking about software and programming in my blog, I assume it is more likely that someone will have a Github account than a Disqus one (even if I may be wrong). Looking at the comments of one of those articles that led me to it also made me notice that once a user comments on an issue he will automatically watch the issue and receive emails when some one else comments or mentions him. I can see why this could be annoying but this also means that the user will be notified if someone responds to his comment.</p><h2 id="More-details"><a href="#More-details" class="headerlink" title="More details"></a>More details</h2><p>&nbsp;&nbsp;&nbsp;If you like the new version of this theme, you can find it on Github at <a href="https://github.com/Tym17/KosmoKot" target="_blank" rel="noopener">Tym17/KosmoKot</a>, it’s mainly some kind of fork from the original theme but when it was at version 2.0, so the version of the theme about 7 months ago from the time this post is released. This gave me an occasion to practice my front end skills as well as learn new techs: Stylus and EJS. And I had a lot of fun doing it. I was also surprised that when looking for an alternative in Javascript to the PHP templating engine Twig, I never found EJS.<br>&nbsp;&nbsp;&nbsp;The main things I modified were the features I mentioned at the top of this post. I am very happy of how I made the comment section as the required javascript code to load the comment engine is only included in the pages that requires it.</p><h2 id="What’s-next"><a href="#What’s-next" class="headerlink" title="What’s next"></a>What’s next</h2><p>&nbsp;&nbsp;&nbsp;I don’t know yet. I have a lot of ideas for blog posts but I need to take the time to write them and if they contain pseudo code, test them. A friend of mine was also interested in some kind of condensed form of my open-source findings (I accumulated about 1.3k Starred repositories on Github at the time this post is released), so I might as well finally start doing this, may it be on random occurrences or monthly. If there is anything you may be interested in, do not hesitate to comment below and I’ll look into it!</p><p>-Tym</p>]]></content:encoded>
      
      <comments>http://Tym17.com/2018/08/11/blog-revamp/#disqus_thread</comments>
    </item>
    
    <item>
      <title>Making my own GUI Library</title>
      <link>http://Tym17.com/2018/07/01/gui-engine-pt1/</link>
      <guid>http://Tym17.com/2018/07/01/gui-engine-pt1/</guid>
      <pubDate>Sun, 01 Jul 2018 12:07:18 GMT</pubDate>
      <description>
      
        
        
          
          
            &lt;h2 id=&quot;Preface&quot;&gt;&lt;a href=&quot;#Preface&quot; class=&quot;headerlink&quot; title=&quot;Preface&quot;&gt;&lt;/a&gt;Preface&lt;/h2&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;While thinking about creating interesting content for my blog after not having posted anything for a while, I taught that blogging about my progress on my quest to make my very own GUI engine from scratch might gather the interest  of some people like it was the case on the unofficial French SFML’s discord.&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;So here it is! Since I started this GUI engine a while ago, I might not be able to cover as much details as I could have when I was freshly  programming it. I will however try to explain it in details and if any questions arises, the Disqus comments thingy at the bottom should be there!&lt;/p&gt;
&lt;h2 id=&quot;Introduction&quot;&gt;&lt;a href=&quot;#Introduction&quot; class=&quot;headerlink&quot; title=&quot;Introduction&quot;&gt;&lt;/a&gt;Introduction&lt;/h2&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;At it’s core, the engine is designed to allow me to create games using the &lt;a href=&quot;https://www.sfml-dev.org/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;SFML Library&lt;/a&gt;. I always liked to create things from scratch and this engine is no exception. The main idea is that a class will take care of the window as well as it’s loop and will contain a finite state machine. A small variety of states can actually be fed to this state machine to this day:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Abstract State:&lt;/strong&gt; This state is nothing more than a few functions like &lt;code&gt;update(elapsedTime)&lt;/code&gt; and &lt;code&gt;draw(elapsedTime)&lt;/code&gt;. It doesn’t really do anything and is usually there to serve as a boilerplate for any upcoming states that one might want to create.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Abstract UI State:&lt;/strong&gt; This one is very similar to the above state however the key difference is that it embeds a container of &lt;em&gt;uiComponents&lt;/em&gt; and a few key functions that takes care of calling the proper functions for those interface components such as &lt;code&gt;hover()&lt;/code&gt; or &lt;code&gt;trigger()&lt;/code&gt; when an item is hovered or clicked/triggered.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;With those states, I -or anyone using this library- should be able to make simple game using my GUI engine. One point of which I truly appreciate is that the UI components only require to be instantiated once and depending on their role, might not need extra care after the state has been instantiated except when changing its content or something among those lines, but no extra checking for the Window’s events or extra resizes.&lt;/p&gt;
&lt;h2 id=&quot;2nd-Iteration&quot;&gt;&lt;a href=&quot;#2nd-Iteration&quot; class=&quot;headerlink&quot; title=&quot;2nd Iteration&quot;&gt;&lt;/a&gt;2nd Iteration&lt;/h2&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Since this is my 2nd attempt at creating a GUI engine, I already had some constraints I discovered while creating the very first GUI Engine.&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;The main flaws were that if any event was to happen and that any UI component would have been above or under an other UI component or any other sensitive area (for mouse events), it would have triggered everything in the zone! So I required a way to stop the propagation of the events once it would hit a component. With this problem in mind, I tinkered around and managed to implement a solution that works for now. I think however that when I will start implementing more complicated components such as drag and drop-able components, I might face some issues.&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;The other issue is that components relied heavily on some kind of utility class that I would add to almost every component class that did not do much. It could have been replaced by a singleton or could have been made in a better way. This utility allowed me to place my components on the window using a percentage ratio of the window, allowing the rest of the game to keep its original size but having a GUI that scales up or down depending on the window’s size. One of the solutions that came to my mind were that I should just drop the way I used to place the components, completely forgetting about using percentage on the game’s window. However, by mixing that utility class to a point class, it allowed me to create dynamic anchor on my windows. Elements could now be created with positions that could be either fixed/precise positions in pixels (or at least, SFML’s window’s units) as well as percentage of the Window.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/assets/mygui/tidemobetter.gif&quot; alt&gt; &lt;em&gt;Demo of two buttons using percentage and precise anchor types for position and size.&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;Conclusion&quot;&gt;&lt;a href=&quot;#Conclusion&quot; class=&quot;headerlink&quot; title=&quot;Conclusion&quot;&gt;&lt;/a&gt;Conclusion&lt;/h2&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;To this day, some features are still missing the Library for me or anyone to use it in a efficient or enjoyable fashion. I just added today a way to have anchors that can depend on other anchors to determine a position or size, but there is still some unsolved problems lying around them or some aspects that I would like to change to its usability. But that is a subject for an other post.&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;I hope you enjoyed &lt;del&gt;my first non-“Hello world” post I put on a blog for the last 2 years&lt;/del&gt; this blog post
          
        
      
      </description>
      
      <content:encoded><![CDATA[<h2 id="Preface"><a href="#Preface" class="headerlink" title="Preface"></a>Preface</h2><p>&nbsp;&nbsp;&nbsp;While thinking about creating interesting content for my blog after not having posted anything for a while, I taught that blogging about my progress on my quest to make my very own GUI engine from scratch might gather the interest  of some people like it was the case on the unofficial French SFML’s discord.<br>&nbsp;&nbsp;&nbsp;So here it is! Since I started this GUI engine a while ago, I might not be able to cover as much details as I could have when I was freshly  programming it. I will however try to explain it in details and if any questions arises, the Disqus comments thingy at the bottom should be there!</p><h2 id="Introduction"><a href="#Introduction" class="headerlink" title="Introduction"></a>Introduction</h2><p>&nbsp;&nbsp;&nbsp;At it’s core, the engine is designed to allow me to create games using the <a href="https://www.sfml-dev.org/" target="_blank" rel="noopener">SFML Library</a>. I always liked to create things from scratch and this engine is no exception. The main idea is that a class will take care of the window as well as it’s loop and will contain a finite state machine. A small variety of states can actually be fed to this state machine to this day:</p><ul><li><strong>Abstract State:</strong> This state is nothing more than a few functions like <code>update(elapsedTime)</code> and <code>draw(elapsedTime)</code>. It doesn’t really do anything and is usually there to serve as a boilerplate for any upcoming states that one might want to create.</li><li><strong>Abstract UI State:</strong> This one is very similar to the above state however the key difference is that it embeds a container of <em>uiComponents</em> and a few key functions that takes care of calling the proper functions for those interface components such as <code>hover()</code> or <code>trigger()</code> when an item is hovered or clicked/triggered.</li></ul><p>&nbsp;&nbsp;&nbsp;With those states, I -or anyone using this library- should be able to make simple game using my GUI engine. One point of which I truly appreciate is that the UI components only require to be instantiated once and depending on their role, might not need extra care after the state has been instantiated except when changing its content or something among those lines, but no extra checking for the Window’s events or extra resizes.</p><h2 id="2nd-Iteration"><a href="#2nd-Iteration" class="headerlink" title="2nd Iteration"></a>2nd Iteration</h2><p>&nbsp;&nbsp;&nbsp;Since this is my 2nd attempt at creating a GUI engine, I already had some constraints I discovered while creating the very first GUI Engine.<br>&nbsp;&nbsp;&nbsp;The main flaws were that if any event was to happen and that any UI component would have been above or under an other UI component or any other sensitive area (for mouse events), it would have triggered everything in the zone! So I required a way to stop the propagation of the events once it would hit a component. With this problem in mind, I tinkered around and managed to implement a solution that works for now. I think however that when I will start implementing more complicated components such as drag and drop-able components, I might face some issues.<br>&nbsp;&nbsp;&nbsp;The other issue is that components relied heavily on some kind of utility class that I would add to almost every component class that did not do much. It could have been replaced by a singleton or could have been made in a better way. This utility allowed me to place my components on the window using a percentage ratio of the window, allowing the rest of the game to keep its original size but having a GUI that scales up or down depending on the window’s size. One of the solutions that came to my mind were that I should just drop the way I used to place the components, completely forgetting about using percentage on the game’s window. However, by mixing that utility class to a point class, it allowed me to create dynamic anchor on my windows. Elements could now be created with positions that could be either fixed/precise positions in pixels (or at least, SFML’s window’s units) as well as percentage of the Window.</p><p><img src="/assets/mygui/tidemobetter.gif" alt> <em>Demo of two buttons using percentage and precise anchor types for position and size.</em></p><h2 id="Conclusion"><a href="#Conclusion" class="headerlink" title="Conclusion"></a>Conclusion</h2><p>&nbsp;&nbsp;&nbsp;To this day, some features are still missing the Library for me or anyone to use it in a efficient or enjoyable fashion. I just added today a way to have anchors that can depend on other anchors to determine a position or size, but there is still some unsolved problems lying around them or some aspects that I would like to change to its usability. But that is a subject for an other post.<br>&nbsp;&nbsp;&nbsp;I hope you enjoyed <del>my first non-“Hello world” post I put on a blog for the last 2 years</del> this blog post :).</p><p>-Tym</p>]]></content:encoded>
      
      <comments>http://Tym17.com/2018/07/01/gui-engine-pt1/#disqus_thread</comments>
    </item>
    
    <item>
      <title>Hello World</title>
      <link>http://Tym17.com/2018/01/25/hello-world/</link>
      <guid>http://Tym17.com/2018/01/25/hello-world/</guid>
      <pubDate>Thu, 25 Jan 2018 11:07:18 GMT</pubDate>
      <description>
      
        
        
          
          
            &lt;h2 id=&quot;New-Year-resolutions&quot;&gt;&lt;a href=&quot;#New-Year-resolutions&quot; class=&quot;headerlink&quot; title=&quot;New Year resolutions&quot;&gt;&lt;/a&gt;New Year resolutions&lt;/h2&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Welcome to my blog! Last year I taught it would be a nice thing to get a blog running as one of those new year resolutions but I only assembled a WordPress and few plugins together and published 2 posts, which isn’t that much for an initiative about posting useful stuff and updates on things I create?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;So this year, I decided I would keep it simple. I got my hands on &lt;a href=&quot;https://hexo.io/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Hexo&lt;/a&gt; which is (in my opinion) very easy to understand and use. It also seems simpler than WordPress and (hopefully) I won’t get as much junk from bots scavenging peaceful WordPress installations.&lt;/p&gt;
&lt;h2 id=&quot;That’s-a-nice-theme&quot;&gt;&lt;a href=&quot;#That’s-a-nice-theme&quot; class=&quot;headerlink&quot; title=&quot;That’s a nice theme&quot;&gt;&lt;/a&gt;That’s a nice theme&lt;/h2&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;This blog uses a modified Hexo theme I found on Github at &lt;a href=&quot;https://github.com/probberechts/cactus-dark&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;probberechts/cactus-dark&lt;/a&gt;. I tweaked it a bit to have the greenish accent set with my favorite color (That blue I put everywhere). I might as well tweak it some more in the future and maybe fix some bugs I encountered but this theme looks really nice. Thank you &lt;a href=&quot;https://github.com/probberechts&quot; target=&quot;_blank&quot;
          
        
      
      </description>
      
      <content:encoded><![CDATA[<h2 id="New-Year-resolutions"><a href="#New-Year-resolutions" class="headerlink" title="New Year resolutions"></a>New Year resolutions</h2><p>&nbsp;&nbsp;&nbsp;Welcome to my blog! Last year I taught it would be a nice thing to get a blog running as one of those new year resolutions but I only assembled a WordPress and few plugins together and published 2 posts, which isn’t that much for an initiative about posting useful stuff and updates on things I create?</p><p>&nbsp;&nbsp;&nbsp;So this year, I decided I would keep it simple. I got my hands on <a href="https://hexo.io/" target="_blank" rel="noopener">Hexo</a> which is (in my opinion) very easy to understand and use. It also seems simpler than WordPress and (hopefully) I won’t get as much junk from bots scavenging peaceful WordPress installations.</p><h2 id="That’s-a-nice-theme"><a href="#That’s-a-nice-theme" class="headerlink" title="That’s a nice theme"></a>That’s a nice theme</h2><p>&nbsp;&nbsp;&nbsp;This blog uses a modified Hexo theme I found on Github at <a href="https://github.com/probberechts/cactus-dark" target="_blank" rel="noopener">probberechts/cactus-dark</a>. I tweaked it a bit to have the greenish accent set with my favorite color (That blue I put everywhere). I might as well tweak it some more in the future and maybe fix some bugs I encountered but this theme looks really nice. Thank you <a href="https://github.com/probberechts" target="_blank" rel="noopener">probberechts</a>!</p><p>-Tym</p>]]></content:encoded>
      
      <comments>http://Tym17.com/2018/01/25/hello-world/#disqus_thread</comments>
    </item>
    
  </channel>
</rss>
