Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Gold Dragon

#21
Thank you all  ;D I'll figure out which one will be the best way for me.
#22
Ok I feel REALLY stupid asking this but I can't find out how anywhere!!

I want to be able to make my character disappear.  Isn't there something like cEgo.visable = false or player.visable = false some where?
#23
AWWW SWEET!!!!! THX  ;D ;D ;D ;D

EDIT:

I have successfully implemented it. Works like a charm thanks guys!! Also Pumaman I noticed you added a similar thing that can be done in RC 1 with Text Window Gui's. VERY NICE!!

Now here is just another big problem I have....

Which one do I use!!  :o   LOL!!!   ;D ;D

#24
Quote
Well, you can always construct your dynamic sprite the same way that you are doing already, but then set it onto a GUI.BackgroundGraphic rather than creating is as an overlay.

If that doesn't work perhaps you could provide more detail about what you're trying to do.

GUI.BackgroundGraphic gets and set the graphic with a sprite number. At least what I can find in the manual. Is there a way to give a DynamicSprite a number to be use for GUI.BackgroundGraphic?  :(
#25
Thanks Gilbot that did it.. I think what was happening was that the engine was still trying to animate the backgrounds and I had set the backgroundanimation delay to 0 thinking it would cancel it. But your sugestion made it work.. thank you  ;D ;D
#26
Pumaman.... as for the cursor not animating is this.

When I use the code 'while (!WaitMouseKey(1)) {}' I get a wait cursor but it doesn't animate. But when there is a function that has eBlocking like 'player.walk(4,6,eBlock);' it does animate

is this a bug?
#27
Ok I'm trying to set up a kind of Light flicker effect by randomly selecting backgrounds that have different tints of light in them.

the code is this

Code: ags

function room_RepExec(){
  if (IsTimerExpired(1) == 1) {
    SetBackgroundFrame(Random(4));
    SetTimer(1,(Random(33)+40);
  }
}


It constintly changes.. there is no pauses between background changes. And when I put 'SetTimer(1,(Random(33)+40);' above the function room_RepExec() I get an error saying unexpected SetTimer?? huh?? so I left it thinking that if (IsTimerExpired(1) == 1)  would be true being that no setTimer has been set then it would be natually true.

Anyways can anyone help me out here?
#28
Well Since we are all posting our Multi Text box code I thought I would post mine for those who would like it or take from it what ever they can to help them. We are a community here to help each other right? And not hog all the code glory for ourselves.

This code is a mod addition to SSH's SpriteFont Module. I Sent him the code over a week ago to possibly add this SpriteFont Module. But it seems he was very busy with other projects. This is almost not beta and could be made to be more versatile, but It works perfectly for me for right now.. so why don't I share it.

Added this to SpriteFont.ash

Code: ags

import function display(String txt,  int x=-1,  int y=-1);  // My Display function
.
.
protected int Max_Txt_Pxl_Width;  // Maxium width of Desired Text Box Gui



In SpriteFont.asc is this....
(bear in mind that right now the TxtBox Gui sprite tiles are hard coded in for now..
TopRight Tile= sprite number 233... Top Middle Tile= Sprite number 234 and so on)
Also the middle text box Tiles 336-338 are the same Height as the sprite Text, And the Text Box Gui Tiles are uniform in their width and height as well. But Theoretically if you fallow what I have with Tiles being the same height and width and the sprite text is the same hight as the tiles everything should be full customizable with in those parameters. Here you go guys I hope you enjoy ;D ;D ;D

Naltimari and Monkey Please forgive me if I'm stepping on any toes. But please feel free to take what you want from my code and maybe it will help you guys out

Code: ags

// ********************  My New attempt at a Text box Gui with custom Gui Text Tiles  *************************


function SpriteFont::display(String Txt,  int x,  int y){

  int GuiBoxlength=0;
  int GuiBoxheight=0;
  int MiddleLoop=0; // int for how many Top Middle tiles there are?
 
 this.Max_Txt_Pxl_Width=System.ViewportWidth - (Game.SpriteWidth[233] * 3);
  // Set Max text Length wanted. This is half of your Background graphic width
  // This will be setted by a function in the future
   
  if ((Txt == null) || (Txt == "")) return; // invalid text parameter, abort

  int Txtwidth = this.GetSpriteTextRawWidth(Txt); // Get how long the text Graphics will be.
  int Lines = (Txtwidth / (this.Max_Txt_Pxl_Width)); // Find out how many lines will be in the Txt Box
    
  
  if (Lines == 0){   // if there is only 1 line. Get Box Length and height for sprite.
    int TopM=Game.SpriteWidth[234];  // Get Width of Top Middle custom Tile
  
    while(GuiBoxlength<Txtwidth){    // Get full Width of the Box's top middle
      GuiBoxlength+=TopM; 
      MiddleLoop++;  // adding how many top middle sprites there are
    }
  
    GuiBoxlength+=Game.SpriteWidth[233] * 2;  // Add the length of the two Corner end pieces of the top part of the box for Full Width of the Gui Text Box
    GuiBoxheight=(Game.SpriteHeight[233] * 2) + Game.SpriteHeight[236]; // Get height by X2 top corner pieces and middle graphic for Full Height of Gui Text Box
  }

  else{     // Get Sprite size for multiple lines
    int TopM=Game.SpriteWidth[234];  // Get Width of Top Middle custom Tile
    while(GuiBoxlength<this.Max_Txt_Pxl_Width){    // Get how many Top Middle Tiles there are. This has to be done due to the fact 
                                                   // that custom Gui tile sizes are difrent lengths
      GuiBoxlength+=TopM;
      MiddleLoop++;  // adding how many top middle sprites there are to match Max_Txt_Pxl_Width
    }
    GuiBoxlength+=(Game.SpriteWidth[233] * 2); // Add the length of the two end pieces of the top part of the box
    GuiBoxheight=(Game.SpriteHeight[233] * 2) + (Game.SpriteHeight[236] * (Lines+1));// Get height by X2 edge pieces pluss height of side middle tile X how many lines their are
  }

  DynamicSprite *sprite=DynamicSprite.Create(GuiBoxlength, GuiBoxheight); // create a sprite as big as the text box needs to be.
  DrawingSurface *TxtBox=sprite.GetDrawingSurface(); // Make a drawing surface to Draw the tiles on too
  
  // Draw The Txt box
  int spriteX=0;  //create another x and y that we can manipulate to draw onto our txt box
  int spriteY=0;
  //**************Top Line of Text Box ***********************
  TxtBox.DrawImage(spriteX, spriteY, 233);  // Draw Top Left Tile Onto the sprite
  spriteX+=Game.SpriteWidth[233]; // advance spriteX forward
 
  int i=MiddleLoop;
  while(i>0){  //Put the Top Middle Tiles in
    TxtBox.DrawImage(spriteX, spriteY, 234);
    spriteX+=Game.SpriteWidth[234];
    i--;
  }

  TxtBox.DrawImage(spriteX, spriteY, 235); // Draw top Right Tile 
  //***********************************************************
  
  //**************Middle Line of Text Box ***********************
  
  int iL=0;
  spriteY=0;
  while(iL<Lines+1){
    spriteX=0;
    spriteY+=Game.SpriteHeight[233];  // Move spriteY down
    TxtBox.DrawImage(spriteX, spriteY,236);  // Draw Middle Left Tile
    spriteX+=Game.SpriteWidth[236]; // advance spriteX forward
    
    i=MiddleLoop;  // reset i
    while(i>0){  //Put the middle Tiles in
      TxtBox.DrawImage(spriteX, spriteY, 237); // Draw Middle tile
      spriteX+=Game.SpriteWidth[237];  // advance spriteX forward
      i--;
    }
    TxtBox.DrawImage(spriteX, spriteY, 238); // Draw Middle Right Tile 
    iL++;
  }
  //***********************************************************
  
  //**************Bottom Line of Text Box ***********************
  spriteX=0;
  spriteY+=Game.SpriteHeight[236];  // Move spriteY down
  TxtBox.DrawImage(spriteX, spriteY,239);  // Draw Bottom Left Tile
  spriteX+=Game.SpriteWidth[239]; // advance spriteX forward
  
  i=MiddleLoop;  // reset i
  while(i>0){  //Put the Top Middle Tiles in
    TxtBox.DrawImage(spriteX, spriteY, 240); // Draw Bottom Middle tile
    spriteX+=Game.SpriteWidth[240];  // advance spriteX forward
    i--;
  }

  TxtBox.DrawImage(spriteX, spriteY, 241); // Draw Bottom Right Tile 
  //***********************************************************

  
  DynamicSprite *textSprite;
  if(Lines == 0){    // if There is only one line then just draw our Txt onto the box
    textSprite = this.TextOnSprite(Txt);
    TxtBox.DrawImage(Game.SpriteWidth[233], Game.SpriteHeight[233], textSprite.Graphic); // draw our text
    textSprite.Delete(); // delete this sprite, we don't need it any more
  }
  else{  // Do this if there is Multiple lines to our lines of Txt in our box
    int LineX=Game.SpriteWidth[233];
    int LineY=Game.SpriteHeight[233];
    int LineWidth;
    int StrStart=0;
    int StrCntr=0;
    int TempMax=this.Max_Txt_Pxl_Width; 
    
    iL=0;
    while(iL<Lines+1){
      LineWidth=0;
      while((LineWidth<TempMax) && (StrCntr<=Txt.Length)){    // Walk down the String Txt and find out 
                                                              // where StrCntr Stops at the end of the max Width
        LineWidth+= this.GetSpriteCharRawWidth(Txt.Chars[StrCntr]) + this.CharSpacing;
        StrCntr++;
      }
      if(Txt.Chars[StrCntr]==' '){          // If the End of the Line at StrCntr is a ' ' (space)
                                            // Draw that line of txt
        textSprite = this.TextOnSprite(Txt.Substring(StrStart, (StrCntr-StrStart))); // grab Line Segment out of whole text
        TxtBox.DrawImage(LineX, LineY, textSprite.Graphic); // draw our text
        textSprite.Delete();
      }
      else {
        while((Txt.Chars[StrCntr]!=' ') && (StrCntr>StrStart) && (StrCntr!=Txt.Length)){ // Walk backwards and find a ' '(space)
          StrCntr--;
        }
        if(StrStart>=StrCntr) StrStart=StrCntr-1; // crash check
        textSprite = this.TextOnSprite(Txt.Substring(StrStart, (StrCntr-StrStart))); // grab Line Segment out of whole text
        TxtBox.DrawImage(LineX, LineY, textSprite.Graphic); // draw our text
        textSprite.Delete();
      } // end else of if(Txt.Chars[StrCntr]==' ')
      LineY+=this.GetSpriteTextRawHeight(Txt.Substring(StrStart, StrCntr)); // Move LineY down
      StrCntr++;
      StrStart=StrCntr;  // Get StrStart to point that the Begining of the next line
      iL++; // incease the line counter by 1
    } // end while(iL<Lines+1){
  }  // end else of if(Lines == 0)

  
  TxtBox.Release();  // Update Memory: release Drawingsurface TxtBox to sprite since we are done
  
  if ((x == -1) && (y == -1)){       // Set Default if no Parm is passed
    x = (System.ViewportWidth - sprite.Width) / 2; // default x to center-screen
    y = (System.ViewportHeight - sprite.Height) / 2; // default y to center-screen
  }
  
  Overlay *displayOverlay = Overlay.CreateGraphical(x, y, sprite.Graphic, false); // create our overlay
  sprite.Delete(); // delete our temporary sprite
  while (!WaitMouseKey(1)) {} // returns 0 if the time has elapsed, 1 if a mouse button or key was pressed
  displayOverlay.Remove();

}
#29
Thanks I'll give that a shot  ;D ;D ;D
#30
Sure I would if there was a way to dynamically build the GUI like I do with sprites.. I use 9 Text box tile sprites and A-Z, a-z, 0-9,  graphic sprite tiles.. is there a way to dynamically create a GUI using these tiles as I do with the Dynamicsprite class/struct??
#31
ok I wrote my own custom Txt Box Code

Code: ags

function SpriteFont::display(String Txt,  int x,  int y){
.
.
(creates txt box)
.
.
Overlay *displayOverlay = Overlay.CreateGraphical(x, y, sprite.Graphic, false); // create our overlay
  sprite.Delete(); // delete our temporary sprite
  while (!WaitMouseKey(1)) {} // returns 0 if the time has elapsed, 1 if a mouse button or key was pressed
  displayOverlay.Remove();

}


Works perfect for to display text on background. But when I call it to in inventory


Code: ags

function iDullAxe_Look(){
  FontDk.display("A Fine Axe but it looks a bit dull from all the chopping.");
}


Incase your going to ask.. yes FontDk is created and imported as a SpriteFont class/struct

My Guess is that the over lay is being writen over the background which the Gui is written on top of that in this order...

Background...
Overlay text Box..
Inventory Gui..

How do I make it...

Background..
Inventory Gui..
Overlay Text box

Any Ideas?
#32
I've also found this true.. I'm trying to do a Sierra Style animated Hourglass for my Wait icon and nothing happens =( I've set animation to true.  Image to 0 and View to 8 (the view that holds the animated frames) but still nothing =(
#33
A Boy....

A Legend...

An ancient prophecy...

A small hope...

to over come grave danger....

A boy with a mysterious past is foretold to be the one to reunite Dragon and Man.... the fist one to be born in over 10,000 years..... and.....The last..... 

The Dragon Knight.

He will over come great obstacles and challenge his wits and courage against many dangers and mysteries. He must save a lost gold dragon fledgling from an evil wizard. Hell bent on destroying all dragons. can this one boy do it? By saving this baby dragon can he rejoin the ties of Dragon and Man... and learn what Fate and Destiny has for them. Only Time and you will know.

Come join us on an epic journey of adventure, mystery, friendship, and Love.

Do you have what it takes to be the last Dragon Knight? Come join us.....

*************************************************************************

Do I have your attention? Good  ;D  I have a grand Idea for a game. Will it actually get that big? I dunno but I"m am definitely hell bent on trying. With me trying to Write the story... program...Game Design.. Drawing backgrounds, and Drawing characters. I am pulled in every direction at once And with me having 'ADD' to boot. It makes it really difficult to put in the quality time I want into the game with so many different things to work on.

I have a passion for Game Design, Programing and Stories so in those I can do fine in.


*******************************************
What I need is this....

Background artists

Beast and character Concept Art/Artists. (If you can draw Anime style characters, GREAT!! But not required.)

Character Portrait Artists

Animators

An AGS Tutor... (I took C++ basic concepts and object oriented programing in college but that was over 5 years ago and I need brush ups on more effiencent ways of doing things or just how to implement the ideas I have in my head. I"m also unfamiliar as of yet of what AGS can do. But I am quickly Learning)

and eventually a Musician. If your interested GREAT!!  But, I don't have much at this point in time to give you to give you inspiration into and for the game.

************** Game Info  ********************
The game is Drawn in 800/600 Screen Resolution

32 bit True-color

Will feature Sierra With Background type dialogs

Voice Acting(This is WAY WAY in the future But will eventually be needed)

Due Date: ??? there is none.. We get done when we get done. With Real life as a first priority (as always should be) Things get put off or delayed and being a MMOG gamer I understand this. Like all good things in life. 'Anything worth having is worth working for' and 'its also the Journey that is important... not just the Goal.'

*******************************************
This is a fantasy adventure game. So That is my focus. I'm drawing inspiration on this game from Things like... DragonHeart... Eragon...Lord of the Rings... D&D....Legend of Zelda....Final Fantasy....Secret of Mana... Sword of Truth Book Series by Terry Goodkind.....King's Quest Series by Sierra On-Line........

If your a Fan of any of these things or just a lover of Fantasy. Then I want you on my team! I can set up our own forums for us to communicate in. I have MSN... YAHOO.... AIM  instant messengers to communicate with, and I might even be able to get my hands on a TeamSpeak Server for live voice chat for discussions on the game.

If your interested or want to know more information. Send me a Personal Message here or Email me at blueeyes_offire@hotmail.com
#34
Thank you... I'll get to work on that.... flbbd2fl could you tell me how you did make the lines less bold? So I could get a head start on that?
#35
The Tiles in the floor don't seem to match the perspective of the Force fields, just a small note, other then that, its great.. wish I could draw that good
#36
ok I changed the lighting and gave everything shadows.. there are no flames on the torch as of yet because it will be animated in game.. but is this any better? Or is just the art work crap and I should restart from scracth? :(

#37
THANKS MONKEY!!

Now I have my back up function.. now on to finding that missing bracket  *sigh*

When I rem out the function SpriteFont::display(int x,  int y, String Txt) Everything runs fine.. so its in there?!? But where???

*digs out magnifying glass*
"Mr. Lumpy.. the game is afoot!!"

EDIT: Found it.. there were to instances of missing ')' and the orginal post above has been updated... Thanks again monkey!
#38
Acutually the Full error is Runtime error: unexpected eof .... File: SpriteFont.asc ... Line -10 !?!?!?

First off I would like to abundantly thank anyone who attempts to solve my two problems. Two? Yes two, I will get to that in a second here.

Ok once more I'm trying to Customize SSH's SpriteFont to do more. I know you guys might start getting tired of me attempting this, but I refuse to give up

The Goal is to create this..



..Dynamically with these sprite tiles.

Custom Gui Text box Tiles


Custom sprite Letter Tiles


ok on to the two problems....

SSH's orginal code can be found here. http://ssh.me.uk/modules/SpriteFont.zip

(Jump down to the bottom of the post to see my explanation and requests)

My modification to SSH's SpriteFont struct in SpriteFont.ash is this....
Code: ags

struct SpriteFont {
  // Public
  import function SetFontSprite(char c, int spr);
  import function SetGuiSprite(int Ctr, int spr);     //****** My Gui Sprite Setting Function*********
  import function FontSpritesFromView(int v, char firstchar, char numsprites=-1);
  import function GuiSpritesFromView(int v);      //******* My import Gui sprites function*********
  import function FontSpritesFromChar(Character *c, char firstchar=-1, char numsprites=-1);
  import function SetFontSpriteFromFile(char c,  String filename);
  import function FontSpritesFromFiles(String fileroot, char firstchar, char numsprites);
  import function GetSpriteTextRawWidth(String t);
  import function GetSpriteTextRawHeight(String t);
  import function TextOnDrawingSurface(
#ifver 3.0
        DrawingSurface *ds, 
#endif
        int x, int y, String t, int transparent=0, int angle=0);
  import function TextOnBackground(int x, int y, String t, int transparent=0, int angle=0,  bool Dsp=true);
  import DynamicSprite *TextOnSprite(String t);
  import Overlay *TextOnOverlay(int x, int y, String t, bool transparent=0);
  import Overlay *RenderDisplay(int x, int y, String text );      // *******  monkey_05_06's  RenderDisplay  *******
                                                                                                                         // [[THANK YOU!!]]
  import function display(int x,  int y, String txt);  // My Display function
  int CharSpacing;
  int LineSpacing;
    
  // Private
  protected import function GetSpriteCharRawWidth(char c);
  protected int sn[MAX_CHAR_VALUE];
  protected int GuiSpriteNumber[9];    // *********My Gui Sprite holder Array*********
  protected int Max_Txt_Pxl_Width;   // ****My Maxium width of Desired Gui Text Box **
  protected DynamicSprite *ds[MAX_CHAR_VALUE];
};


My function definitions in SpriteFont.asc are......

Code: ags

 // *****************  My Gui Sprite Setting Function ************************
function SpriteFont::SetGuiSprite(int Ctr, int spr){
  this.GuiSpriteNumber[Ctr]=spr;  // Put the Sprite Number in Gui Text Box Ctr

}

// Modified from......

function SpriteFont::SetFontSprite(char c, int spr) {
  this.sn[c]=spr;
  this.ds[c]=null;
  int height=Game.SpriteHeight[spr];
  if (height>this.LineSpacing) this.LineSpacing=height; // find tallest char
}
.
.
.
// ************** My import Gui sprites function ***************************
//   Adapted from SpriteFont's FontSpritesFromView

function SpriteFont::GuiSpritesFromView(int v){
  int i=0;
  int loop=0;
  int frame=0;
  while (i!=8) {
    ViewFrame *vf=Game.GetViewFrame(v, loop, frame);
    this.SetGuiSprite(i, vf.Graphic);
    i++;
    frame++;
    if (frame >= Game.GetFrameCountForLoop(v, loop)) {
			loop++;
			frame=0;
		}
		if (loop >= Game.GetLoopCountForView(v)) {
				Display("ERROR: SpriteFont.GuiSpritesFromView: not enough sprites in view");
				QuitGame(0);
		}
	}
}  

function SpriteFont::FontSpritesFromView(int v, char firstchar, char numsprites) {
  int i=0;
  int loop=0;
  int frame=0;
  while (i!=numsprites) {
    ViewFrame *vf=Game.GetViewFrame(v, loop, frame);
    this.SetFontSprite(firstchar+i, vf.Graphic);
    i++;
    frame++;
    if (frame >= Game.GetFrameCountForLoop(v, loop)) {
			loop++;
			frame=0;
		}
		if (loop >= Game.GetLoopCountForView(v)) {
		  if (numsprites<0) return; // -1 just reads all sprites in view
		  else {
				Display("ERROR: SpriteFont.FontSpritesFromView: not enough sprites in view: specified %d, actually %d", numsprites, i);
				QuitGame(0);
		  }
		}
	}
}
.
.
.
// *****************************  monkey_05_06's  RenderDisplay **************************************
// It draws a nice box and boarder around the custom text, but that box and text are still stuck to the screen  :(
//                  Can anyone show me or mokey can you modify so this disapears like a regular Display() function?

Overlay *SpriteFont::RenderDisplay(int x, int y, String text) {
  if ((text == null) || (text == "")) return null; // invalid text parameter, abort
  int width = this.GetSpriteTextRawWidth(text) + this.LineSpacing + 4; // create the box big enough to fit the text, with 1/2 line-spacing padding, and a 2 pixel black border
  int height = this.GetSpriteTextRawHeight(text) + this.LineSpacing + 4;
  DynamicSprite *sprite = DynamicSprite.Create(width, height); // the sprite we will render our textbox onto
  DynamicSprite *textSprite = this.TextOnSprite(text); // here we grab the sprite-text into a sprite so we can draw it into our textbox
  DrawingSurface *surface = sprite.GetDrawingSurface(); // finally open up the sprite to begin drawing
  surface.DrawingColor = 31; // white for the background
  surface.DrawRectangle(0, 0, sprite.Width, sprite.Height); // fill the entire sprite with white, everything else will go on top
  surface.DrawingColor = 0; // black for the border
  surface.DrawLine(0, 0, 0, sprite.Height, 2); // draw the border at 2px wide
  surface.DrawLine(0, 0, sprite.Width, 0, 2);
  surface.DrawLine(sprite.Width, 0, sprite.Width, sprite.Height, 2);
  surface.DrawLine(0, sprite.Height, sprite.Width, sprite.Height, 2);
  surface.DrawImage(2 + (this.LineSpacing / 2), 2 + (this.LineSpacing / 2), textSprite.Graphic); // draw our text
  surface.Release(); // release the sprite so we can create the overlay
  textSprite.Delete(); // delete this sprite, we don't need it any more
  if (x == -1) x = (System.ViewportWidth - sprite.Width) / 2; // default x to center-screen
  if (y == -1) y = (System.ViewportHeight - sprite.Height) / 2; // default y to center-screen
  if (x < 0) x = 0; // if the x value is negative, set it back to 0
  if (y < 0) y = 0; // same for y value
  Overlay *displayOverlay = Overlay.CreateGraphical(x, y, sprite.Graphic, false); // create our overlay
  sprite.Delete(); // delete our temporary sprite
  return displayOverlay; // return the overlay so we can use it (move it around, remove it, etc.) (also if we don't it will be deleted! ;))
}
.
.
.
.
// ******************  My New attempt at a Text box Gui with custom Sprite Gui Text Tiles  *************************
function SpriteFont::display(int x,  int y, String Txt){

  int GuiBoxlength=0;
  int GuiBoxheight=0;
  int MiddleLoop=0; // int for how many Top Middle tiles there are?
  this.Max_Txt_Pxl_Width=600;  // Set Max text Length wanted. This will be setted by a function in the future
   
  if ((Txt == null) || (Txt == "")) return; // invalid text parameter, abort
  if ((x == 0) && (y == 0)){       // Set Default if no Parm is passed
    x=127;
    y=121;
  }

  int Txtwidth = this.GetSpriteTextRawWidth(Txt); // Get how long the text Graphics will be.
  int Lines = (Txtwidth / this.Max_Txt_Pxl_Width); // Find out how many lines will be in the Txt Box
    
  
  if (Lines == 0){   // if there is only 1 line. Get Box Length and height for sprite.
    // Get Sprite With of Top Left Gui Sprite
    int TopM=Game.SpriteWidth[this.GuiSpriteNumber[1]]; // Get Width of Top Middle custom Tile
  
    while(GuiBoxlength<Txtwidth){    // Get full Width of the Box's top middle
      GuiBoxlength+=TopM; 
      MiddleLoop++;  // adding how many top middle sprites there are
    }
  
    GuiBoxlength+=Game.SpriteWidth[this.GuiSpriteNumber[0]] * 2; // Add the length of the two Corner end pieces of the top part of the box for Full Width of the Gui Text Box
    GuiBoxheight=(Game.SpriteHeight[this.GuiSpriteNumber[0]] * 2) + (Game.SpriteHeight[this.GuiSpriteNumber[3]]);// Get height by X2 top corner pieces and middle graphic for Full Height of Gui Text Box
  }

  else{
    int TopM=Game.SpriteWidth[this.GuiSpriteNumber[1]];  // Get Width of Top Middle custom Tile
    while(GuiBoxlength<this.Max_Txt_Pxl_Width){    // Get how many Top Middle Tiles there are. This has to be done due to the fact 
                                                   // that custom Gui tile sizes are difrent lengths
      GuiBoxlength=GuiBoxlength + TopM;
      MiddleLoop++;  // adding how many top middle sprites there are to match Max_Txt_Pxl_Width
    }
    GuiBoxlength+=(Game.SpriteWidth[this.GuiSpriteNumber[0]] * 2); // Add the length of the two end pieces of the top part of the box
    GuiBoxheight=(Game.SpriteHeight[this.GuiSpriteNumber[0]] * 2) + (Game.SpriteHeight[this.GuiSpriteNumber[3]] * Lines);// Get height by X2 edge pieces pluss height of side middle tile X how many lines their are
  
  }

  //DynamicSprite *clr=DynamicSprite.CreateFromBackground(GetBackgroundFrame(), x, y, GuiBoxlength, GuiBoxheight); //create the erase image
  
  DynamicSprite *sprite=DynamicSprite.Create(GuiBoxlength, GuiBoxheight); // create a sprite as big as the text box needs to be.
  DrawingSurface *TxtBox=sprite.GetDrawingSurface(); // Make a drawing surface to Draw the tiles on too
  
  
  // Draw The Txt box
  int spriteX=x;  //create another x and y that we can manipulate to draw onto our txt box
  int spriteY=y;
  TxtBox.DrawImage(spriteX, spriteY, this.GuiSpriteNumber[0]);  // Draw Top Left Tile Onto the sprite
  spriteX+=Game.SpriteWidth[this.GuiSpriteNumber[0]]; // advance spriteX forward
  
  while(MiddleLoop>0){  //Put the Top Middle Tiles in
    TxtBox.DrawImage(spriteX, spriteY, this.GuiSpriteNumber[1]);
    spriteX+=Game.SpriteWidth[this.GuiSpriteNumber[1]]; 
    MiddleLoop--;
  }
  
  TxtBox.DrawImage(spriteX, spriteY, this.GuiSpriteNumber[2]); // Draw top Right Tile 
  
  // I stopped here to just to see if the top part of the Sprite would be drawn Correctly
  
  TxtBox.Release();  // Update Memory
  
   
  Overlay *displayOverlay = Overlay.CreateGraphical(x, y, sprite.Graphic, false); // create our overlay
  sprite.Delete(); // delete our temporary sprite
  //return displayOverlay; // return the overlay so we can use it (move it around, remove it, etc.) (also if we don't it will be deleted! ;))
  Wait(400);
  //clear.Release();
  displayOverlay.Remove();

}




Ok after I've added my code I get that weird Error... Runtime error: unexpected eof .... File: SpriteFont.asc ... Line -10 !?!?!?

So its something in my code but what?!?

OK These are my problems

1) How do I get rid of this Error? when I Rem my code out everything runs fine. But as far as I can tell every {} and () lines up so whats the deal and why would it do this at line -10???

2)Can anyone look over my code and make sure that it would actually work?

3)Help me use monkey_05_06's properly or how to modify it so it disapears after clicking or pressing a Key like a Display() function. Right now its glued to the screen. I would like to fix this so I can use it as a back up if my custom tile Gui text box is not doable.


Whats that? I said that there were only two problems and I listed three??  *shrugs* Sorry Thought of the third while writing this

But in all seriousness and kidding aside can anyone... ANYONE I TELL YOU help me with my problems. I would be eternally thankful and would make my game really awsome.

Also SSH if your reading this. Maybe you can use my code to give you a head start on making your SpriteFont even better? Thanks for makeing such a great script Module.
#39
How do I declare an integer Array that uses an enum value as the counter.

Normally you do..

int Array[10];

and you retrieve values by calling Array[1];

now do I that with enum values..

enum Direction {Top, bottom, Left, right};

int Array[Direction];

Array[Top];




Does this work? or how do I do it?
#40
Thank you so much.. I'll give this a shot.. thank you
SMF spam blocked by CleanTalk