May 23, 2012, 01:36:27 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Please report any bugs or issues that you might be encountering with the Beta in the Support System so that we can better keep track of any oustanding issues that may come up.

GameCore Support System
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: fps in a form?  (Read 535 times)
pixel_legolas
Hero Member
*****
Posts: 786


View Profile
« on: June 05, 2009, 11:07:17 AM »

I am trying to add a label up in the right corner showing the FPS. How would I do it. Because when adding the normal fps line it "takes over" the text I already have in the bottom of screen. I want to have normal text and FPS showing.

Thanks
Logged
Ron
Sr. Member
****
Posts: 326


View Profile
« Reply #1 on: June 05, 2009, 02:44:30 PM »

Would Fraps work? (http://www.fraps.com/). I use it all the time and you can choose any of the four corners you want. The difference between the free version and pay version is the length of video capture and watermarking the video.
Logged
zknack
Full Member
***
Posts: 207


View Profile
« Reply #2 on: June 05, 2009, 03:37:14 PM »

This is from my work desk, so I'm trying my best, but won't be around the program for another few days most likely-
but I'm trying to help.

I think it'll go like this:
You should be able to do it fairly quickly, by opening the menu editor, doing a few things-

Create a form titled something like 'showfps', and define it with the 'float GetFPS()' function.


Now open your .lay file that's appropriate, (likely fps.lay)

and create layout box option to call up the 'showfps' form you just created in the spot you
specify in the .lay file..

This **should** work, and should be quick and easy. The menu editor is pretty impressive.

Helpful areas in the doc's:
http://www.gamecore3d.com/docs/user-guide/scripting/menu-scripting
http://www.gamecore3d.com/docs/user-guide/menu-gui/modal-dialogs

http://www.gamecore3d.com/docs/scripting-reference/gui/CreateControl
http://www.gamecore3d.com/docs/scripting-reference/gui/ShowForm
Logged
pixel_legolas
Hero Member
*****
Posts: 786


View Profile
« Reply #3 on: June 05, 2009, 04:22:24 PM »

I made a form called FPS and a panel on it called showfps.

here is the problem, I have no idea what to do next Smiley I know that I must define getFPS somewhere and the TextPlain FPS in some way but I jus don't know where Smiley
Logged
Ron
Sr. Member
****
Posts: 326


View Profile
« Reply #4 on: June 05, 2009, 07:30:28 PM »

Something like this may work...

Code:
Form FPS
{
HorizontalAlignment Right
VerticalAlignment Top
Size 360 350
Enabled 0

Label ShowFPS
{
FontColour 255 255 255 50
Location 14 260
AllowCaptureMouse 0
TextPlain Frames Per Second:
}

}




void MainGame()
{

ShowForm( "FPS");

while (true)
{

GetControl("FPS").GetControl("ShowFPS").SetTextPlain( "Frame Per Second: " + GetGameManager().GetFPS());

Delay( 0.01);
}

}
Logged
pixel_legolas
Hero Member
*****
Posts: 786


View Profile
« Reply #5 on: June 06, 2009, 05:33:54 AM »

That worked really well! Thanks
Logged
Pages: [1]
  Print  
 
Jump to:  

 
Powered by MySQL Powered by PHP bluBlur Skin © 2006, hbSkins
Powered by SMF 1.1.14 | SMF © 2006-2011, Simple Machines LLC
Valid XHTML 1.0! Valid CSS!