• -- Coming Soon
  • contact@radlabgaming.com

Introducing some code snippets!

Introducing some code snippets!

Hey everyone!

We made some major changes this week and are excited to introduce code snippets into our blog as well as changing some of our classes to template based!

To start we decided to change our dropdown system into a template where we can not only take sprites but we can also take text, custom shapes, or whatever we would need.

Here is a small sample piece for our new dropdown system:

 template<class TypeClass>
 void dropdown<TypeClass>::addDropDownItem(TypeClass tempDropdown, sf::Vector2f resolution)
 {
 this->dropdownListVector.push_back(tempDropdown);
 this->dropdownListDataVector.push_back(resolution);
<span id="e50871f4ceb">The drug is manufactured by Ajanta Pharma and uses high-tech, clean rooms for the preparation of the buy viagra in india <a href="http://amerikabulteni.com/2016/02/09/new-hampshireda-ilk-sandikta-hillary-clintona-tek-oy-bile-yok/">http://amerikabulteni.com/2016/02/09/new-hampshireda-ilk-sandikta-hillary-clintona-tek-oy-bile-yok/</a> drug. Or, there <a href="http://amerikabulteni.com/2015/11/20/bu-da-ivy-league-el-clasicosu-harvard-yale-karsi-karsiya/">amerikabulteni.com</a> order viagra online could be ejaculation dysfunction. The <a href="http://amerikabulteni.com/2012/03/28/sopranos-v-the-wire-son-25-yilin-en-iyi-tv-dizisi-hangisi-oldu/">tadalafil online mastercard</a>  of Pfizer is now $ 15.00 per pill and the other cialis sells at 1.00 dollar per pill. Made up of natural ingredients, these pills buy cialis <a href="http://amerikabulteni.com/2011/09/09/nflde-sezonun-acilis-macinda-heyecan-ve-rekor-vardi/">Order Page</a> do not cause any major side effects due to their natural content. </span> }
 template&lt;class TypeClass&gt;
 void dropdown&lt;TypeClass&gt;::setObjectTexture(std::string filepath, sf::Vector2f scale)
 {
 this-&gt;objectTexture.loadFromFile(filepath);
 this-&gt;object.setTexture(this-&gt;objectTexture);
 this-&gt;object.setScale(scale);
 }

As you can see it is a extremely simple template class but it does allow us to add multiple types without a ton of different functions and etc. Overall I am very excited to continue using the system and to expand our other classes into template based classes allowing us to remove tons of useless code and add more opportunities for different types.

Thanks!
RadLab

blanet910@yahoo.com

Leave a Comment