Example #1
0
 public void set_name(string aName)
 {
     //TODO complete hack, fix this..
     if (mText != null)
     {
         mElements.Remove(mText);
         mText.Element.destroy();
         mText = null;
     }
     if (aName != "")
     {
         aName = aName.ToUpper();
         mText = new ElementOffset(new FlatElementText(ManagerManager.Manager.mNewRef.genericFont, 30, "", Depth + 1), new Vector3(mBodyOffset, -90, 0));
         (mText.Element as FlatElementText).HardColor = new Color(0, 0, 0, 1);
         if (aName.Length > 9 && aName.Contains(" "))
         {
             (mText.Element as FlatElementText).Text = FlatElementText.convert_to_multiline(2, aName);
             mText.Position = mText.Position + new Vector3(0, 15, 0);
         }
         else
         {
             (mText.Element as FlatElementText).Text = aName;
         }
         mElements.Add(mText);
     }
 }
    public FlatUnlockIcon(CharacterIndex aChar, bool big, int aDepth)
    {
        var bgImage  = ManagerManager.Manager.mCharacterBundleManager.get_image(big?"UNLOCKABLES_BOX_BIG" : "UNLOCKABLES_BOX_SMALL");
        var charIcon = ManagerManager.Manager.mCharacterBundleManager.get_image("ICON_" + aChar.StringIdentifier);

        background = new FlatElementImage(bgImage.Image, bgImage.Data.Size, aDepth);
        icon       = new FlatElementImage(charIcon.Image, charIcon.Data.Size, aDepth + 1);
        name       = new FlatElementText(ManagerManager.Manager.mNewRef.genericFont, 50, FlatElementText.convert_to_multiline(1, aChar.ShortName.ToUpper()), aDepth + 1);

        mElements.Add(new FlatElementMultiBase.ElementOffset(background, new Vector3(0, 0, 0)));
        mElements.Add(new FlatElementMultiBase.ElementOffset(icon, new Vector3(0, 20, 0)));
        mElements.Add(new FlatElementMultiBase.ElementOffset(name, new Vector3(0, -200, 0)));

        PrimaryGameObject = create_primary_from_elements();
        Depth             = aDepth;
    }