Exemple #1
0
        public CanvasPanel(GameObject parent, Texture2D tex, Vector2 pos, Vector2 sz, Rect bgSubSection)
        {
            if (parent == null)
            {
                return;
            }

            position   = pos;
            size       = sz;
            canvas     = parent;
            background = new CanvasImage(parent, tex, pos, sz, bgSubSection);

            active = true;
        }
Exemple #2
0
        public void AddImage(string name, Texture2D tex, Vector2 pos, Vector2 size, Rect subSprite)
        {
            CanvasImage image = new CanvasImage(canvas, tex, position + pos, size, subSprite);

            images.Add(name, image);
        }