Esempio n. 1
0
    public void registerSprites()
    {
        buildMessageBackground();

        text = TextLabel.create(spriteRenderer, contentManager, "sierra_agi_font_black");
        text.alignCenter = true;
        text.worldPosition = new Vector3(0.5f, 0.5f, -9.5f);
        text.hide();

        //        textLabel = new GameObject("message text");
        //        textLabel.active = false;
        //        text = textLabel.AddComponent<GUIText>();
        //        textLabel.transform.position = new Vector3(0.5f, 0.5f, -9.5f);
        //        text.alignment = TextAlignment.Center;
        //        text.anchor = TextAnchor.MiddleCenter;
        //        text.font = font;
        //        text.material.SetColor("_Color", Color.black);

        leftBorder = spriteRenderer.add(new Sprite(), "messageBorder");
        rightBorder = spriteRenderer.add(new Sprite(), "messageBorder");
        topBorder = spriteRenderer.add(new Sprite(), "messageBorder");
        bottomBorder = spriteRenderer.add(new Sprite(), "messageBorder");

        // these are positive because they are relative to the camera's placement
        // the world z coordinate will be negative
        leftBorder.setDepth(-9f);
        rightBorder.setDepth(-9f);
        topBorder.setDepth(-9f);
        bottomBorder.setDepth(-9f);

        hide();
    }