import os
from pyfbsdk import FBHUD, FBScene, FBApplication, FBSystem, FBHUDFlashElement, FBHUDTextElement, FBHUDTextureElement, FBHUDRectElement, FBTexture, FBHUDElementHAlignment
FBApplication().FileNew()
lHud = FBHUD("MyHUD 1")
lHud.Visibility = True
FBSystem().Scene.ConnectSrc(lHud)
FBSystem().Scene.Cameras[0].ConnectSrc(lHud)
lRect = FBHUDRectElement("My Rect");
lHud.ConnectSrc(lRect);
lRect.ScaleUniformly = False
lRect.Width = 100
lText = FBHUDTextureElement("My Texture");
lHud.ConnectSrc(lText);
lText.Height = 34
lText.Y = 50
lText.X = 60
lTextureFile = os.path.join(FBSystem().ConfigPath, 'Scripts/Samples/HUD/hud_texture.tif')
lTextureFile = os.path.normpath(lTextureFile)
lTexture1 = FBTexture(lTextureFile)
lText.Texture.append(lTexture1)
lFlashFile = os.path.join(FBSystem().ConfigPath, 'Scripts/Samples/HUD/hud_flash_v10.swf')
lFlashFile = os.path.normpath(lFlashFile)
lFlash = FBHUDFlashElement("My Flash");
lHud.ConnectSrc(lFlash);
lFlash.FilePath = lFlashFile;
lFlash.Height = 50
lFlash.Y = 20
lFlash.Align = FBHUDElementHAlignment.kFBHUDRight;
lRecordLight = lHud.CreateElement(FBHUD.eRecordLight, "The record light")