Real Time

Started by AroliS^, May 20, 2019, 09:53 PM

Previous topic - Next topic

AroliS^

it is working great!
   
function Script::ScriptProcess()
{     
local time = System.GetDate( System.GetTimestamp( ), 'r' );
::time[ "date" ].Text = time.hour +" : "+ time.min;
}

in somewhere in your clientside's script!
function labelcreator( pos, colour, resizable )
{
local ui = GUILabel( pos, colour, resizable );
return  ui;
}

::time <-
{
date = labelcreator( VectorScreen( sX * 0.671, sY * 0.115 ), Colour( 255, 255, 255 ), true )
}

::timer[ "date" ].FontSize = sX * 0.025;




pastebin - https://pastebin.com/YUZPZkxz
Lemme love ya

dracc

Well, you run System.GetDate and update the GUILabel on every single processed frame - no wonder it's slow.

.

Quote from: dracc on May 21, 2019, 08:01 AMWell, you run System.GetDate and update the GUILabel on every single processed frame - no wonder it's slow.

Updating a GUI already happens at every frame.

His problem is that he is changing the font size at every frame. Which means the font atlas must be re-built on every frame. And that will actually kill your performance.

Basically it all boils down to this line:
::timer[ "date" ].FontSize = sX * 0.025;
This is a known issue. Pick a set of fonts and sizes and stick with them. Otherwise use a pre-generated image with the text and scale that.
.

AroliS^

Updated it thank u :)
Lemme love ya

=RK=MarineForce

You are genius bro ;X

i don't know when i made my own server with helpless...
Try to UnderStand ME!