Esempio n. 1
0
        protected override void OnAllocate(ActorBox box, AllocationFlags flags)
        {
            base.OnAllocate(box, flags);

            artwork_display.Allocate(new ActorBox()
            {
                X1 = 0,
                Y1 = 0,
                X2 = Width,
                Y2 = Height
            }, flags);

            float video_width, video_height;

            VideoTexture.GetSize(out video_width, out video_height);
            if (video_width > 0 && video_height > 0)
            {
                AllocateVideoTexture((int)video_width, (int)video_height);
            }
        }
Esempio n. 2
0
        protected override void OnAllocate(ActorBox box, AllocationFlags flags)
        {
            base.OnAllocate(box, flags);

            float width  = Width;
            float height = Height;

            if (width <= 0 || height <= 0 ||
                width == last_alloc_width || height == last_alloc_height ||
                Model == null)
            {
                return;
            }

            // Calculate the number of actors that will fit in our window
            visible_actor_count = ActorCache.GetActorCountForArea(ActorSize, (int)Width, (int)Height);
            if (visible_actor_count <= 0)
            {
                return;
            }

            BuildCloneGrid();

            last_alloc_width  = width;
            last_alloc_height = height;

            var   rand = new Random(allocation_seed);
            float size = (float)ActorSize;

            visible_grid_width  = (int)(Math.Ceiling(width / size));
            visible_grid_height = (int)(Math.Ceiling(height / size));

            for (int i = 0; i < visible_actor_count; i++)
            {
                var actor = GetRandomActor(rand);
                // Assign the artwork actor to a clone slot in the screen grid
                grid[i % visible_grid_width, i / visible_grid_width].Source = actor;
            }

            Resume();
        }
Esempio n. 3
0
        protected override void OnAllocate(ActorBox box, AllocationFlags flags)
        {
            base.OnAllocate (box, flags);

            artwork_display.Allocate (new ActorBox (0, 0, Width, Height), flags);

            float video_width, video_height;
            VideoTexture.GetSize (out video_width, out video_height);
            if (video_width > 0 && video_height > 0) {
                AllocateVideoTexture ((int)video_width, (int)video_height);
            }
        }