Game Development Community

GUIButton

by Trent · in Torque X 3D · 03/05/2010 (5:07 pm) · 3 replies

Ok, I tried getting a button to work and the best I can do is get FillColor and TextColor working, no border. I read the AutoSkin system isn't working/implemented or something, is this still correct?

#1
03/05/2010 (7:02 pm)
I make all my buttons etc as bitmaps.

// Play Button
  GUIBitmap playBut = new GUIBitmap();
  playBut.Style = buttonStyle;
  playBut.Bitmap = @"data\images\GUI\btn_play_norm";
  playBut.Size = new Vector2(baseW, baseH);
  playBut.Position = new Vector2(baseX, baseY);
  playBut.Size = new Vector2(baseW, baseH);
  playBut.Visible = true;

  _playBut = new GUIBitmap();
  _playBut.Style = buttonStyle;
  _playBut.Bitmap = @"data\images\GUI\btn_play_hi";
  _playBut.Position = new Vector2(baseX, baseY);
  _playBut.Size = new Vector2(baseW, baseH);
  _playBut.Visible = false;

Then you flip the .Visible of the buttons as you scroll up or down or whatever. Looks a lot nicer and more professional.

#2
03/06/2010 (1:42 am)
Yeah that's the kind of thing I had considered doing, but I figured that the existing button class must work, but I guess I'm wrong!

Thanks Henry.
#3
04/11/2010 (4:38 pm)
There's also a really good resource out there that is a bitmap button.

http://www.torquepowered.com/community/resources/view/17835

I use it and it works out quite well.