Home   Help Search Login Register  

Author Topic: Getting More Than 1 Image As Resource Through Description.ext ???  (Read 1206 times)

0 Members and 1 Guest are viewing this topic.

lceFLYER

  • Guest
Just wondering how to be able to use more than 1 resource object.  Below is what I use to implemnt the object (image, picture, you know) in game within the editor under Resource.

The problem is I can only get one image using this method. How do you add stuff to the code to get more images in game?  All of the following I place at the very bottom of the description.ext file


Thank you in advance! 8)




#define ST_PICTURE    48
#define CT_STATIC     0


class RscGraphic
{
type = CT_STATIC;
idc=-1;
style = ST_PICTURE;
colorBackground[] = {0, 0, 0, 0};
       colorText[] = {1, 1, 1, 1};
       font = FontHtml;
       size = 1;
};

class RscTitles
{
class myPICTUREimageblahblah
{
name = "myPICTUREimageblahblah";duration = 5;
idd = -1;movingEnable = false;controls[]= {animal};
class animal : RscGraphic
{
text = "myPICTUREimageblahblah.jpg";
x = 0.17;
y = 0.17;
w = 0.65;
h = 0.65;
};
};

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Just add more to the controls array:
controls[]= {animal, animal2, animal3}
Include rest of controls as you included animal.

lceFLYER

  • Guest
 ??? I'm sorry, I hope I do not bother you... I still don't fully understand. Call me visual...

Could you, if not too much trouble, cut and past an example with the obove code showing the multiple graphic use.

I tried insert the additional lines in the control part and also replacing animal with animal 1 etc, but I did not know what exaclty to repeat...

Thank you again!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Code: [Select]
class RscTitles
{
   class myPICTUREimageblahblah
   {
      name = "myPICTUREimageblahblah";
      duration = 5;
      idd = -1;
      movingEnable = false;
      controls[]={"animal1", "animal2", "animal3"};

      class animal1 : RscGraphic
      {
         text = "myPICTURE1.jpg";
         x = 0.0;
         y = 0.0;
         w = 0.33;
         h = 0.65;
      };

      class animal2 : RscGraphic
      {
         text = "myPICTURE2.jpg";
         x = 0.33;
         y = 0.0;
         w = 0.33;
         h = 0.65;
      };

      class animal3 : RscGraphic
      {
         text = "myPICTURE3.jpg";
         x = 0.66;
         y = 0.0;
         w = 0.33;
         h = 0.65;
      };

   };

};

Dont forget to reload your mission in the editor every time you change description.ext file to see the new effects.

lceFLYER

  • Guest
Okay...I'll give the bad news first .... :(  heh, I misunderstood myself what exactly this set of code does in the description file.  The GOOD NEWS is  :good: that what you supplied does indeed work 100%!  :D in that is takes several images and plays them like a slidshow on the screen

 8) ....the problem is that I meant to find out how to actually have several images selectable within the editor as a resource object and aslo be able to position it anywhere on the screen in game for a set duration of time (say like 4 or 5 seconds) ...   8)

Okay I'm going to go hide now.  I really appreciate it Mandoble and hey I learned a new method for implementing images, hehe just not what I thought I was looking for hahah (maybe I need to go study more??) and if anybody else has tips and tricks, methods and solutions for getting more than one resource image ingame to be selected via the editor much appreciated!!!

thanks thanks thanks thanks in advance!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
To have more images available as individual resources from within the editor, simply add each resource as you added myPICTUREimageblahblah

Code: [Select]
class RscTitles
{
   class myPICTUREimageblahblah
   {
      name = "myPICTUREimageblahblah";
      ...
      ...
      ...
   };

   class myPICTUREimageblahblah2
   {
      name = "myPICTUREimageblahblah2";
      ...
      ...
      ...
   };

   class myPICTUREimageblahblah3
   {
      name = "myPICTUREimageblahblah3";
      ...
      ...
      ...
   };
};