diff --git a/Content/Materials/interface/crosshairs/cross.flax b/Content/Materials/interface/crosshairs/cross.flax new file mode 100644 index 0000000..2bf73be Binary files /dev/null and b/Content/Materials/interface/crosshairs/cross.flax differ diff --git a/Content/Scenes/MainScene.scene b/Content/Scenes/MainScene.scene index 76438ca..36e48cd 100644 --- a/Content/Scenes/MainScene.scene +++ b/Content/Scenes/MainScene.scene @@ -47,13 +47,11 @@ "Transform": { "Translation": { "X": 1355.0, - "Y": 791.0, + "Y": 730.0, "Z": 0.0 } }, - "Data": { - "Text": "15fps" -} + "Data": {} }, { "ID": "35b34b0c4476f0ed43aa8fb4d5f2eebc", @@ -64,6 +62,100 @@ "control": "ad0c546649722a6c7a6b9aa8fdcac019" } }, + { + "ID": "ebb8c92a4ff8ec3219a072b394accc0b", + "TypeName": "FlaxEngine.UIControl", + "ParentID": "ff6b6db54b5aa08e7286ef86246149ef", + "Name": "SpeedWidget" + }, + { + "ID": "9dc0648c43fc1553b23af188179c704f", + "TypeName": "Game.SpeedWidget", + "ParentID": "ebb8c92a4ff8ec3219a072b394accc0b", + "V": {} + }, + { + "ID": "2fe5467d4e92726e24227cbcbcbd2844", + "TypeName": "FlaxEngine.UIControl", + "ParentID": "ff6b6db54b5aa08e7286ef86246149ef", + "Name": "CrosshairWidget", + "Control": "FlaxEngine.GUI.Image", + "Data": { + "Brush": { + "$type": "FlaxEngine.GUI.MaterialBrush, FlaxEngine.CSharp", + "Material": "3f912eea48c6e2438fe49881210cb7d7" + }, + "Margin": { + "Left": 0.0, + "Right": 0.0, + "Top": 0.0, + "Bottom": 0.0 + }, + "Color": { + "R": 1.0, + "G": 1.0, + "B": 1.0, + "A": 1.0 + }, + "MouseOverColor": { + "R": 1.0, + "G": 1.0, + "B": 1.0, + "A": 1.0 + }, + "DisabledTint": { + "R": 0.5019608, + "G": 0.5019608, + "B": 0.5019608, + "A": 1.0 + }, + "KeepAspectRatio": false, + "ClipChildren": true, + "CullChildren": true, + "AnchorMin": { + "X": 0.0, + "Y": 0.0 + }, + "AnchorMax": { + "X": 1.0, + "Y": 1.0 + }, + "Offsets": { + "Left": 0.0, + "Right": 0.0, + "Top": 0.0, + "Bottom": 0.0 + }, + "Scale": { + "X": 1.0, + "Y": 1.0 + }, + "Pivot": { + "X": 0.5, + "Y": 0.5 + }, + "Shear": { + "X": 0.0, + "Y": 0.0 + }, + "Rotation": 0.0, + "BackgroundColor": { + "R": 0.0, + "G": 0.0, + "B": 0.0, + "A": 0.0 + }, + "Enabled": true, + "Visible": true, + "AutoFocus": false +} + }, + { + "ID": "e12c6b914501fde5098a14a350c2809c", + "TypeName": "Game.CrosshairWidget", + "ParentID": "2fe5467d4e92726e24227cbcbcbd2844", + "V": {} + }, { "ID": "9b0c532d4247061970c809a0af58c82a", "TypeName": "FlaxEngine.PostFxVolume", diff --git a/Source/Game/Hud/CrosshairWidget.cs b/Source/Game/Hud/CrosshairWidget.cs new file mode 100644 index 0000000..aabfc98 --- /dev/null +++ b/Source/Game/Hud/CrosshairWidget.cs @@ -0,0 +1,25 @@ +using System; +using System.Diagnostics; +using FlaxEngine; +using FlaxEngine.GUI; + +namespace Game +{ + public class CrosshairWidget : Script + { + private Image control; + + public override void OnAwake() + { + var uiControl = Actor.As(); + //control = new Image(); + //uiControl.Control = control; + + control = (Image)uiControl.Control; + } + + public override void OnUpdate() + { + } + } +} \ No newline at end of file