void InitShipRename() { pnRename = new ImagePanel(); pnRename.Image = Root.Singleton.Material("img/customizeUI/box_shipname.png"); Util.LayoutControl(pnRename, 10, 10, pnRename.Image.Size, rctScreen); pnRename.Parent = Root.Singleton.Canvas; pnRename.Init(); var btnRenameShip = new ImageButton(); btnRenameShip.Image = Root.Singleton.Material("img/customizeUI/button_name_on.png"); btnRenameShip.HoveredImage = Root.Singleton.Material("img/customizeUI/button_name_select2.png"); btnRenameShip.DisabledImage = Root.Singleton.Material("img/customizeUI/button_name_off.png"); btnRenameShip.Enabled = true; btnRenameShip.OnClick += sender => { tbShipName.EditMode = true; Root.Singleton.Canvas.Focus = tbShipName; }; btnRenameShip.HoverSound = Root.Singleton.Sound("audio/waves/ui/select_light1.wav"); Util.LayoutControl(btnRenameShip, 8, 8, btnRenameShip.Image.Size, rctScreen); btnRenameShip.Parent = pnRename; btnRenameShip.Init(); tbShipName = new TextEntry(); tbShipName.Centered = true; tbShipName.AutoScale = false; tbShipName.Font = Root.Singleton.Font("fonts/num_font.ttf"); tbShipName.Text = "test"; Util.LayoutControl(tbShipName, 115, 4, 320, 33, rctScreen); tbShipName.Parent = pnRename; tbShipName.Init(); }
void InitShipNameText() { tbShipName = new TextEntry(); tbShipName.Centered = true; tbShipName.AutoScale = false; tbShipName.Font = Root.Singleton.Font("fonts/num_font.ttf"); tbShipName.Text = "test"; Util.LayoutControl(tbShipName, 115, 4, 320, 33, rctScreen); tbShipName.Parent = pnRename; tbShipName.Init(); }