• Print

Author Topic: How to return a text with color  (Read 4203 times)

0 Members and 1 Guest are viewing this topic.

Offline Neku

  • Hero Member
  • *****
  • Posts: 549
  • Karma: 27
How to return a text with color
« on: August 01, 2014, 05:04:24 pm »
I'm trying to create a row for the TTT Scoreboard, and I couldn't figure out how to make it return a colored text.
So far, I have

Code: Lua
  1. self:AddColumn( "Title", function(ply) return ply:GetPData( "CustomTitleText", "" ) end )

How would I make it so it displays ply:GetPData( "CustomTitleColor", Color( 255, 255, 255, 255 ) )?
Out of the Garry's Mod business.

Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Re: How to return a text with color
« Reply #1 on: August 02, 2014, 03:12:49 am »
I don't remember if this is properly documented in the TTT hook documentation, but the function takes two other parameters (other than "Player ply"): "label", which is the DLabel object (this can be used to do "label:SetTextColor( Color( 255, 255, 255 ) )") and "width", which is the width of the column.
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.

  • Print