Radioactive-Software Radioactive-Software
Forum to discuss Radioactive-Software Products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How did you do your GUI system?
Goto page Previous  1, 2, 3, 4
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Radioactive-Software Forum Index -> Programming
View previous topic :: View next topic  
Author Message
dgreen
The One


Joined: 24 Sep 2005
Posts: 6811
Location: Raleigh, NC

PostPosted: Mon Apr 14, 2008 11:44 am    Post subject: Reply with quote

Razz Razz Razz Razz Razz
_________________
I run this place.
"Some muckety-muck architecture magazine was interviewing Will Wright about SimCity, and they asked
him a question something like "which ontological urban paridigm most influenced your design of the simulator,
the Exo-Hamiltonian Pattern Language Movement, or the Intra-Urban Deconstructionist Sub-Culture Hypothesis?"
He replied, "I just kind of optimized for game play."

Back to top
View user's profile Send private message Visit poster's website AIM Address
tylerp9p
Forum Regular


Joined: 08 Jan 2008
Posts: 20
Location: Behind you...

PostPosted: Tue Apr 15, 2008 5:32 am    Post subject: Reply with quote

I think I have a way to do your 3rd state checkbox.

I do this command:

if (MouseDown(1) == 1 & !(clicked))
{
clicked = true
// Add line here
DrawImage("check_boxblurred",x,y,16,16);
}

if (clicked & MouseDown(1) == 0)
{
clicked = true;
checkstate = !(checkstate);
clicked = false;
}

I believe that is what my actual source code is for changing the check state, minus the code checking if the mouse is in position and such.
_________________
C/C++/C# Programmer
VB.NET
LUA
Python
BlitzMax - (STUDYING)
DirectX/OpenGL APIs
Back to top
View user's profile Send private message Send e-mail
dgreen
The One


Joined: 24 Sep 2005
Posts: 6811
Location: Raleigh, NC

PostPosted: Tue Apr 15, 2008 8:33 pm    Post subject: Reply with quote

kewl.

I'll post my code l8r its on the other comp
_________________
I run this place.
"Some muckety-muck architecture magazine was interviewing Will Wright about SimCity, and they asked
him a question something like "which ontological urban paridigm most influenced your design of the simulator,
the Exo-Hamiltonian Pattern Language Movement, or the Intra-Urban Deconstructionist Sub-Culture Hypothesis?"
He replied, "I just kind of optimized for game play."

Back to top
View user's profile Send private message Visit poster's website AIM Address
dgreen
The One


Joined: 24 Sep 2005
Posts: 6811
Location: Raleigh, NC

PostPosted: Wed Apr 16, 2008 12:07 am    Post subject: Reply with quote

Ah here you go...straight from my engine Cool Cool Cool Cool Cool

You should see the code for all 50+ controls.

Rendering code : CGUI::RenderControlBitmaps()
Code:

  //Check Box
  case 1:
   if(State == 0)
   {
    Img.top = 75; Img.bottom = 90; Img.left = 177; Img.right = 192;
    GameEngine.DrawSprite(m_pWindow, &Img, &D3DXVECTOR2(1,1), NULL, 0, &D3DXVECTOR2(Pos.x,Pos.y), D3DCOLOR_ARGB(Alpha,r,g,b));
   } //end of if
   else if(State == 2 || State == 3)
   {
    Img.top = 50; Img.bottom = 65; Img.left = 202; Img.right = 217;
    GameEngine.DrawSprite(m_pWindow, &Img, &D3DXVECTOR2(1,1), NULL, 0, &D3DXVECTOR2(Pos.x,Pos.y), D3DCOLOR_ARGB(Alpha,r,g,b));
   } //end of else
   else
   {
    Img.top = 36; Img.bottom = 51; Img.left = 176; Img.right = 191;
    GameEngine.DrawSprite(m_pWindow, &Img, &D3DXVECTOR2(1,1), NULL, 0, &D3DXVECTOR2(Pos.x,Pos.y), D3DCOLOR_ARGB(Alpha,r,g,b));
   } //end of else
   break;




Rendering code : CGUI::RenderControlText()
Code:

   //Check Box
   case 1:
    if(State == 0)
    {
    m_pTickerFont->DrawText(Pos.x+17, Pos.y-1, D3DCOLOR_ARGB(Alpha, 0, 0, 0), (const TCHAR *)m_pWindows[WindowRef].m_Controls[ControlRef].m_TextVal.m_TextValue);
     m_pTickerFont->DrawText(Pos.x+16, Pos.y-2, D3DCOLOR_ARGB(Alpha, 120, 120, 120), (const TCHAR *)m_pWindows[WindowRef].m_Controls[ControlRef].m_TextVal.m_TextValue);
   } //end of if
    else
    {
    m_pTickerFont->DrawText(Pos.x+17, Pos.y-1, D3DCOLOR_ARGB(Alpha, 0, 0, 0), (const TCHAR *)m_pWindows[WindowRef].m_Controls[ControlRef].m_TextVal.m_TextValue);
    m_pTickerFont->DrawText(Pos.x+16, Pos.y-2, D3DCOLOR_ARGB(Alpha, 80, 80, 80), (const TCHAR *)m_pWindows[WindowRef].m_Controls[ControlRef].m_TextVal.m_TextValue);
   } //end of else
    break;




Logic code : CGUI::Update()
Code:

   //Check Box
   case 1: 
    if(GameEngine.DirectInput.m_MouseState.rgbButtons[0] & 0x80)
   {
    if(IsPointBound(CursorPos.x, CursorPos.y, m_pWindows[Window].m_Pos.x+m_pWindows[Window].m_Controls[i].m_Pos.x, m_pWindows[Window].m_Pos.y+m_pWindows[Window].m_Controls[i].m_Pos.y, 12, 12))
    {
      if(m_pWindows[Window].m_Controls[i].m_State == 0)
      {
       m_pWindows[Window].m_Controls[i].m_State = 2;    
     } //end of if
     else if(m_pWindows[Window].m_Controls[i].m_State == 1)
     {
       m_pWindows[Window].m_Controls[i].m_State = 3;    
     } //end of else if
    } //end of if   
   } //end of if
   else
   {
     //If in LAN mode don't allow them to change the check box
     if(gIsPlayingOnLANOnly == true && strcmp(m_pWindows[Window].m_Controls[i].m_TextVal.m_TextValue, "Search Only For LAN Games") == NULL)
    {
      m_pWindows[Window].m_Controls[i].m_State = 1;
     break;
    } //end of if

     if(m_pWindows[Window].m_Controls[i].m_State == 2)
    {
      //Execute action, play sound etc.
     GameEngine.FMOD.PlayStaticSound(13);
       m_pWindows[Window].m_Controls[i].m_State = 1;
    } //end of if

    if(m_pWindows[Window].m_Controls[i].m_State == 3)
    {
      //Execute action, play sound etc. 
     GameEngine.FMOD.PlayStaticSound(15);
       m_pWindows[Window].m_Controls[i].m_State = 0;
    } //end of if
   } //end of else
    break;

_________________
I run this place.
"Some muckety-muck architecture magazine was interviewing Will Wright about SimCity, and they asked
him a question something like "which ontological urban paridigm most influenced your design of the simulator,
the Exo-Hamiltonian Pattern Language Movement, or the Intra-Urban Deconstructionist Sub-Culture Hypothesis?"
He replied, "I just kind of optimized for game play."

Back to top
View user's profile Send private message Visit poster's website AIM Address
dgreen
The One


Joined: 24 Sep 2005
Posts: 6811
Location: Raleigh, NC

PostPosted: Wed Apr 16, 2008 12:50 am    Post subject: Reply with quote

rappen wrote:


...

More updates comming soon.

- Director of Rapscape, Rappen

- Scoopy Games


BELIEVE THE HYPE!!!1111


_________________
I run this place.
"Some muckety-muck architecture magazine was interviewing Will Wright about SimCity, and they asked
him a question something like "which ontological urban paridigm most influenced your design of the simulator,
the Exo-Hamiltonian Pattern Language Movement, or the Intra-Urban Deconstructionist Sub-Culture Hypothesis?"
He replied, "I just kind of optimized for game play."

Back to top
View user's profile Send private message Visit poster's website AIM Address
tylerp9p
Forum Regular


Joined: 08 Jan 2008
Posts: 20
Location: Behind you...

PostPosted: Wed Apr 16, 2008 5:27 am    Post subject: Reply with quote

Lmao at that GIF Danny.

Anyways, your code looks nice. One question, and this may seem stupid, I never understoof what the "m_" infront a lot of variables and instances were, does this mean managed? Or something?

The render SDK I use doesn't have the ability for seperate fonts, but I am waiting...
_________________
C/C++/C# Programmer
VB.NET
LUA
Python
BlitzMax - (STUDYING)
DirectX/OpenGL APIs
Back to top
View user's profile Send private message Send e-mail
rappen
Mini-Me


Joined: 22 Apr 2007
Posts: 6633
Location: Spijkenisse, Netherlands

PostPosted: Wed Apr 16, 2008 6:54 am    Post subject: Reply with quote

dgreen wrote:
rappen wrote:


...

More updates comming soon.

- Director of Rapscape, Rappen

- Scoopy Games


BELIEVE THE HYPE!!!1111



RAPSCAPE FTW....
_________________
Rappen Fo'shizzle my nizzle oh fo dizzle Razz

Back to top
View user's profile Send private message AIM Address MSN Messenger
dgreen
The One


Joined: 24 Sep 2005
Posts: 6811
Location: Raleigh, NC

PostPosted: Wed Apr 16, 2008 10:32 am    Post subject: Reply with quote

tylerp9p wrote:
Lmao at that GIF Danny.

Anyways, your code looks nice. One question, and this may seem stupid, I never understoof what the "m_" infront a lot of variables and instances were, does this mean managed? Or something?

The render SDK I use doesn't have the ability for seperate fonts, but I am waiting...


It's "hungarian notation" google for that, for more info, standard microsoft coding from the SDK, I use the same style. "m_" infront of a variable means it's a member variable, also putting the data type in front of the name of of the variable is part of it. So a member pointer for example would be declared as such "void* m_pDataPointer". A member float would be "float m_fVelocity" etc. everyone has their own perverse style of this notation, that's how I use it.
_________________
I run this place.
"Some muckety-muck architecture magazine was interviewing Will Wright about SimCity, and they asked
him a question something like "which ontological urban paridigm most influenced your design of the simulator,
the Exo-Hamiltonian Pattern Language Movement, or the Intra-Urban Deconstructionist Sub-Culture Hypothesis?"
He replied, "I just kind of optimized for game play."

Back to top
View user's profile Send private message Visit poster's website AIM Address
billeh
Billeh Bob


Joined: 06 Aug 2007
Posts: 327
Location: devon, uk

PostPosted: Wed Apr 16, 2008 10:55 am    Post subject: Reply with quote

rappen wrote:
dgreen wrote:
rappen wrote:


...

More updates comming soon.

- Director of Rapscape, Rappen

- Scoopy Games


BELIEVE THE HYPE!!!1111



RAPSCAPE FTW....


Sounds.. immence. Smile Me Want.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
rappen
Mini-Me


Joined: 22 Apr 2007
Posts: 6633
Location: Spijkenisse, Netherlands

PostPosted: Wed Apr 16, 2008 11:41 am    Post subject: Reply with quote

billeh wrote:
rappen wrote:
dgreen wrote:
rappen wrote:


...

More updates comming soon.

- Director of Rapscape, Rappen

- Scoopy Games


BELIEVE THE HYPE!!!1111



RAPSCAPE FTW....


Sounds.. immence. Smile Me Want.


it's still under developing, you can join Closed Beta.

You're getting a Rune Sword for free if you join CB!
_________________
Rappen Fo'shizzle my nizzle oh fo dizzle Razz

Back to top
View user's profile Send private message AIM Address MSN Messenger
dgreen
The One


Joined: 24 Sep 2005
Posts: 6811
Location: Raleigh, NC

PostPosted: Wed Apr 16, 2008 4:38 pm    Post subject: Reply with quote

rappen wrote:
billeh wrote:
rappen wrote:
dgreen wrote:
rappen wrote:


...

More updates comming soon.

- Director of Rapscape, Rappen

- Scoopy Games


BELIEVE THE HYPE!!!1111



RAPSCAPE FTW....


Sounds.. immence. Smile Me Want.


it's still under developing, you can join Closed Beta.

You're getting a Rune Sword for free if you join CB!


Why don't you create a forum for rapscape so I can spam the shit outa it.
_________________
I run this place.
"Some muckety-muck architecture magazine was interviewing Will Wright about SimCity, and they asked
him a question something like "which ontological urban paridigm most influenced your design of the simulator,
the Exo-Hamiltonian Pattern Language Movement, or the Intra-Urban Deconstructionist Sub-Culture Hypothesis?"
He replied, "I just kind of optimized for game play."

Back to top
View user's profile Send private message Visit poster's website AIM Address
tylerp9p
Forum Regular


Joined: 08 Jan 2008
Posts: 20
Location: Behind you...

PostPosted: Wed Apr 16, 2008 7:43 pm    Post subject: Reply with quote

I added a new in-game console and a third state for the checkbox Very Happy
_________________
C/C++/C# Programmer
VB.NET
LUA
Python
BlitzMax - (STUDYING)
DirectX/OpenGL APIs
Back to top
View user's profile Send private message Send e-mail
dgreen
The One


Joined: 24 Sep 2005
Posts: 6811
Location: Raleigh, NC

PostPosted: Wed Apr 16, 2008 8:10 pm    Post subject: Reply with quote

cool, keep at it Very Happy
_________________
I run this place.
"Some muckety-muck architecture magazine was interviewing Will Wright about SimCity, and they asked
him a question something like "which ontological urban paridigm most influenced your design of the simulator,
the Exo-Hamiltonian Pattern Language Movement, or the Intra-Urban Deconstructionist Sub-Culture Hypothesis?"
He replied, "I just kind of optimized for game play."

Back to top
View user's profile Send private message Visit poster's website AIM Address
rappen
Mini-Me


Joined: 22 Apr 2007
Posts: 6633
Location: Spijkenisse, Netherlands

PostPosted: Thu Apr 17, 2008 9:29 am    Post subject: Reply with quote

dgreen wrote:
rappen wrote:
billeh wrote:
rappen wrote:
dgreen wrote:
rappen wrote:


...

More updates comming soon.

- Director of Rapscape, Rappen

- Scoopy Games


BELIEVE THE HYPE!!!1111



RAPSCAPE FTW....


Sounds.. immence. Smile Me Want.


it's still under developing, you can join Closed Beta.

You're getting a Rune Sword for free if you join CB!


Why don't you create a forum for rapscape so I can spam the shit outa it.


nahh, too much work Razz
_________________
Rappen Fo'shizzle my nizzle oh fo dizzle Razz

Back to top
View user's profile Send private message AIM Address MSN Messenger
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Radioactive-Software Forum Index -> Programming All times are GMT - 5 Hours
Goto page Previous  1, 2, 3, 4
Page 4 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group