Exemplo n.º 1
0
        void Init()
        {
            int[] mess_list = { 0 };

            Initialise(350, "Test App", mess_list);

            Heap = new OS.DynamicAreaHeap("C# Sprites",
                                          4 * 1024,                             // 4KB Initial
                                          10 * 1024 * 1024);                    // 10MB Max

            // Allocate 1MB of memory from the dynamic area to use as a sprite area.
            var sprite_area = Heap.Alloc(1 * 1024 * 1024);

            SpriteArea = new OSSpriteOp.SpriteArea(sprite_area, 1 * 1024 * 1024);

            CreateSprite();

            Wimp.WindowAttributes attributes = new Wimp.WindowAttributes("CSharp Sprites");
            attributes.WorkArea    = new OS.Rect(0, 0, 2000, 2000);
            attributes.UserRedrawn = true;

            SpriteWindow window = new SpriteWindow(Sprites,
                                                   attributes);

            // Use a lambda expression for the Quit handler.
            window.Closed += (sender, e) => Quit = true;

            window.Open(new OS.Rect(100, 100, 2000, 1500),                      // Visible area
                        new OS.Coord(0, 2000),                                  // Scroll offsets
                        Wimp.WindowStackPosition.Top);
        }
Exemplo n.º 2
0
    static void Init()
    {
        // Gets existing open window or if none, make a new one:
        SpriteWindow window = (SpriteWindow)EditorWindow.GetWindow(typeof(SpriteWindow));

        window.Show();
        window.name = "Sprite Window";
    }
Exemplo n.º 3
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            BasicWindow mainWindow = new SpriteWindow();

            mainWindow.CreateRecord();

            ApplicationContext theApplicationRecord = new ApplicationContext(mainWindow.record);

            Application.Run(theApplicationRecord);
        }