public void onResolutionChange() { resolution = GraphicCore.GetInitializator().GetResolution(); manaPoint.Y = resolution.Y - 168f; livePoint.Y = resolution.Y - 168f; energyPoint.Y = resolution.Y - 168f; manaEmpty.Y = resolution.Y - 168f; energyEmpty.Y = resolution.Y - 168f; liveEmpty.Y = resolution.Y - 168f; }
/// <summary> /// Funkce pro obnoveni obrazu /// </summary> public void UpdateLook() { if (GraphicCore.GetInitializator().IsDeviceLost()) { return; } matrixProjection = Matrix.PerspectiveFovLH((float)(Math.PI / 4f), (float)dev.PresentationParameters.DeviceWindow.Width / (float)dev.PresentationParameters.DeviceWindow.Height, 5f, farDistance); matrixView = Matrix.LookAtLH(position, lookAt, up); matrixViewProjection = matrixView * matrixProjection; clipVolume = ComputeClipVolume(); }
public HUD(Device device, Program form) { resolution = GraphicCore.GetInitializator().GetResolution(); manaPoint = new PointF(80f, resolution.Y - 168f); livePoint = new PointF(20f, resolution.Y - 168f); energyPoint = new PointF(140f, resolution.Y - 168f); manaEmpty = new System.Drawing.PointF(80f, resolution.Y - 168f); energyEmpty = new System.Drawing.PointF(140f, resolution.Y - 168f); liveEmpty = new System.Drawing.PointF(20f, resolution.Y - 168f); empty = TextureLoader.FromFile(device, @"Resources/HUD/prazdna.png"); live = TextureLoader.FromFile(device, @"Resources/HUD/zivot.png"); mana = TextureLoader.FromFile(device, @"Resources/HUD/mana.png"); energy = TextureLoader.FromFile(device, @"Resources/HUD/energie.png"); empty2 = TextureLoader.FromFile(device, @"Resources/HUD/prazdnej.png"); live2 = TextureLoader.FromFile(device, @"Resources/HUD/zelenejobdelnik.png"); this.device = device; this.form = form; NpcObjects = new List <SceneManager.SceneObject>(); sprite = new Sprite(device); sprite3d = new Sprite(device); s = new Sprite(device); sm = GraphicCore.GetCurrentSceneManager(); NpcObjects = sm.GetObjectsOfType(Type.GetType("WiccanRede.Objects.Player"), false); // NpcInfo = form.Game.GetAllNpcInfo(); f = new Microsoft.DirectX.Direct3D.Font(device, new System.Drawing.Font(System.Drawing.FontFamily.GenericSerif, 16)); f2 = new Microsoft.DirectX.Direct3D.Font(device, new System.Drawing.Font(System.Drawing.FontFamily.GenericSerif, 12)); }