Jump to content

TIMER


GTkoi
 Share

Recommended Posts

Script.font = "" -- path "Font" -- use TrueType font file
Script.pos = Vec2(0,30) -- Vec2 "Position"
Script.size = 15 -- float "Size"
Script.color = Vec4(1,1,0,1) -- color "Color"
Script.offset = 20 -- int "Offset" -- make larger if numbers get cut off

function Script:Start()
    self.font = Font:Load(self.font,self.size)
    if self.font == nil then
        Debug:Error("Select a font")
    end
end

function Script:PostRender(context)

    defaultFont = context:GetFont()

    r = self.size + self.offset
    w = self.pos.x + window:GetWidth()/2 - self.offset
    h = self.pos.y

    --time factor
    time = Time:GetCurrent()/1000
    context:SetBlendMode(1)
    context:SetColor(self.color)
    context:SetFont(self.font)
    context:DrawText(Math:Round(time),w,h,r,r,Text.VCenter+Text.Center)
    context:SetFont(defaultFont)
end

Link to comment
Share on other sites

Yeah, man. That's a little quirk in the system that I guess Josh never got around to straightening out.

Go to Scripts folder, and find "Main.lua". Open that and look for this:

    if gamemenu:Hidden() then
        
        --Update the app timing
        Time:Update()

        --Update the world
        world:Update()
        
    end

    --Render the world
    world:Render()


...then right before "world:Render()" add this line:

    gamemenu.gui:GetBase():Redraw()



 

fixbug.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...