public override void OnAttachedToNode(Node node) { barNode = node.CreateChild(); barNode.Scale = new Vector3(1, 0, 1); //means zero height var box = barNode.CreateComponent <Box>(); box.Color = color; textNode = node.CreateChild(); textNode.Rotate(new Quaternion(0, 180, 0), TransformSpace.World); textNode.Position = new Vector3(0, 10, 0); text3D = textNode.CreateComponent <Text3D>(); text3D.SetFont(CoreAssets.Fonts.AnonymousPro, 60); //var font = new Font(); //var fontStream = Tools.Helpers.GetResourceStream("AideDeJeu.Pdf.Cinzel-Regular.otf"); //var memoryStream = new MemoryStream(); //fontStream.CopyTo(memoryStream); //memoryStream.Seek(0, SeekOrigin.Begin); //MemoryBuffer mb = new MemoryBuffer(memoryStream); //bool res = font.Load(mb); //text3D.SetFont(font, 60); text3D.TextEffect = TextEffect.Stroke; base.OnAttachedToNode(node); }
public void AddWidget(Widget widget) { Node widgetNode = new Node(); widgetNode.SetScale(0.1f); widgetNode.Position += new Vector3(widget.Position[0] * 0.1f, widget.Position[1] * 0.1f, widget.Position[2] * 0.1f); //Background Plane Node backgroundPlaneNode = widgetNode.CreateChild(); backgroundPlaneNode.Scale = new Vector3(1.9f, 1f, 1f); backgroundPlaneNode.Rotation = new Quaternion(-90, 0, 0); backgroundPlaneNode.Position += new Vector3(0, 0, 0.05f); Urho.Shapes.Plane plane = backgroundPlaneNode.CreateComponent <Urho.Shapes.Plane>(); plane.SetMaterial(Material.FromColor(new Color(0.6f, 0.6f, 0.6f, 0.5f))); //Text Component Text3D text = widgetNode.CreateComponent <Text3D>(); text.HorizontalAlignment = HorizontalAlignment.Center; text.VerticalAlignment = VerticalAlignment.Center; text.SetFont(CoreAssets.Fonts.AnonymousPro, 12); text.SetColor(Color.Red); text.Text = "LOADING..."; switch (widget.type) { case WidgetType.Text: //Text Widget Display TextWidget textWidget = widgetNode.CreateComponent <TextWidget>(); textWidget.Text = text; textWidget.Key = widget.NetworkKey; textWidget.Label = widget.Label; break; case WidgetType.Camera: //remove text text.Remove(); //Camera Widget CameraWidget cameraWidget = new CameraWidget(widget.NetworkKey, plane); widgetNode.AddComponent(cameraWidget); break; case WidgetType.Status: //adjust the size of the background plane backgroundPlaneNode.Scale = new Vector3(0.5f, 1f, 0.25f); //Status Widget StatusWidget statusWidget = new StatusWidget(text, plane, widget.NetworkKey, widget.Label); widgetNode.AddComponent(statusWidget); break; } Node.AddChild(widgetNode); }
public TextComponent(Node parentNode) { textNode = parentNode.CreateChild(); textNode.Rotate(new Quaternion(0, 180, 0), TransformSpace.World); //textNode.Position = new Vector3(0, 10, 0); text3D = textNode.CreateComponent <Text3D>(); text3D.SetFont(CoreAssets.Fonts.AnonymousPro, 10); text3D.TextEffect = TextEffect.Stroke; }
void CreateFlag(string text, float x, float y) // Used to create Tex3D flags { Node flagNode = scene.CreateChild("Flag"); flagNode.Position = (new Vector3(x, y, 0.0f)); Text3D flag3D = flagNode.CreateComponent <Text3D>(); // We use Text3D in order to make the text affected by zoom (so that it sticks to 2D) flag3D.Text = text; var cache = ResourceCache; flag3D.SetFont(cache.GetFont("Fonts/Anonymous Pro.ttf"), 15); }
void textLampuDua() { // Create text textLampB = lampBNode.CreateChild(); text3DB = textLampB.CreateComponent <Text3D>(); text3DB.HorizontalAlignment = HorizontalAlignment.Center; text3DB.VerticalAlignment = VerticalAlignment.Top; //text3D.ViewMask = 0x80000000; //hide from raycasts text3DB.Text = "Lamp is Off"; text3DB.SetFont(CoreAssets.Fonts.AnonymousPro, 26); text3DB.SetColor(Color.White); textLampB.Translate(new Vector3(0, -1f, -0.5f)); }
public override void OnAttachedToNode(Node node) { barNode = node.CreateChild(); barNode.Scale = new Vector3(1, 0, 1); //means zero height var box = barNode.CreateComponent<Box>(); box.Color = color; textNode = node.CreateChild(); textNode.Rotate(new Quaternion(0, 180, 0), TransformSpace.World); textNode.Position = new Vector3(0, 10, 0); text3D = textNode.CreateComponent<Text3D>(); text3D.SetFont(CoreAssets.Fonts.AnonymousPro, 60); text3D.TextEffect = TextEffect.Stroke; base.OnAttachedToNode(node); }
private void CreateDebugInformationNode() { if (_positionNodeDebug != null) { return; } _positionNodeDebug = Scene.CreateChild(); _positionNodeDebug.Scale = new Vector3(0.3f, 0.15f, 0.2f); _text3DDebug = _positionNodeDebug.CreateComponent <Text3D>(); _text3DDebug.HorizontalAlignment = HorizontalAlignment.Center; _text3DDebug.VerticalAlignment = VerticalAlignment.Top; _text3DDebug.ViewMask = 0x80000000; //hide from raycasts _text3DDebug.Text = $@"@Debug {DateTime.Now:T}"; _text3DDebug.SetFont(CoreAssets.Fonts.AnonymousPro, 10); _text3DDebug.SetColor(Color.White); }
public override void OnAttachedToNode(Node node) { barNode = node.CreateChild(); barNode.Scale = new Vector3(1, 0, 1); //means zero height var box = barNode.CreateComponent <Box>(); box.Color = color; textNode = node.CreateChild(); textNode.Rotate(new Quaternion(0, 180, 0), TransformSpace.World); textNode.Position = new Vector3(0, 10, 0); text3D = textNode.CreateComponent <Text3D>(); text3D.SetFont(Application.ResourceCache.GetFont("Fonts/Anonymous Pro.ttf"), 60); text3D.TextEffect = TextEffect.Stroke; //textNode.LookAt() //Look at camera base.OnAttachedToNode(node); }
protected override async void Start() { base.Start(); _environmentNode = Scene.CreateChild(); // Allow tap gesture EnableGestureTapped = true; // Create a bucket _bucketNode = Scene.CreateChild(); _bucketNode.SetScale(0.15f); //var bucketBaseNode = bucketNode.CreateChild(); // Create instructions _textNode = _bucketNode.CreateChild(); _text3D = _textNode.CreateComponent <Text3D>(); _text3D.HorizontalAlignment = HorizontalAlignment.Center; _text3D.VerticalAlignment = VerticalAlignment.Top; _text3D.ViewMask = 0x80000000; //hide from raycasts _text3D.Text = @"El Bruno - @elbruno Place on a horizontal surface and AirTap"; _text3D.SetFont(CoreAssets.Fonts.AnonymousPro, 20); _text3D.SetColor(Color.White); _textNode.Translate(new Vector3(0, 1f, -1.5f)); // Model and Physics for the bucket var bucketModel = _bucketNode.CreateComponent <StaticModel>(); _bucketMaterial = Material.FromColor(Color.Yellow); bucketModel.Model = ResourceCache.GetModel("bucket1.mdl"); bucketModel.SetMaterial(_bucketMaterial); bucketModel.ViewMask = 0x80000000; //hide from raycasts var rigidBody = _bucketNode.CreateComponent <RigidBody>(); var shape = _bucketNode.CreateComponent <CollisionShape>(); shape.SetTriangleMesh(bucketModel.Model, 0, Vector3.One, Vector3.Zero, Quaternion.Identity); // Material for spatial surfaces _spatialMaterial = new Material(); _spatialMaterial.SetTechnique(0, CoreAssets.Techniques.NoTextureUnlitVCol, 1, 1); var allowed = await StartSpatialMapping(new Vector3(50, 50, 10), 1200); }
public void SetText(string text) { if (TextComponent == null) { var cache = Application.ResourceCache; var node = Node; TextNode = node.CreateChild(); TextComponent = TextNode.CreateComponent <Text3D>(); TextComponent.HorizontalAlignment = HorizontalAlignment.Center; TextComponent.VerticalAlignment = VerticalAlignment.Top; TextComponent.ViewMask = 0x80000000; //hide from raycasts TextComponent.SetFont(cache.GetFont(Assets.Fonts.ChineseFont), 96); TextComponent.SetColor(Color.White); } Application.InvokeOnMain(() => { TextComponent.SetTextFix(text); }); }
public override void OnAttachedToNode(Node node) { this.Node?.RemoveChild(m_Geometry); this.Node?.RemoveChild(m_TextNode); this.Node?.RemoveChild(m_LevelTextNode); m_TextNode = node.CreateChild(); //m_TextNode.LookAt(new Vector3(0,-10,10), Vector3.Up, TransformSpace.World); // camera pos hardcoded !!! TODO: fix m_TextNode.Position += new Vector3(0f, 1f, 0f); m_Text = m_TextNode.CreateComponent <Text3D>(); m_Text.SetFont(CoreAssets.Fonts.AnonymousPro, 20); m_Text.SetColor(Color.Yellow); m_Text.EffectColor = Color.Black; m_Text.TextEffect = TextEffect.Shadow; m_LevelTextNode = node.CreateChild(); m_LevelTextNode.LookAt(new Vector3(-1f, -1f, 1f), Vector3.Up, TransformSpace.Local); // camera pos hardcoded !!! TODO: fix m_LevelTextNode.Position += new Vector3(0.25f, 0.5f, -0.5f); m_LevelText = m_LevelTextNode.CreateComponent <Text3D>(); m_LevelText.SetFont(CoreAssets.Fonts.AnonymousPro, 30); m_LevelText.SetColor(Color.Green); m_LevelText.EffectColor = Color.Black; m_LevelText.TextEffect = TextEffect.Shadow; m_LevelText.Text = Level.ToString(); m_Geometry = node.CreateChild(); var model = m_Geometry.CreateComponent <StaticModel>(); model.Model = Application.ResourceCache.GetModel(BuildingProperties.Model); model.SetMaterial(Application.ResourceCache.GetMaterial(BuildingProperties.Material)); m_Geometry.SetScale(BuildingProperties.Scale); m_Geometry.Position -= new Vector3(0f, 0.8f, 0f); Initialize(); m_ConstructionTask = m_Geometry.RunActionsAsync(new MoveTo(BuildingProperties.TimeToBuild, new Vector3(0, 0, 0))); }
public override void OnAttachedToNode(Node node) { base.OnAttachedToNode(node); // Create screen Node, scale it accordingly and rotate it so it faces camera screenNode = node.CreateChild("screenNode"); markerSphereNode = node.CreateChild("markerSphereNode"); backdropNode = node.CreateChild("backdrop"); loadingSpinner = new LoadingSpinner(node.CreateChild("spinner"), 40, 1); // Initialize marker sphere pool with arbitrary number of spheres Pool = new MarkerSpherePool(20, markerSphereNode); backdropNode.Scale = new Vector3(Height, 1, Width); // Rotate the camera in the clockwise direction with 90 degrees backdropNode.Rotate(new Quaternion(-90, 0, 0), TransformSpace.Local); // Apply camera orientation and an offset to match the no rotation position with QTM backdropNode.Rotate(new Quaternion(0, 90 - Camera.Orientation, 0), TransformSpace.Local); markerSphereNode.Rotate(new Quaternion(0, 0, -Camera.Orientation), TransformSpace.Local); // Create marker screen node and its plane defaultScreen = backdropNode.CreateComponent <Urho.Shapes.Plane>(); defaultScreen.SetMaterial(Material.FromColor(Urho.Color.Black, true)); // Create intensity plane, its material and assign it imageScreen = backdropNode.CreateComponent <Urho.Shapes.Plane>(); screenMaterial = new Material(); SetImageTexture(Camera.ImageResolution.Width, Camera.ImageResolution.Height); // Set detail info label // TODO: Fix magic numbers nodeDetailTextLabel = screenNode.CreateChild(); textLabel = nodeDetailTextLabel.CreateComponent <Text3D>(); if (Camera.Orientation == 0) { nodeDetailTextLabel.Position = new Vector3(-Width / 2 + 0.2f, -Height / 2 + 0.7f, -0.1f); } else { nodeDetailTextLabel.Position = new Vector3(-Height / 2 + 0.2f, -Width / 2 + 0.7f, -0.1f); } textLabel.Text = Camera.ID.ToString(); textLabel.SetFont(CoreAssets.Fonts.AnonymousPro, 55); textLabel.TextEffect = TextEffect.Stroke; // Set grid view info label nodeGridTextLabel = screenNode.CreateChild(); textLabel = nodeGridTextLabel.CreateComponent <Text3D>(); if (Camera.Orientation == 0) { nodeGridTextLabel.Position = new Vector3(-Width / 2 + 0.2f, -Height / 2 + 1f, -0.1f); } else { nodeGridTextLabel.Position = new Vector3(-Height / 2 + 0.2f, -Width / 2 + 1f, -0.1f); } textLabel.Text = Camera.ID.ToString(); textLabel.SetFont(CoreAssets.Fonts.AnonymousPro, 100); textLabel.TextEffect = TextEffect.Stroke; // Create a node and a text object to display messages centered in the camera screen nodeTextMessage = screenNode.CreateChild(); textMessage = nodeTextMessage.CreateComponent <Text3D>(); textMessage.SetFont(CoreAssets.Fonts.AnonymousPro, 35); textMessage.TextEffect = TextEffect.Stroke; textMessage.Text = "Intensity/Video mode is disabled in slave mode"; textMessage.VerticalAlignment = VerticalAlignment.Center; textMessage.HorizontalAlignment = HorizontalAlignment.Center; textMessage.TextAlignment = HorizontalAlignment.Center; nodeTextMessage.Enabled = false; nodeTextMessage.Position = new Vector3(0.0f, 0.0f, -0.1f); // Disable both label nodes at start nodeGridTextLabel.Enabled = false; nodeDetailTextLabel.Enabled = false; // Initialize current camera mode SetImageMode(Camera.IsImageMode()); // Subscribe to messages SubscribeToDataEvents(); // Create frame CreateFrame(screenNode, 0.04f); // Start with loading spinner enabled loadingSpinner.Start(); }
public override void OnAttachedToNode(Node node) { barNode = node.CreateChild(); barNode.Scale = new Vector3(1, 0, 1); //means zero height var box = barNode.CreateComponent<Box>(); box.Color = color; textNode = node.CreateChild(); textNode.Rotate(new Quaternion(0, 180, 0), TransformSpace.World); textNode.Position = new Vector3(0, 10, 0); text3D = textNode.CreateComponent<Text3D>(); text3D.SetFont(Application.ResourceCache.GetFont("Fonts/Anonymous Pro.ttf"), 60); text3D.TextEffect = TextEffect.None; //textNode.LookAt() //Look at camera base.OnAttachedToNode(node); }
void CreateScene() { var cache = ResourceCache; scene = new Scene(); // Create the Octree component to the scene. This is required before adding any drawable components, or else nothing will // show up. The default octree volume will be from (-1000, -1000, -1000) to (1000, 1000, 1000) in world coordinates; it // is also legal to place objects outside the volume but their visibility can then not be checked in a hierarchically // optimizing manner scene.CreateComponent <Octree>(); // Create a child scene node (at world origin) and a StaticModel component into it. Set the StaticModel to show a simple // plane mesh with a "stone" material. Note that naming the scene nodes is optional. Scale the scene node larger // (100 x 100 world units) Node planeNode = scene.CreateChild("Plane"); planeNode.Scale = new Vector3(100.0f, 1.0f, 100.0f); StaticModel planeObject = planeNode.CreateComponent <StaticModel>(); planeObject.Model = (cache.GetModel("Models/Plane.mdl")); planeObject.SetMaterial(cache.GetMaterial("Materials/StoneTiled.xml")); // Create a directional light to the world so that we can see something. The light scene node's orientation controls the // light direction; we will use the SetDirection() function which calculates the orientation from a forward direction vector. // The light will use default settings (white light, no shadows) Node lightNode = scene.CreateChild("DirectionalLight"); lightNode.SetDirection(new Vector3(0.6f, -1.0f, 0.8f)); // The direction vector does not need to be normalized Light light = lightNode.CreateComponent <Light>(); light.LightType = LightType.Directional; // Create more StaticModel objects to the scene, randomly positioned, rotated and scaled. For rotation, we construct a // quaternion from Euler angles where the Y angle (rotation about the Y axis) is randomized. The mushroom model contains // LOD levels, so the StaticModel component will automatically select the LOD level according to the view distance (you'll // see the model get simpler as it moves further away). Finally, rendering a large number of the same object with the // same material allows instancing to be used, if the GPU supports it. This reduces the amount of CPU work in rendering the // scene. const uint numObjects = 200; for (uint i = 0; i < numObjects; ++i) { Node mushroomNode = scene.CreateChild("Mushroom"); mushroomNode.Position = (new Vector3(NextRandom(90.0f) - 45.0f, 0.0f, NextRandom(90.0f) - 45.0f)); mushroomNode.SetScale(0.5f + NextRandom(2.0f)); StaticModel mushroomObject = mushroomNode.CreateComponent <StaticModel>(); mushroomObject.Model = (cache.GetModel("Models/Mushroom.mdl")); mushroomObject.SetMaterial(cache.GetMaterial("Materials/Mushroom.xml")); Node mushroomTitleNode = mushroomNode.CreateChild("MushroomTitle"); mushroomTitleNode.Position = (new Vector3(0.0f, 1.2f, 0.0f)); Text3D mushroomTitleText = mushroomTitleNode.CreateComponent <Text3D>(); mushroomTitleText.Text = "Mushroom " + i; mushroomTitleText.SetFont(cache.GetFont("Fonts/Anonymous Pro.sdf"), 24);//sdf, not ttf. size of font doesn't matter. mushroomTitleText.SetColor(Color.Red); if (i % 3 == 1) { mushroomTitleText.SetColor(Color.Green); mushroomTitleText.TextEffect = TextEffect.Shadow; mushroomTitleText.EffectColor = new Color(0.5f, 0.5f, 0.5f); } else if (i % 3 == 2) { mushroomTitleText.SetColor(Color.Yellow); mushroomTitleText.TextEffect = TextEffect.Stroke; mushroomTitleText.EffectColor = new Color(0.5f, 0.5f, 0.5f); } mushroomTitleText.SetAlignment(HorizontalAlignment.Center, VerticalAlignment.Center); } // Create a scene node for the camera, which we will move around // The camera will use default settings (1000 far clip distance, 45 degrees FOV, set aspect ratio automatically) CameraNode = scene.CreateChild("Camera"); CameraNode.CreateComponent <Camera>(); // Set an initial position for the camera scene node above the plane CameraNode.Position = (new Vector3(0.0f, 5.0f, 0.0f)); }
void CreateScene() { Renderer.HDRRendering = true; scene = new Scene(); scene.CreateComponent <Octree>(); var zone = scene.CreateComponent <Zone>(); zone.AmbientColor = new Color(0.3f, 0.3f, 0.3f); const float stepX = 0.23f; const float stepY = 0.3f; //by enabling this flag, we are able to edit assets via external editors (e.g. VS Code) and see changes immediately. ResourceCache.AutoReloadResources = true; cameraNode = scene.CreateChild(); cameraNode.CreateComponent <Camera>(); cameraNode.Position = new Vector3(stepX, -stepY, 0); Node lightNode = scene.CreateChild(); lightNode.SetDirection(new Vector3(-1, -1, 1)); Light light = lightNode.CreateComponent <Light>(); light.LightType = LightType.Directional; light.Brightness = 1.1f; lightNode.Position = new Vector3(0, 0, 0); //Add a skybox //var skyNode = scene.CreateChild("Sky"); //var skybox = skyNode.CreateComponent<Skybox>(); //skybox.Model = CoreAssets.Models.Sphere; //skybox.SetMaterial(ResourceCache.GetMaterial("Materials/Skybox2.xml")); //see /FeatureSamples/Assets/Data/Sample43 var materials = new string[, ] { { "NoTexture", "NoTextureUnlit", "NoTextureNormal", "NoTextureAdd", "NoTextureMultiply" }, { "Diff", "DiffUnlit", "DiffNormal", "DiffAlpha", "DiffAdd" }, { "DiffEmissive", "DiffSpec", "DiffNormalSpec", "DiffAO", "DiffEnvCube" }, { "Water", "Terrain", "NoTextureVCol", "Default", "CustomShader" }, }; for (int i = 0; i < materials.GetLength(1); i++) { for (int j = 0; j < materials.GetLength(0); j++) { var sphereNode = scene.CreateChild(); var earthNode = sphereNode.CreateChild(); var textNode = sphereNode.CreateChild(); var material = materials[j, i]; Text3D text = textNode.CreateComponent <Text3D>(); text.Text = material; text.SetFont(CoreAssets.Fonts.AnonymousPro, 13); text.TextAlignment = HorizontalAlignment.Center; text.VerticalAlignment = VerticalAlignment.Bottom; text.HorizontalAlignment = HorizontalAlignment.Center; textNode.Position = new Vector3(0, -0.75f, 0); sphereNode.Position = new Vector3(i * stepX, -j * stepY, 1); sphereNode.SetScale(0.2f); var earthModel = earthNode.CreateComponent <StaticModel>(); //for VCol we have a special model: if (material.Contains("VCol")) { earthModel.Model = ResourceCache.GetModel("Sample43/SphereVCol.mdl"); } else { //built-in sphere model (.mdl): earthModel.Model = CoreAssets.Models.Sphere; } earthModel.SetMaterial(ResourceCache.GetMaterial($"Sample43/Mat{material}.xml", sendEventOnFailure: false)); var backgroundNode = sphereNode.CreateChild(); backgroundNode.Scale = new Vector3(1, 1, 0.001f) * 1.1f; backgroundNode.Position = new Vector3(0, 0, 0.55f); var backgroundModel = backgroundNode.CreateComponent <StaticModel>(); backgroundModel.Model = CoreAssets.Models.Box; backgroundModel.SetMaterial(Material.FromImage("Sample43/Background.png")); earthNode.RunActions(new RepeatForever(new RotateBy(1f, 0, 5, 0))); } } }
private void MakeGameDetailScreen() { // Create a bucket leftGameDetailScreen = Scene.CreateChild("leftGameDetailScreen"); leftGameDetailScreen.Scale = leftDetail.WorldScale; leftGameDetailScreen.Position = leftDetail.WorldPosition; //leftGameDetailScreen.Scale = new Vector3(1f, 0.8f, 0.1f); //leftGameDetailScreen.Position = new Vector3(bucketNode.WorldPosition.X - 2.5f, bucketNode.WorldPosition.Y + 2, bucketNode.WorldPosition.Z - 3); leftGameDetailScreen.Rotation = new Quaternion(0, -LeftCamera.Node.Rotation.ToEulerAngles().Y, 0); // Model and Physics for the bucket var leftNodeModel = leftGameDetailScreen.CreateComponent <StaticModel>(); leftNodeModel.Model = CoreAssets.Models.Box; leftNodeModel.SetMaterial(Material.FromColor(Color.Transparent)); // Create instructions leftHitDetailScreen = leftGameDetailScreen.CreateChild(); leftHitDetailScreen.Position = new Vector3(0, 0.3f, 0); hitsText = leftHitDetailScreen.CreateComponent <Text3D>(); hitsText.HorizontalAlignment = HorizontalAlignment.Center; hitsText.VerticalAlignment = VerticalAlignment.Center; hitsText.ViewMask = 0x80000000; //hide from raycasts hitsText.Text = "Hits " + hits; hitsText.SetFont(CoreAssets.Fonts.AnonymousPro, 13); hitsText.SetColor(Color.FromHex("#5AC4BE")); leftHitDetailScreen.Translate(new Vector3(0, 0f, -0.55f)); // Create instructions var ballTextScreen = leftGameDetailScreen.CreateChild(); var ballText = ballTextScreen.CreateComponent <Text3D>(); ballText.HorizontalAlignment = HorizontalAlignment.Center; ballText.VerticalAlignment = VerticalAlignment.Center; ballText.ViewMask = 0x80000000; //hide from raycasts ballText.Text = "Balls"; ballText.SetFont(CoreAssets.Fonts.AnonymousPro, 13); ballText.SetColor(Color.FromHex("#5AC4BE")); ballTextScreen.Translate(new Vector3(0, 0f, -0.55f)); var availableBallsNode = leftGameDetailScreen.CreateChild(); availableBallsNode.Position = new Vector3(0, -0.3f, -0.55f); availableBallsNode.Scale = new Vector3(1f, 0.3f, 0.01f); var start = -0.4f; for (int i = 0; i < durationGame; i++) { var availableBall = availableBallsNode.CreateChild(); availableBall.Position = new Vector3(start, 0, 0); availableBall.Scale = new Vector3(0.15f, 0.5f, 1f); var availableBallModel = availableBall.CreateComponent <StaticModel>(); availableBallModel.Model = CoreAssets.Models.Sphere; availableBallModel.SetMaterial(Material.FromImage("Textures/Color_K04.jpg")); availableNodes[i] = availableBall; start += 0.2f; } // Create a bucket rightGameDetailScreen = Scene.CreateChild("rightGameDetailScreen"); rightGameDetailScreen.Scale = rightDetail.WorldScale; rightGameDetailScreen.Position = rightDetail.WorldPosition; rightGameDetailScreen.Rotation = new Quaternion(0, -LeftCamera.Node.Rotation.ToEulerAngles().Y, 0); // Create instructions righthitDetailScreen = rightGameDetailScreen.CreateChild(); righthitDetailScreen.Position = new Vector3(0, 0.3f, 0); missesText = righthitDetailScreen.CreateComponent <Text3D>(); missesText.HorizontalAlignment = HorizontalAlignment.Center; missesText.VerticalAlignment = VerticalAlignment.Center; missesText.ViewMask = 0x80000000; //hide from raycasts missesText.Text = misses + " Misses"; missesText.SetFont(CoreAssets.Fonts.AnonymousPro, 13); missesText.SetColor(Color.FromHex("#5AC4BE")); righthitDetailScreen.Translate(new Vector3(0, 0f, -0.55f)); // Model and Physics for the bucket var rightNodeModel = rightGameDetailScreen.CreateComponent <StaticModel>(); rightNodeModel.Model = CoreAssets.Models.Box; rightNodeModel.SetMaterial(Material.FromColor(Color.Transparent)); }