Custom Panel but weird text inside.

I created a Panel with Vgui Custom but when I test the Panel I have the text writed in half, weird.

and also I have an error with the line 34 in my text editor but not in gmod : the error is the ||

Some one have an idea why ?

http://img5.imageshack.us/img5/2610/halftext.jpg

[lua]
cLabel = {};
cLabel.Text = nil;
cLabel.TextAlign = nil;
cLabel.Font = nil;
cLabel.Color = nil;

function cLabel:Init()

self.Text ="";
self.TextAlign = 0;
self.Font = "ScoreboardText";
self.Color = Color( 255,255,255,255 );

end

function cLabel:Paint()

return true;

end

function cLabel:SetText ( text )
self.Text = text;
end
function cLabel:GetText()
return self.Text;
end

function cLabel:SetAlign( align )

if ( align == 0 || align == 1 ) then
	self.TextAlign = align;
else
	Msg( "Invalid align [" .. align .. "] passed to control!

" );
end
end
function cLabel:GetAlign()
return self.TextAlign;
end

function cLabel:SetFont( font )
self.Font = font;
end
function cLabel:GetFont()
return self.Font;
end

function cLabel:SetColor( Color )
if ( string.lower( type( color ) ) != “color” ) then
Msg( "Invalid color passed to label!
" );
return false;
else
self.Color = color;
end
end
function cLabel:GetColor()
self.Color = color;
end

function cLabel:Paint()

if ( self.TextAlign == 1 ) then
	x = self:GetWide() / 2;
else
	x = 0;
end


draw.DrawText( self.Text, self.Font, x, 0, self.Color, self.TextAlign );
return true;

end

cFrame = vgui.Create( “frame” );
cFrame:SetSize( 200,300 );
cFrame:SetPos( 100,100 );
cFrame:PostMessage( “SetTitle”, “text”, “cLabel Test” );
cFrame:SetVisible( true );

cLabelTest = vgui.Create( “cLabel”, cFrame );
cLabelTest:SetSize( 50, 10 );
cLabelTest:SetPos( 24, 70 );
cLabelTest:SetText( “Test” );
cLabelTest:SetAlign( 1 );

vgui.Register( “cLabel”, cLabel, “Panel” );
[/lua]

it may be becuse of the “||” they should be “|” instead

No they shouldn’t.

[editline]10:20AM[/editline]

“|” is a bitwise operator, “||” is syntactical sugar for “or” only available in the Garrysmod lua environment.

You just need to make your cLabel have a bigger height. That’s why it cuts it off.

isnt that C++ or am i mixing things up?

Garry added them to the Lua syntax for the garrysmod Lua environment, look here.