public static SCLabelNode ( string message, LabelSize size, bool isLit ) : SCNNode | ||
message | string | |
size | LabelSize | |
isLit | bool | |
return | SCNNode |
public override void SetupSlide(PresentationViewController presentationViewController) { var labelNode = Utils.SCLabelNode("XAMARIN 2014", Utils.LabelSize.Normal, false); labelNode.Position = new SCNVector3(-3.6f, 29.5f, 20); // Reducing the text's flatness makes it smoother, less tesselated var text = (SCNText)labelNode.Geometry; text.Flatness = 0.1f; ContentNode.AddChildNode(labelNode); }
public override void SetupSlide(PresentationViewController presentationViewController) { TextManager.SetTitle("Renderers"); // Add labels var node = Utils.SCLabelNode("SCNView", Utils.LabelSize.Normal, true); node.Position = new SCNVector3(-14, 7, 0); ContentNode.AddChildNode(node); node = Utils.SCLabelNode("SCNLayer", Utils.LabelSize.Normal, true); node.Position = new SCNVector3(-2.2f, 7, 0); ContentNode.AddChildNode(node); node = Utils.SCLabelNode("SCNRenderer", Utils.LabelSize.Normal, true); node.Position = new SCNVector3(9.5f, 7, 0); ContentNode.AddChildNode(node); // Add images - SCNView var box = Utils.SCPlaneNode(NSBundle.MainBundle.PathForResource("Images/renderers/renderer-window", "png"), 8, true); box.Position = new SCNVector3(-10, 3, 5); ContentNode.AddChildNode(box); box = Utils.SCPlaneNode(NSBundle.MainBundle.PathForResource("Images/renderers/teapot", "tiff"), 6, true); box.Position = new SCNVector3(-10, 3, 5.1f); ContentNode.AddChildNode(box); // Add images - SCNLayer box = Utils.SCPlaneNode(NSBundle.MainBundle.PathForResource("Images/renderers/renderer-layer", "png"), 7.4f, true); box.Position = new SCNVector3(0, 3.5f, 5); box.Rotation = new SCNVector4(0, 0, 1, (float)(Math.PI / 20)); ContentNode.AddChildNode(box); box = Utils.SCPlaneNode(NSBundle.MainBundle.PathForResource("Images/renderers/teapot", "tiff"), 6, true); box.Position = new SCNVector3(0, 3.5f, 5.1f); box.Rotation = new SCNVector4(0, 0, 1, (float)(Math.PI / 20)); ContentNode.AddChildNode(box); // Add images - SCNRenderer box = Utils.SCPlaneNode(NSBundle.MainBundle.PathForResource("Images/renderers/renderer-framebuffer", "png"), 8, true); box.Position = new SCNVector3(10, 3.2f, 5); ContentNode.AddChildNode(box); box = Utils.SCPlaneNode(NSBundle.MainBundle.PathForResource("Images/renderers/teapot", "tiff"), 6, true); box.Position = new SCNVector3(10, 3, 5.1f); ContentNode.AddChildNode(box); }
private SCNNode AddNumberNode(string numberString, float x) { var numberNode = Utils.SCLabelNode(numberString, Utils.LabelSize.Large, true); numberNode.Geometry.FirstMaterial.Diffuse.Contents = NSColor.Orange; numberNode.Geometry.FirstMaterial.Ambient.Contents = NSColor.Orange; numberNode.Position = new SCNVector3(x, 50, 0); numberNode.Name = "number"; var text = (SCNText)numberNode.Geometry; text.ExtrusionDepth = 5; GroundNode.AddChildNode(numberNode); return(numberNode); }
public override void SetupSlide(PresentationViewController presentationViewController) { // Add some text TextManager.SetTitle("Working with DAE Files"); TextManager.SetSubtitle("DAE Files on OS X"); // DAE icon var daeIconNode = Utils.SCPlaneNode(NSBundle.MainBundle.PathForResource("Images/dae file icon", "png"), 5, false); daeIconNode.Position = new SCNVector3(0, 2.3f, 0); GroundNode.AddChildNode(daeIconNode); // Preview icon and text var previewIconNode = Utils.SCPlaneNodeWithImage(Utils.SCImageFromApplication("Preview"), 3, false); previewIconNode.Position = new SCNVector3(-5, 1.3f, 11); GroundNode.AddChildNode(previewIconNode); var previewTextNode = Utils.SCLabelNode("Preview", Utils.LabelSize.Small, false); previewTextNode.Position = new SCNVector3(-5.5f, 0, 13); GroundNode.AddChildNode(previewTextNode); // Quicklook icon and text var qlIconNode = Utils.SCPlaneNodeWithImage(Utils.SCImageFromApplication("Finder"), 3, false); qlIconNode.Position = new SCNVector3(0, 1.3f, 11); GroundNode.AddChildNode(qlIconNode); var qlTextNode = Utils.SCLabelNode("QuickLook", Utils.LabelSize.Small, false); qlTextNode.Position = new SCNVector3(-1.11f, 0, 13); GroundNode.AddChildNode(qlTextNode); // Xcode icon and text var xcodeIconNode = Utils.SCPlaneNodeWithImage(Utils.SCImageFromApplication("Xcode"), 3, false); xcodeIconNode.Position = new SCNVector3(5, 1.3f, 11); GroundNode.AddChildNode(xcodeIconNode); var xcodeTextNode = Utils.SCLabelNode("Xcode", Utils.LabelSize.Small, false); xcodeTextNode.Position = new SCNVector3(3.8f, 0, 13); GroundNode.AddChildNode(xcodeTextNode); }
public static SCNNode SCGaugeNode(string title, ref SCNNode progressNode) { var gaugeGroup = SCNNode.Create(); SCNTransaction.Begin(); SCNTransaction.AnimationDuration = 1; var gauge = SCNNode.Create(); gauge.Geometry = SCNCapsule.Create(0.4f, 8); gauge.Geometry.FirstMaterial.LightingModelName = SCNLightingModel.Constant; gauge.Rotation = new SCNVector4(0, 0, 1, (float)(Math.PI / 2)); gauge.Geometry.FirstMaterial.Diffuse.Contents = NSColor.White; gauge.Geometry.FirstMaterial.CullMode = SCNCullMode.Front; var gaugeValue = SCNNode.Create(); gaugeValue.Geometry = SCNCapsule.Create(0.3f, 7.8f); gaugeValue.Pivot = SCNMatrix4.CreateTranslation(new SCNVector3(0, 3.8f, 0)); gaugeValue.Position = new SCNVector3(0, 3.8f, 0); gaugeValue.Scale = new SCNVector3(1, 0.01f, 1); gaugeValue.Opacity = 0.0f; gaugeValue.Geometry.FirstMaterial.Diffuse.Contents = NSColor.FromDeviceRgba(0, 1, 0, 1); gaugeValue.Geometry.FirstMaterial.LightingModelName = SCNLightingModel.Constant; gauge.AddChildNode(gaugeValue); if (progressNode != null) { progressNode = gaugeValue; } var titleNode = Utils.SCLabelNode(title, LabelSize.Normal, false); titleNode.Position = new SCNVector3(-8, -0.55f, 0); gaugeGroup.AddChildNode(titleNode); gaugeGroup.AddChildNode(gauge); SCNTransaction.Commit(); return(gaugeGroup); }