Game Development Community

In-Game Windows and Cursors

by Dustin Witherite · in General Discussion · 03/14/2007 (8:58 pm) · 1 replies

I am working with the starter.fps mod and I apologize if I double posted. I can't remember if I posted this yet or not. I am still learning how to built GUI's and need help with something simple... I think. I have been hacking at this for about two weeks now, and I cannot find anything when searching through the forum which doesn't make sense since this is something that would be useful in RTS.

I found a way to turn the cursor on during gameplay under default.bind.cs:

function toggleCursor(%val)
{
if (%val)
{
if(!Canvas.isCursorOn()) // Check if curson off
{
Canvas.CursorOn(); // Turn on if off
}
else
{
Canvas.CursorOff(); // Turn off if on and return mouse controls
}
}
}

moveMap.bind(keyboard, c, toggleCursor);

***********

Now I used the built in GUI editor to place a guiWindowCTRL into my playGUI.gui interface. When I press the c button my cursor shows up, but I cannot click on or interact with my guiWindowCTRL. My final goal is to have windows for player status, weapon info, stats, etc. Any pointers to get me going again?

Thanks for all who helped so far with the cursor bit.

Dustin

#1
03/29/2007 (8:06 pm)
GOT IT!!! I can't believe I didn't see this in the beginning. I am using the Starter.FPS as a guide and well.... The stinking MainChatHud Takes up 3/4 of the screen..... Then when I place windows on my Playgui.gui the stinking MainChatHud captures and holds all mouse actions for ransom. I removed the call to push MainChatHud and use a new togglecursor keybind and everything works great. :D

Thanks for all the tips guys/gals. :D