User Tools

Site Tools


hpl3:game:gui

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
hpl3:game:gui [2013/11/04 09:19]
ian.thomas Added Thomas's notes on image sizes.
hpl3:game:gui [2013/11/04 09:54]
thomas [Assets]
Line 122: Line 122:
 Then flowerGfx can be used where ever it is needed. No need to neither load or destroy the asset. Then flowerGfx can be used where ever it is needed. No need to neither load or destroy the asset.
  
 +It is also possible to load graphics as textures or animations, by using the types ''​eImGuiGfx_Texture''​ and ''​eImGuiGfx_ImageAnimated''​.
 +
 +For texture:
 +<code c++>
 +cImGuiGfx flowerGfx("​flower.dds",​ eImGuiGfx_Texture);​
 +cImGuiGfx flowerGfx("​flower.dds",​ eGuiMaterial_Additive,​ eImGuiGfx_Texture);​
 +</​code>​
 +Note that it is now possible to load DXT format files!
 +
 +
 +For for animation:
 +<code c++>
 +cImGuiGfx flowerGfx("​flower.tga",​ eImGuiGfx_ImageAnimated);​
 +cImGuiGfx flowerGfx("​flower.tga",​ eGuiMaterial_Additive,​ eImGuiGfx_ImageAnimated);​
 +</​code>​
 +When loading an animation, an extension is required and the engine will load all the files named like "​flower00.tga",​ "​flower01.tga",​ etc for as long as it can find file names. These images will then be looped around in an animation loop. Control the animation speed by setting the member variable ''​mfAnimationTime''​ like this:
 +<code c++>
 +cImGuiGfx flowerGfx("​flower.tga",​ eImGuiGfx_ImageAnimated);​
 +flowerGfx.mfAnimationTime = 0.1;
 +</​code>​
 +This will make each frame play for 0.1 seconds. (default setting is 1).
 ==== Note on Graphics ==== ==== Note on Graphics ====
  
hpl3/game/gui.txt ยท Last modified: 2015/09/17 10:14 by ian.thomas