Forum Libraries, Components, and Plugins

Error CS0507:

IanThompsonIanThompson GBMember

Hi, following the first page example using a basic console solution, using Xamarin Studio, on Win 7 64 bit.

    using System;

    using Urho;
    using Urho.Gui;
    using Urho.Actions;

    namespace Test1
    {
        class MainClass
        {
            public static void Main (string[] args)
            {
                UrhoEngine.Init();
                new MySample().Run();
    //          Console.WriteLine ("Hello World!");
    //          Console.ReadLine ();
            }
        }
    }

    class MySample : Application {
        public override void Start ()
        {
            CreateScene ();
            Input.KeyDown += (args) => {
                if (args.Key == Key.Esc) Engine.Exit ();
            };
        }

        async void CreateScene()
        {
            // UI text 
            var helloText = new Text()
            {
                Value = "Hello World from MySample",
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment = VerticalAlignment.Center
            };
            helloText.SetColor(new Color(0f, 1f, 1f));
            helloText.SetFont(
                font: ResourceCache.GetFont("Fonts/Font.ttf"), 
                size: 30);
            UI.Root.AddChild(helloText);

            // Create a top-level scene, must add the Octree
            // to visualize any 3D content.
            var scene = new Scene();
            scene.CreateComponent<Octree>();
            // Box
            Node boxNode = scene.CreateChild();
            boxNode.Position = new Vector3(0, 0, 5);
            boxNode.Rotation = new Quaternion(60, 0, 30);
            boxNode.SetScale(0f);
            StaticModel modelObject = boxNode.CreateComponent<StaticModel>();
            modelObject.Model = ResourceCache.GetModel("Models/Box.mdl");
            // Light
            Node lightNode = scene.CreateChild(name: "light");
            lightNode.SetDirection(new Vector3(0.6f, -1.0f, 0.8f));
            lightNode.CreateComponent<Light>();
            // Camera
            Node cameraNode = scene.CreateChild(name: "camera");
            Camera camera = cameraNode.CreateComponent<Camera>();
            // Viewport
            Renderer.SetViewport(0, new Viewport(scene, camera, null));
            // Perform some actions
            await boxNode.RunActionsAsync(
                new EaseBounceOut(new ScaleTo(duration: 1f, scale: 1)));
            await boxNode.RunActionsAsync(
                new RepeatForever(new RotateBy(duration: 1, 
                    deltaAngleX: 90, deltaAngleY: 0, deltaAngleZ: 0)));
        }
    }

`

This produces this error...

\Test1\Program.cs(23,23): Error CS0507: 'MySample.Start()': cannot change access modifiers when overriding 'protected' inherited member 'Urho.Application.Start()' (CS0507) (Test1)

on the line ...

public override void Start ()

Many thanks,

Ian

Posts

Sign In or Register to comment.