Difference between revisions of "TNewPlayer.HairColor"

From Soldat Community Wiki
Jump to: navigation, search
(Description)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
  '''''property TNewPlayer.HairColor: Longword'''''
 
  '''''property TNewPlayer.HairColor: Longword'''''
   Acess mode: RW
+
   Access mode: RW
 
==Description==
 
==Description==
3-bytes hexadecimal code representing the hair color of a bot. It's '''BGR''', not RGB.
+
3-bytes hexadecimal code representing the hair color of a bot. It's RGB.
  
 
== Example ==
 
== Example ==
Line 15: Line 15:
 
       MyBot.Headgear := 0; //nothing on the head so we can see the hair
 
       MyBot.Headgear := 0; //nothing on the head so we can see the hair
 
       MyBot.Hairstyle := 1; //cool dreadlocks
 
       MyBot.Hairstyle := 1; //cool dreadlocks
       MyBot.Haircolor := $0000FF; //red hair!
+
       MyBot.Haircolor := $0000FF; //blue hair!
 
       MyBot.PantsColor := $FFFFFFFF;
 
       MyBot.PantsColor := $FFFFFFFF;
 
       MyBot.SkinColor := $FFFFFFFF;
 
       MyBot.SkinColor := $FFFFFFFF;
Line 24: Line 24:
 
   end;
 
   end;
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
[[Category:TNewPlayer]]

Latest revision as of 06:02, 21 August 2018

property TNewPlayer.HairColor: Longword
 Access mode: RW

Description

3-bytes hexadecimal code representing the hair color of a bot. It's RGB.

Example

   var
    MyBot: TNewPlayer;
  begin
    MyBot := TNewPlayer.Create;
    try
      MyBot.Name := 'Cool test bot!';
      MyBot.Team := 1;
      MyBot.Headgear := 0; //nothing on the head so we can see the hair
      MyBot.Hairstyle := 1; //cool dreadlocks
      MyBot.Haircolor := $0000FF; //blue hair!
      MyBot.PantsColor := $FFFFFFFF;
      MyBot.SkinColor := $FFFFFFFF;
      Players.Add(MyBot);
    finally
      MyBot.Free;
    end;
  end;